/** * @see AbstractComplexBinding#encode(java.lang.Object, org.w3c.dom.Document, * org.w3c.dom.Element) */ @Override public Element encode(Object object, Document document, Element value) throws Exception { if (object instanceof ComplexAttribute) { ComplexAttribute complex = (ComplexAttribute) object; if (complex.getProperties().size() == 1) { Property prop = complex.getProperties().iterator().next(); checkXlinkHref(prop, complex); } GML3EncodingUtils.encodeClientProperties(complex, value); GML3EncodingUtils.encodeSimpleContent(complex, document, value); } else if (!isPlaceholderObject(object) && !(object instanceof Collection)) { GML3EncodingUtils.encodeAsText(document, value, object); } return value; }
/** @see AbstractComplexBinding#getProperty(java.lang.Object, javax.xml.namespace.QName) */ @Override public Object getProperty(Object object, QName name) throws Exception { if (object instanceof ComplexAttribute) { ComplexAttribute complex = (ComplexAttribute) object; Property property = complex.getProperty(toTypeName(name)); if (property != null && !(property instanceof ComplexAttribute)) { return property.getValue(); } if ("id".equals(name.getLocalPart())) { return complex.getIdentifier(); } } return null; }
/** * @see org.geotools.xml.AbstractComplexBinding#encode(java.lang.Object, org.w3c.dom.Document, * org.w3c.dom.Element) */ @Override public Element encode(Object object, Document document, Element value) throws Exception { if (object instanceof ComplexAttribute) { ComplexAttribute complex = (ComplexAttribute) object; if (complex.getProperties().size() == 1) { Property prop = complex.getProperties().iterator().next(); checkXlinkHref(prop, complex); } GML3EncodingUtils.encodeClientProperties(complex, value); GML3EncodingUtils.encodeSimpleContent(complex, document, value); } return value; }
map = (Map<Name, Object>) clientProperties; map.put(toTypeName(XLINK.HREF), "#" + id.toString());
/** * @see org.geotools.xml.AbstractComplexBinding#getProperty(java.lang.Object, * javax.xml.namespace.QName) */ @Override public Object getProperty(Object object, QName name) throws Exception { if (object instanceof ComplexAttribute) { ComplexAttribute complex = (ComplexAttribute) object; Property property = complex.getProperty(toTypeName(name)); if (property != null && !(property instanceof ComplexAttribute)) { return property.getValue(); } if ("id".equals(name.getLocalPart())) { return complex.getIdentifier(); } } return null; }
map = (Map<Name, Object>) clientProperties; map.put(toTypeName(XLINK.HREF), "#" + id.toString());