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.filter.v1_1;
17:
18: import javax.xml.namespace.QName;
19: import org.opengis.filter.FilterFactory;
20: import org.opengis.filter.identity.GmlObjectId;
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/ogc:GmlObjectIdType.
27: *
28: * <p>
29: * <pre>
30: * <code>
31: * <xsd:complexType name="GmlObjectIdType">
32: * <xsd:complexContent>
33: * <xsd:extension base="ogc:AbstractIdType">
34: * <xsd:attribute ref="gml:id" use="required"/>
35: * </xsd:extension>
36: * </xsd:complexContent>
37: * </xsd:complexType>
38: *
39: * </code>
40: * </pre>
41: * </p>
42: *
43: * @generated
44: */
45: public class GmlObjectIdTypeBinding extends AbstractComplexBinding {
46: FilterFactory filterfactory;
47:
48: public GmlObjectIdTypeBinding(FilterFactory filterfactory) {
49: this .filterfactory = filterfactory;
50: }
51:
52: /**
53: * @generated
54: */
55: public QName getTarget() {
56: return OGC.GmlObjectIdType;
57: }
58:
59: /**
60: * <!-- begin-user-doc -->
61: * <!-- end-user-doc -->
62: *
63: * @generated modifiable
64: */
65: public Class getType() {
66: return GmlObjectId.class;
67: }
68:
69: /**
70: * <!-- begin-user-doc -->
71: * <!-- end-user-doc -->
72: *
73: * @generated modifiable
74: */
75: public Object parse(ElementInstance instance, Node node,
76: Object value) throws Exception {
77: //<xsd:attribute ref="gml:id" use="required"/>
78: return filterfactory.gmlObjectId((String) node
79: .getAttributeValue("id"));
80: }
81:
82: public Object getProperty(Object object, QName name)
83: throws Exception {
84: if ("id".equals(name.getLocalPart())) {
85: GmlObjectId id = (GmlObjectId) object;
86:
87: return id.getID();
88: }
89:
90: return null;
91: }
92: }
|