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.ContrastEnhancement;
023: import org.geotools.styling.SelectedChannelType;
024: import org.geotools.styling.StyleFactory;
025: import org.geotools.xml.*;
026:
027: /**
028: * Binding object for the type http://www.opengis.net/sld:SelectedChannelType.
029: *
030: * <p>
031: * <pre>
032: * <code>
033: * <xsd:complexType name="SelectedChannelType">
034: * <xsd:sequence>
035: * <xsd:element ref="sld:SourceChannelName"/>
036: * <xsd:element ref="sld:ContrastEnhancement" minOccurs="0"/>
037: * </xsd:sequence>
038: * </xsd:complexType>
039: *
040: * </code>
041: * </pre>
042: * </p>
043: *
044: * @generated
045: */
046: public class SLDSelectedChannelTypeBinding extends
047: AbstractComplexBinding {
048: StyleFactory styleFactory;
049:
050: public SLDSelectedChannelTypeBinding(StyleFactory styleFactory) {
051: this .styleFactory = styleFactory;
052: }
053:
054: /**
055: * @generated
056: */
057: public QName getTarget() {
058: return SLD.SELECTEDCHANNELTYPE;
059: }
060:
061: /**
062: * <!-- begin-user-doc -->
063: * <!-- end-user-doc -->
064: *
065: * @generated modifiable
066: */
067: public int getExecutionMode() {
068: return AFTER;
069: }
070:
071: /**
072: * <!-- begin-user-doc -->
073: * <!-- end-user-doc -->
074: *
075: * @generated modifiable
076: */
077: public Class getType() {
078: return SelectedChannelType.class;
079: }
080:
081: /**
082: * <!-- begin-user-doc -->
083: * <!-- end-user-doc -->
084: *
085: * @generated modifiable
086: */
087: public void initialize(ElementInstance instance, Node node,
088: MutablePicoContainer context) {
089: }
090:
091: /**
092: * <!-- begin-user-doc -->
093: * <!-- end-user-doc -->
094: *
095: * @generated modifiable
096: */
097: public Object parse(ElementInstance instance, Node node,
098: Object value) throws Exception {
099: return styleFactory.createSelectedChannelType((String) node
100: .getChildValue("SourceChannelName"),
101: (ContrastEnhancement) node
102: .getChildValue("ContrastEnhancement"));
103: }
104: }
|