/*
* GeoTools - The Open Source Java GIS Toolkit
* http://geotools.org
*
* (C) 2002-2010, Open Source Geospatial Foundation (OSGeo)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/
package org.geotools.se.v1_1.bindings;
import org.geotools.se.v1_1.SE;
import org.geotools.styling.ColorMapEntry;
import org.geotools.styling.StyleFactory;
import org.geotools.xml.*;
import org.opengis.filter.FilterFactory;
import org.opengis.filter.expression.Expression;
import javax.xml.namespace.QName;
/**
* Binding object for the element http://www.opengis.net/se:InterpolationPoint.
*
* <p>
*
* <pre>
* <code>
* <xsd:element name="InterpolationPoint"
* substitutionGroup="ogc:expression" type="se:InterpolationPointType"/>
*
* </code>
* </pre>
*
* <pre>
* <code>
* <xsd:complexType name="InterpolationPointType">
* <xsd:complexContent>
* <xsd:extension base="ogc:ExpressionType">
* <xsd:sequence>
* <xsd:element ref="se:Data"/>
* <xsd:element ref="se:Value"/>
* </xsd:sequence>
* </xsd:extension>
* </xsd:complexContent>
* </xsd:complexType>
*
* </code>
* </pre>
*
* </p>
*
* @generated
*
* @source $URL: http://svn.osgeo.org/geotools/trunk/modules/extension/xsd/xsd-sld/src/main/java/org/geotools/se/v1_1/bindings/InterpolationPointBinding.java $
*/
public class InterpolationPointBinding extends AbstractComplexBinding {
StyleFactory styleFactory;
FilterFactory filterFactory;
public InterpolationPointBinding(StyleFactory styleFactory, FilterFactory filterFactory) {
this.styleFactory = styleFactory;
this.filterFactory = filterFactory;
}
/**
* @generated
*/
public QName getTarget() {
return SE.InterpolationPoint;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated modifiable
*/
public Class getType() {
return ColorMapEntry.class;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated modifiable
*/
public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
ColorMapEntry entry = styleFactory.createColorMapEntry();
//<xsd:element ref="se:Data"/>
entry.setQuantity(filterFactory.literal(node.getChildValue("Data")));
//<xsd:element ref="se:Value"/>
entry.setColor((Expression) node.getChildValue("Value"));
return entry;
}
}