package org.geotools.sld.bindings; import javax.xml.namespace.QName; import org.geotools.sld.CssParameter; import org.geotools.xml.AbstractComplexBinding; import org.geotools.xml.ElementInstance; import org.geotools.xml.Node; import org.opengis.filter.FilterFactory; /** * Binding object for the element http://www.opengis.net/sld:VendorOption. * * <pre> * <xsd:element name="VendorOption"> * <xsd:annotation> * <xsd:documentation> * GeoTools specific vendor extensions that allow for implementation * specific features not necessarily supported by the core SLD spec. * </xsd:documentation> * </xsd:annotation> * <xsd:complexType mixed="true"> * <xsd:simpleContent> * <xsd:extension base="xsd:string"> * <xsd:attribute name="name" type="xsd:string" /> * </xsd:extension> * </xsd:simpleContent> * </xsd:complexType> * </xsd:element> * </pre> * @author Justin Deoliveira, OpenGeo * * * @source $URL: http://svn.osgeo.org/geotools/trunk/modules/extension/xsd/xsd-sld/src/main/java/org/geotools/sld/bindings/SLDVendorOptionBinding.java $ */ public class SLDVendorOptionBinding extends AbstractComplexBinding { FilterFactory filterFactory; public SLDVendorOptionBinding(FilterFactory filterFactory) { this.filterFactory = filterFactory; } public QName getTarget() { return SLD.VENDOROPTION; } public Class getType() { return CssParameter.class; } @Override public Object parse(ElementInstance instance, Node node, Object value) throws Exception { CssParameter option = new CssParameter((String) node.getAttributeValue("name")); option.setExpression(filterFactory.literal(instance.getText())); return option; } }