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