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