public boolean canEncode(Element element, Object value, Map hints) { if ((hints != null) && hints.containsKey(FilterSchema.FILTER_CAP_KEY)) { FilterCapabilities fc = (FilterCapabilities) hints.get(FilterSchema.FILTER_CAP_KEY); FilterCapabilities elementkey = FilterCapabilities.findOperation(element.getName()); if ((elementkey == null) || !fc.supports(elementkey)) { return false; } } return (element.getType() != null) && getName().equals(element.getType().getName()) && value instanceof BinarySpatialOperator; }
/** * @see org.geotools.xml.schema.Type#getValue(org.geotools.xml.schema.Element, * org.geotools.xml.schema.ElementValue[], org.xml.sax.Attributes, java.util.Map) */ public Object getValue(Element element, ElementValue[] value, Attributes attrs, Map hints) throws SAXException, SAXNotSupportedException { if ((element == null) || (value == null)) { throw new SAXException("Parameter missing for Comparison_OperatorsType"); } if (value.length < 1) { throw new SAXException("Missing child element"); } FilterCapabilities caps = new FilterCapabilities(); for (int i = 0; i < value.length; i++) { caps.addAll(FilterCapabilities.findOperation(value[i].getElement().getName())); } return caps; }
/** * @see org.geotools.xml.schema.Type#getValue(org.geotools.xml.schema.Element, * org.geotools.xml.schema.ElementValue[], org.xml.sax.Attributes, java.util.Map) */ public Object getValue(Element element, ElementValue[] value, Attributes attrs, Map hints) throws SAXException, SAXNotSupportedException { if ((element == null) || (value == null)) { throw new SAXException("Missing parameter for Spatial_OperatorsType"); } if (value.length < 1) { throw new SAXException("Atleast one child element is required"); } FilterCapabilities caps = new FilterCapabilities(); for (int i = 0; i < value.length; i++) { caps.addAll(FilterCapabilities.findOperation(value[i].getElement().getName())); } return caps; }
/** * @see org.geotools.xml.schema.Type#getValue(org.geotools.xml.schema.Element, * org.geotools.xml.schema.ElementValue[], org.xml.sax.Attributes, java.util.Map) */ public Object getValue(Element element, ElementValue[] value, Attributes attrs, Map hints) throws SAXException, SAXNotSupportedException { if ((element == null) || (value == null)) { throw new SAXException("Parameter missing for Comparison_OperatorsType"); } if (value.length < 1) { throw new SAXException("Missing child element"); } FilterCapabilities caps = new FilterCapabilities(); for (int i = 0; i < value.length; i++) { String name = value[i].getElement().getName(); if (name.equals("Functions")) caps.addAll((FilterCapabilities) value[i].getValue()); else caps.addAll(FilterCapabilities.findOperation(name)); } return caps; }