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.OverlapBehavior;
023: import org.geotools.xml.*;
024:
025: /**
026: * Binding object for the element http://www.opengis.net/sld:OverlapBehavior.
027: *
028: * <p>
029: * <pre>
030: * <code>
031: * <xsd:element name="OverlapBehavior">
032: * <xsd:annotation>
033: * <xsd:documentation> "OverlapBehavior" tells a
034: * system how to behave when multiple raster images in
035: * a layer overlap each other, for example with
036: * satellite-image scenes. </xsd:documentation>
037: * </xsd:annotation>
038: * <xsd:complexType>
039: * <xsd:choice>
040: * <xsd:element ref="sld:LATEST_ON_TOP"/>
041: * <xsd:element ref="sld:EARLIEST_ON_TOP"/>
042: * <xsd:element ref="sld:AVERAGE"/>
043: * <xsd:element ref="sld:RANDOM"/>
044: * </xsd:choice>
045: * </xsd:complexType>
046: * </xsd:element>
047: *
048: * </code>
049: * </pre>
050: * </p>
051: *
052: * @generated
053: */
054: public class SLDOverlapBehaviorBinding extends AbstractComplexBinding {
055: /**
056: * @generated
057: */
058: public QName getTarget() {
059: return SLD.OVERLAPBEHAVIOR;
060: }
061:
062: /**
063: * <!-- begin-user-doc -->
064: * <!-- end-user-doc -->
065: *
066: * @generated modifiable
067: */
068: public int getExecutionMode() {
069: return AFTER;
070: }
071:
072: /**
073: * <!-- begin-user-doc -->
074: * <!-- end-user-doc -->
075: *
076: * @generated modifiable
077: */
078: public Class getType() {
079: return OverlapBehavior.class;
080: }
081:
082: /**
083: * <!-- begin-user-doc -->
084: * <!-- end-user-doc -->
085: *
086: * @generated modifiable
087: */
088: public void initialize(ElementInstance instance, Node node,
089: MutablePicoContainer context) {
090: }
091:
092: /**
093: * <!-- begin-user-doc -->
094: * <!-- end-user-doc -->
095: *
096: * @generated modifiable
097: */
098: public Object parse(ElementInstance instance, Node node,
099: Object value) throws Exception {
100: //<xsd:element ref="sld:LATEST_ON_TOP"/>
101: if (node.hasChild("LATEST_ON_TOP")) {
102: return OverlapBehavior.LATEST_ON_TOP;
103: }
104:
105: //<xsd:element ref="sld:EARLIEST_ON_TOP"/>
106: if (node.hasChild("EARLIEST_ON_TOP")) {
107: return OverlapBehavior.EARLIEST_ON_TOP;
108: }
109:
110: //<xsd:element ref="sld:AVERAGE"/>
111: if (node.hasChild("AVERAGE")) {
112: return OverlapBehavior.AVERAGE;
113: }
114:
115: //<xsd:element ref="sld:RANDOM"/>
116: if (node.hasChild("RANDOM")) {
117: return OverlapBehavior.RANDOM;
118: }
119:
120: return null;
121: }
122: }
|