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