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 java.util.List;
022: import javax.xml.namespace.QName;
023: import org.geotools.styling.FeatureTypeConstraint;
024: import org.geotools.styling.LayerFeatureConstraints;
025: import org.geotools.styling.StyleFactory;
026: import org.geotools.xml.*;
027:
028: /**
029: * Binding object for the element http://www.opengis.net/sld:LayerFeatureConstraints.
030: *
031: * <p>
032: * <pre>
033: * <code>
034: * <xsd:element name="LayerFeatureConstraints">
035: * <xsd:annotation>
036: * <xsd:documentation> LayerFeatureConstraints define what
037: * features & feature types are referenced in a
038: * layer. </xsd:documentation>
039: * </xsd:annotation>
040: * <xsd:complexType>
041: * <xsd:sequence>
042: * <xsd:element ref="sld:FeatureTypeConstraint" maxOccurs="unbounded"/>
043: * </xsd:sequence>
044: * </xsd:complexType>
045: * </xsd:element>
046: *
047: * </code>
048: * </pre>
049: * </p>
050: *
051: * @generated
052: */
053: public class SLDLayerFeatureConstraintsBinding extends
054: AbstractComplexBinding {
055: StyleFactory styleFactory;
056:
057: public SLDLayerFeatureConstraintsBinding(StyleFactory styleFactory) {
058: this .styleFactory = styleFactory;
059: }
060:
061: /**
062: * @generated
063: */
064: public QName getTarget() {
065: return SLD.LAYERFEATURECONSTRAINTS;
066: }
067:
068: /**
069: * <!-- begin-user-doc -->
070: * <!-- end-user-doc -->
071: *
072: * @generated modifiable
073: */
074: public int getExecutionMode() {
075: return AFTER;
076: }
077:
078: /**
079: * <!-- begin-user-doc -->
080: * <!-- end-user-doc -->
081: *
082: * @generated modifiable
083: */
084: public Class getType() {
085: return LayerFeatureConstraints.class;
086: }
087:
088: /**
089: * <!-- begin-user-doc -->
090: * <!-- end-user-doc -->
091: *
092: * @generated modifiable
093: */
094: public void initialize(ElementInstance instance, Node node,
095: MutablePicoContainer context) {
096: }
097:
098: /**
099: * <!-- begin-user-doc -->
100: * <!-- end-user-doc -->
101: *
102: * @generated modifiable
103: */
104: public Object parse(ElementInstance instance, Node node,
105: Object value) throws Exception {
106: List ftc = node.getChildValues("FeatureTypeConstraint");
107:
108: return styleFactory
109: .createLayerFeatureConstraints((FeatureTypeConstraint[]) ftc
110: .toArray(new FeatureTypeConstraint[ftc.size()]));
111: }
112: }
|