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 java.util.List;
19: import javax.xml.namespace.QName;
20: import com.vividsolutions.jts.geom.Point;
21: import org.geotools.xml.*;
22:
23: /**
24: * Binding object for the type http://www.opengis.net/gml:PointArrayPropertyType.
25: *
26: * <p>
27: * <pre>
28: * <code>
29: * <complexType name="PointArrayPropertyType">
30: * <annotation>
31: * <documentation>A container for an array of points. The elements are always contained in the array property, referencing geometry
32: * elements or arrays of geometry elements is not supported.</documentation>
33: * </annotation>
34: * <sequence>
35: * <element maxOccurs="unbounded" minOccurs="0" ref="gml:Point"/>
36: * </sequence>
37: * </complexType>
38: *
39: * </code>
40: * </pre>
41: * </p>
42: *
43: * @generated
44: */
45: public class PointArrayPropertyTypeBinding extends
46: AbstractComplexBinding {
47: /**
48: * @generated
49: */
50: public QName getTarget() {
51: return GML.PointArrayPropertyType;
52: }
53:
54: /**
55: * <!-- begin-user-doc -->
56: * <!-- end-user-doc -->
57: *
58: * @generated modifiable
59: */
60: public Class getType() {
61: return Point[].class;
62: }
63:
64: /**
65: * <!-- begin-user-doc -->
66: * <!-- end-user-doc -->
67: *
68: * @generated modifiable
69: */
70: public Object parse(ElementInstance instance, Node node,
71: Object value) throws Exception {
72: List points = node.getChildValues(Point.class);
73:
74: return (Point[]) points.toArray(new Point[points.size()]);
75: }
76: }
|