/*
* 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.sld.bindings.SLDFeatureTypeStyleBinding;
import org.geotools.styling.FeatureTypeStyle;
import org.geotools.styling.StyleFactory;
import org.geotools.xml.*;
import javax.xml.namespace.QName;
/**
* Binding object for the element http://www.opengis.net/se:CoverageStyle.
*
* <p>
*
* <pre>
* <code>
* <xsd:element name="CoverageStyle" type="se:CoverageStyleType">
* <xsd:annotation>
* <xsd:documentation>
* A CoverageStyle contains styling information specific to one
* Coverage offering.
* </xsd:documentation>
* </xsd:annotation>
* </xsd:element>
*
* </code>
* </pre>
*
* *
*
* <pre>
* <code>
* <xsd:complexType name="CoverageStyleType">
* <xsd:sequence>
* <xsd:element minOccurs="0" ref="se:Name"/>
* <xsd:element minOccurs="0" ref="se:Description"/>
* <xsd:element minOccurs="0" ref="se:CoverageName"/>
* <xsd:element maxOccurs="unbounded" minOccurs="0" ref="se:SemanticTypeIdentifier"/>
* <xsd:choice maxOccurs="unbounded">
* <xsd:element ref="se:Rule"/>
* <xsd:element ref="se:OnlineResource"/>
* </xsd:choice>
* </xsd:sequence>
* <xsd:attribute name="version" type="se:VersionType"/>
* </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/CoverageStyleBinding.java $
*/
public class CoverageStyleBinding extends FeatureTypeStyleBinding {
public CoverageStyleBinding(StyleFactory styleFactory) {
super(styleFactory);
}
/**
* @generated
*/
public QName getTarget() {
return SE.CoverageStyle;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated modifiable
*/
public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
FeatureTypeStyle fts = (FeatureTypeStyle) super.parse(instance, node, value);
if (node.hasChild("CoverageName")) {
QName name = (QName) node.getChildValue("CoverageName");
fts.setFeatureTypeName(name.getPrefix() != null ?
name.getPrefix()+":"+name.getLocalPart() : name.getLocalPart());
}
return fts;
}
}