use of org.xml.sax.helpers.NamespaceSupport in project ddf by codice.
the class CswRecordMapperFilterVisitor method visit.
@Override
public Object visit(PropertyName expression, Object extraData) {
if (expression == null) {
LOGGER.debug("Attempting to visit a null expression");
return null;
}
convertGeometryExpressionToEpsg4326(expression);
String propertyName = expression.getPropertyName();
String name;
if (CswConstants.BBOX_PROP.equals(propertyName) || CswConstants.OWS_BOUNDING_BOX.equals(propertyName) || GmdConstants.APISO_BOUNDING_BOX.equals(propertyName)) {
name = Metacard.ANY_GEO;
} else {
NamespaceSupport namespaceSupport = expression.getNamespaceContext();
name = DefaultCswRecordMap.getDefaultCswRecordMap().getDefaultMetacardFieldForPrefixedString(propertyName, namespaceSupport);
if (SPATIAL_QUERY_TAG.equals(extraData)) {
AttributeDescriptor attrDesc = metacardType.getAttributeDescriptor(name);
if (attrDesc != null && !AttributeType.AttributeFormat.GEOMETRY.equals(attrDesc.getType().getAttributeFormat())) {
throw new UnsupportedOperationException("Attempted a spatial query on a non-geometry-valued attribute (" + propertyName + ")");
}
}
}
LOGGER.debug("Converting \"{}\" to \"{}\"", propertyName, name);
return getFactory(extraData).property(name);
}
Aggregations