01: /* Copyright (c) 2001 - 2007 TOPP - www.openplans.org. All rights reserved.
02: * This code is licensed under the GPL 2.0 license, availible at the root
03: * application directory.
04: */
05: package org.geoserver.wfs.xml.v1_1_0;
06:
07: import net.opengis.wfs.NativeType;
08: import net.opengis.wfs.WfsFactory;
09: import org.geotools.xml.AbstractComplexBinding;
10: import org.geotools.xml.ElementInstance;
11: import org.geotools.xml.Node;
12: import javax.xml.namespace.QName;
13:
14: /**
15: * Binding object for the type http://www.opengis.net/wfs:NativeType.
16: *
17: * <p>
18: * <pre>
19: * <code>
20: * <xsd:complexType name="NativeType">
21: * <xsd:attribute name="vendorId" type="xsd:string" use="required">
22: * <xsd:annotation>
23: * <xsd:documentation>
24: * The vendorId attribute is used to specify the name of
25: * vendor who's vendor specific command the client
26: * application wishes to execute.
27: * </xsd:documentation>
28: * </xsd:annotation>
29: * </xsd:attribute>
30: * <xsd:attribute name="safeToIgnore" type="xsd:boolean" use="required">
31: * <xsd:annotation>
32: * <xsd:documentation>
33: * In the event that a Web Feature Service does not recognize
34: * the vendorId or does not recognize the vendor specific command,
35: * the safeToIgnore attribute is used to indicate whether the
36: * exception can be safely ignored. A value of TRUE means that
37: * the Web Feature Service may ignore the command. A value of
38: * FALSE means that a Web Feature Service cannot ignore the
39: * command and an exception should be raised if a problem is
40: * encountered.
41: * </xsd:documentation>
42: * </xsd:annotation>
43: * </xsd:attribute>
44: * </xsd:complexType>
45: *
46: * </code>
47: * </pre>
48: * </p>
49: *
50: * @generated
51: */
52: public class NativeTypeBinding extends AbstractComplexBinding {
53: WfsFactory wfsfactory;
54:
55: public NativeTypeBinding(WfsFactory wfsfactory) {
56: this .wfsfactory = wfsfactory;
57: }
58:
59: /**
60: * @generated
61: */
62: public QName getTarget() {
63: return WFS.NATIVETYPE;
64: }
65:
66: /**
67: * <!-- begin-user-doc -->
68: * <!-- end-user-doc -->
69: *
70: * @generated modifiable
71: */
72: public Class getType() {
73: return NativeType.class;
74: }
75:
76: /**
77: * <!-- begin-user-doc -->
78: * <!-- end-user-doc -->
79: *
80: * @generated modifiable
81: */
82: public Object parse(ElementInstance instance, Node node,
83: Object value) throws Exception {
84: NativeType nativ = wfsfactory.createNativeType();
85:
86: //<xsd:attribute name="vendorId" type="xsd:string" use="required">
87: nativ.setVendorId((String) node.getAttributeValue("vendorId"));
88:
89: //<xsd:attribute name="safeToIgnore" type="xsd:boolean" use="required">
90: nativ.setSafeToIgnore(((Boolean) node
91: .getAttributeValue("safeToIgnore")).booleanValue());
92:
93: return nativ;
94: }
95: }
|