public Object getProperty(Object object, QName name) throws Exception { Property association = (Property) object; // non resolved, return the xlink:href if (XLINK.HREF.equals(name)) { String id = (String) association.getUserData().get("gml:id"); if (id != null) { return "#" + id; } } return null; } }
protected Map getClientProperties(Property attribute) throws DataSourceException { Map<Object, Object> userData = attribute.getUserData(); Map clientProperties = new HashMap<Name, Expression>(); if (userData != null && userData.containsKey(Attributes.class)) { Map props = (Map) userData.get(Attributes.class); if (!props.isEmpty()) { clientProperties.putAll(props); } } return clientProperties; }
/** * Encode any client properties (XML attributes) found in the UserData map of a ComplexAttribute * as XML attributes of the element. * * @param complex the ComplexAttribute to search for client properties * @param element the element to which XML attributes should be added */ @SuppressWarnings("unchecked") public static void encodeClientProperties(Property complex, Element element) { Map<Name, Object> clientProperties = (Map<Name, Object>) complex.getUserData().get(Attributes.class); if (clientProperties != null) { for (Name name : clientProperties.keySet()) { if (clientProperties.get(name) != null) { element.setAttributeNS( name.getNamespaceURI(), name.getLocalPart(), clientProperties.get(name).toString()); } } } }
Object existingValue = existingAttribute.getUserData().get(Attributes.class); if (existingValue != null) { assert existingValue instanceof HashMap;
if (userData[i] != null) { sf.getProperty(featureType.getDescriptor(i).getName()) .getUserData() .putAll(userData[i]);
convertedValue = nestedPropList; simpleContentProperties = nestedProp.getUserData();
Object clientProps = property.getUserData().get(Attributes.class); assertNotNull(clientProps); assertTrue(clientProps instanceof HashMap);
public Object getProperty(Object object, QName name) throws Exception { Property association = (Property) object; //non resolved, return the xlink:href if (XLINK.HREF.equals(name)) { String id = (String) association.getUserData().get("gml:id"); return "#" + id; } return null; } }
protected Map getClientProperties(Property attribute) throws DataSourceException { Map<Object, Object> userData = attribute.getUserData(); Map clientProperties = new HashMap<Name, Expression>(); if (userData != null && userData.containsKey(Attributes.class)) { Map props = (Map) userData.get(Attributes.class); if (!props.isEmpty()) { clientProperties.putAll(props); } } return clientProperties; }
/** Extracts from the provided properties any chained features resolved as links. */ @SuppressWarnings("unchecked") private List<Map<NameImpl, String>> getLinkedFeatures(List<Property> properties) { List<Map<NameImpl, String>> linkedFeatures = new ArrayList<>(); for (Property property : properties) { // get the attributes (XML attributes) associated with the current property Map<NameImpl, String> attributes = (Map<NameImpl, String>) property.getUserData().get(org.xml.sax.Attributes.class); if (checkIfFeatureIsLinked(property, attributes)) { // we have a linked features linkedFeatures.add(attributes); } } return linkedFeatures; }
/** * Encode any client properties (XML attributes) found in the UserData map of a ComplexAttribute * as XML attributes of the element. * * @param complex * the ComplexAttribute to search for client properties * @param element * the element to which XML attributes should be added */ @SuppressWarnings("unchecked") public static void encodeClientProperties(Property complex, Element element) { Map<Name, Object> clientProperties = (Map<Name, Object>) complex.getUserData().get( Attributes.class); if (clientProperties != null) { for (Name name : clientProperties.keySet()) { if (clientProperties.get(name) != null) { element.setAttributeNS(name.getNamespaceURI(), name.getLocalPart(), clientProperties.get(name).toString()); } } } }
Object existingValue = existingAttribute.getUserData().get(Attributes.class); if (existingValue != null) { assert existingValue instanceof HashMap;
(Map<NameImpl, String>) property.getUserData().get(org.xml.sax.Attributes.class); if (property instanceof ComplexAttribute) {
for (int i = 0; i < userData.length; i++) { if(userData[i] != null) { sf.getProperty(featureType.getDescriptor(i).getName()).getUserData().putAll(userData[i]);
bboxes.getUserData().get(GenericRecordBuilder.ORIGINAL_BBOXES); for (ReferencedEnvelope re : originalBoxes) { try {
.getUserData().get(GenericRecordBuilder.ORIGINAL_BBOXES); for (ReferencedEnvelope re : originalBoxes) { try {
p.getUserData().get(GenericRecordBuilder.ORIGINAL_BBOXES); for (ReferencedEnvelope re : originalBoxes) { try {
private void assertBBox(Feature f, ReferencedEnvelope... envelopes) throws Exception { Property p = f.getProperty(CSWRecordDescriptor.RECORD_BBOX_NAME); MultiPolygon geometry = (MultiPolygon) p.getValue(); List<ReferencedEnvelope> featureEnvelopes = (List<ReferencedEnvelope>) p.getUserData().get(GenericRecordBuilder.ORIGINAL_BBOXES); ReferencedEnvelope total = null; for (int i = 0; i < envelopes.length; i++) { assertEquals(envelopes[i], featureEnvelopes.get(i)); ReferencedEnvelope re = envelopes[i].transform(CSWRecordDescriptor.DEFAULT_CRS, true); if(total == null) { total = re; } else { total.expandToInclude(re); } } assertTrue(total.contains(geometry.getEnvelopeInternal())); }
private void assertBBox(Feature f, ReferencedEnvelope... envelopes) throws Exception { PropertyName bbox = ff.property("gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox", MetaDataDescriptor.NAMESPACES); Property p = (Property) bbox.evaluate(f); MultiPolygon geometry = (MultiPolygon) p.getValue(); List<ReferencedEnvelope> featureEnvelopes = (List<ReferencedEnvelope>) p.getUserData().get(GenericRecordBuilder.ORIGINAL_BBOXES); ReferencedEnvelope total = null; for (int i = 0; i < envelopes.length; i++) { assertEquals(envelopes[i], featureEnvelopes.get(i)); ReferencedEnvelope re = envelopes[i].transform(CSWRecordDescriptor.DEFAULT_CRS, true); if(total == null) { total = re; } else { total.expandToInclude(re); } } assertTrue(total.contains(geometry.getEnvelopeInternal())); }
Object clientProps = property.getUserData().get(Attributes.class); assertNotNull(clientProps); assertTrue(clientProps instanceof HashMap);