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