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.xs.bindings;
17:
18: import javax.xml.namespace.QName;
19:
20: import org.geotools.xml.AbstractSimpleBinding;
21: import org.geotools.xml.InstanceComponent;
22: import org.geotools.xml.SimpleBinding;
23:
24: /**
25: * Binding object for the type http://www.w3.org/2001/XMLSchema:Name.
26: *
27: * <p>
28: * <pre>
29: * <code>
30: * <xs:simpleType name="Name" id="Name">
31: * <xs:annotation>
32: * <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#Name"/>
33: * </xs:annotation>
34: * <xs:restriction base="xs:token">
35: * <xs:pattern value="\i\c*" id="Name.pattern">
36: * <xs:annotation>
37: * <xs:documentation
38: * source="http://www.w3.org/TR/REC-xml#NT-Name">
39: * pattern matches production 5 from the XML spec </xs:documentation>
40: * </xs:annotation>
41: * </xs:pattern>
42: * </xs:restriction>
43: * </xs:simpleType>
44: *
45: * </code>
46: * </pre>
47: * </p>
48: *
49: * @generated
50: */
51: public class XSNameBinding extends AbstractSimpleBinding {
52: /**
53: * @generated
54: */
55: public QName getTarget() {
56: return XS.NAME;
57: }
58:
59: /**
60: * <!-- begin-user-doc -->
61: * <!-- end-user-doc -->
62: *
63: * @generated modifiable
64: */
65: public int getExecutionMode() {
66: return AFTER;
67: }
68:
69: /**
70: * <!-- begin-user-doc -->
71: * This binding simply delegates to its parent binding which returns an
72: * object of type {@link String}.
73: * <!-- end-user-doc -->
74: *
75: * @generated modifiable
76: */
77: public Class getType() {
78: return String.class;
79: }
80:
81: /**
82: * <!-- begin-user-doc -->
83: * This binding simply delegates to its parent binding which returns an
84: * object of type {@link String}.
85: * <!-- end-user-doc -->
86: *
87: * @generated modifiable
88: */
89: public Object parse(InstanceComponent instance, Object value)
90: throws Exception {
91: //TODO need to implement a pattern facet. Simply return string value for now
92: return value;
93: }
94:
95: }
|