001: /*
002: * GeoTools - OpenSource mapping toolkit
003: * http://geotools.org
004: * (C) 2002-2006, GeoTools Project Managment Committee (PMC)
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation;
009: * version 2.1 of the License.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: */
016: package org.geotools.sld.bindings;
017:
018: import org.picocontainer.MutablePicoContainer;
019: import org.w3c.dom.Document;
020: import org.w3c.dom.Element;
021: import javax.xml.namespace.QName;
022: import org.geotools.styling.Extent;
023: import org.geotools.styling.StyleFactory;
024: import org.geotools.xml.*;
025:
026: /**
027: * Binding object for the element http://www.opengis.net/sld:Extent.
028: *
029: * <p>
030: * <pre>
031: * <code>
032: * <xsd:element name="Extent">
033: * <xsd:annotation>
034: * <xsd:documentation> An Extent gives
035: * feature/coverage/raster/matrix dimension extent. </xsd:documentation>
036: * </xsd:annotation>
037: * <xsd:complexType>
038: * <xsd:sequence>
039: * <xsd:element ref="sld:Name"/>
040: * <xsd:element ref="sld:Value"/>
041: * </xsd:sequence>
042: * </xsd:complexType>
043: * </xsd:element>
044: *
045: * </code>
046: * </pre>
047: * </p>
048: *
049: * @generated
050: */
051: public class SLDExtentBinding extends AbstractComplexBinding {
052: StyleFactory styleFactory;
053:
054: public SLDExtentBinding(StyleFactory styleFactory) {
055: this .styleFactory = styleFactory;
056: }
057:
058: /**
059: * @generated
060: */
061: public QName getTarget() {
062: return SLD.EXTENT;
063: }
064:
065: /**
066: * <!-- begin-user-doc -->
067: * <!-- end-user-doc -->
068: *
069: * @generated modifiable
070: */
071: public int getExecutionMode() {
072: return AFTER;
073: }
074:
075: /**
076: * <!-- begin-user-doc -->
077: * <!-- end-user-doc -->
078: *
079: * @generated modifiable
080: */
081: public Class getType() {
082: return Extent.class;
083: }
084:
085: /**
086: * <!-- begin-user-doc -->
087: * <!-- end-user-doc -->
088: *
089: * @generated modifiable
090: */
091: public void initialize(ElementInstance instance, Node node,
092: MutablePicoContainer context) {
093: }
094:
095: /**
096: * <!-- begin-user-doc -->
097: * <!-- end-user-doc -->
098: *
099: * @generated modifiable
100: */
101: public Object parse(ElementInstance instance, Node node,
102: Object value) throws Exception {
103: String name = (String) node.getChildValue("Name");
104: String valu = (String) node.getChildValue("Value");
105:
106: return styleFactory.createExtent(name, valu);
107: }
108: }
|