01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2002-2006, GeoTools Project Managment Committee (PMC)
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation;
09: * version 2.1 of the License.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: */
16: package org.geotools.gml3.bindings;
17:
18: import org.eclipse.xsd.XSDElementDeclaration;
19: import org.w3c.dom.Document;
20: import org.w3c.dom.Element;
21: import javax.xml.namespace.QName;
22: import com.vividsolutions.jts.geom.LineString;
23: import org.geotools.xml.*;
24:
25: /**
26: * Binding object for the type http://www.opengis.net/gml:LineStringPropertyType.
27: *
28: * <p>
29: * <pre>
30: * <code>
31: * <complexType name="LineStringPropertyType">
32: * <annotation>
33: * <documentation>This type is deprecated with GML 3 and shall not be used. It is included for backwards compatibility with GML 2. Use
34: * CurvePropertyType instead. A property that has a line string as its value domain can either be an appropriate geometry element encapsulated
35: * in an element of this type or an XLink reference to a remote geometry element (where remote includes geometry elements located elsewhere
36: * in the same document). Either the reference or the contained element must be given, but neither both nor none.</documentation>
37: * </annotation>
38: * <sequence minOccurs="0">
39: * <element ref="gml:LineString"/>
40: * </sequence>
41: * <attributeGroup ref="gml:AssociationAttributeGroup">
42: * <annotation>
43: * <documentation>This attribute group includes the XLink attributes (see xlinks.xsd). XLink is used in GML to reference remote resources
44: * (including those elsewhere in the same document). A simple link element can be constructed by including a specific set of XLink attributes.
45: * The XML Linking Language (XLink) is currently a Proposed Recommendation of the World Wide Web Consortium. XLink allows elements to
46: * be inserted into XML documents so as to create sophisticated links between resources; such links can be used to reference remote properties.
47: * A simple link element can be used to implement pointer functionality, and this functionality has been built into various GML 3 elements by
48: * including the gml:AssociationAttributeGroup.</documentation>
49: * </annotation>
50: * </attributeGroup>
51: * </complexType>
52: *
53: * </code>
54: * </pre>
55: * </p>
56: *
57: * @generated
58: */
59: public class LineStringPropertyTypeBinding extends
60: AbstractComplexBinding {
61: /**
62: * @generated
63: */
64: public QName getTarget() {
65: return GML.LineStringPropertyType;
66: }
67:
68: /**
69: * <!-- begin-user-doc -->
70: * <!-- end-user-doc -->
71: *
72: * @generated modifiable
73: */
74: public Class getType() {
75: return LineString.class;
76: }
77:
78: /**
79: * <!-- begin-user-doc -->
80: * <!-- end-user-doc -->
81: *
82: * @generated modifiable
83: */
84: public Object parse(ElementInstance instance, Node node,
85: Object value) throws Exception {
86: return node.getChildValue(LineString.class);
87: }
88:
89: public Object getProperty(Object object, QName name) {
90: if (GML.LineString.equals(name)) {
91: //return the line string, which is the object passed in
92: return object;
93: }
94:
95: return null;
96: }
97: }
|