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 javax.xml.namespace.QName;
19: import com.vividsolutions.jts.geom.Geometry;
20: import org.geotools.xml.*;
21:
22: /**
23: * Binding object for the type http://www.opengis.net/gml:GeometryPropertyType.
24: *
25: * <p>
26: * <pre>
27: * <code>
28: * <complexType name="GeometryPropertyType">
29: * <annotation>
30: * <documentation>A geometric property can either be any geometry element encapsulated in an element of this type or an XLink reference
31: * to a remote geometry element (where remote includes geometry elements located elsewhere in the same document). Note that either
32: * the reference or the contained element must be given, but not both or none.</documentation>
33: * </annotation>
34: * <sequence minOccurs="0">
35: * <element ref="gml:_Geometry"/>
36: * </sequence>
37: * <attributeGroup ref="gml:AssociationAttributeGroup">
38: * <annotation>
39: * <documentation>This attribute group includes the XLink attributes (see xlinks.xsd). XLink is used in GML to reference
40: * remote resources (including those elsewhere in the same document). A simple link element can be constructed by
41: * including a specific set of XLink attributes. The XML Linking Language (XLink) is currently a Proposed Recommendation
42: * of the World Wide Web Consortium. XLink allows elements to be inserted into XML documents so as to create
43: * sophisticated links between resources; such links can be used to reference remote properties. A simple link element
44: * can be used to implement pointer functionality, and this functionality has been built into various GML 3 elements by
45: * including the gml:AssociationAttributeGroup.</documentation>
46: * </annotation>
47: * </attributeGroup>
48: * </complexType>
49: *
50: * </code>
51: * </pre>
52: * </p>
53: *
54: * @generated
55: */
56: public class GeometryPropertyTypeBinding extends AbstractComplexBinding {
57: /**
58: * @generated
59: */
60: public QName getTarget() {
61: return GML.GeometryPropertyType;
62: }
63:
64: /**
65: * <!-- begin-user-doc -->
66: * <!-- end-user-doc -->
67: *
68: * @generated modifiable
69: */
70: public Class getType() {
71: return Geometry.class;
72: }
73:
74: /**
75: * <!-- begin-user-doc -->
76: * <!-- end-user-doc -->
77: *
78: * @generated modifiable
79: */
80: public Object parse(ElementInstance instance, Node node,
81: Object value) throws Exception {
82: return node.getChildValue(Geometry.class);
83: }
84:
85: public Object getProperty(Object object, QName name)
86: throws Exception {
87: if (GML._Geometry.equals(name)) {
88: return object;
89: }
90:
91: return null;
92: }
93: }
|