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:NCName.
26: *
27: * <p>
28: * <pre>
29: * <code>
30: * <xs:simpleType name="NCName" id="NCName">
31: * <xs:annotation>
32: * <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#NCName"/>
33: * </xs:annotation>
34: * <xs:restriction base="xs:Name">
35: * <xs:pattern value="[\i-[:]][\c-[:]]*" id="NCName.pattern">
36: * <xs:annotation>
37: * <xs:documentation
38: * source="http://www.w3.org/TR/REC-xml-names/#NT-NCName">
39: * pattern matches production 4 from the Namespaces in
40: * XML spec </xs:documentation>
41: * </xs:annotation>
42: * </xs:pattern>
43: * </xs:restriction>
44: * </xs:simpleType>
45: *
46: * </code>
47: * </pre>
48: * </p>
49: *
50: * @generated
51: */
52: public class XSNCNameBinding extends AbstractSimpleBinding {
53: /**
54: * @generated
55: */
56: public QName getTarget() {
57: return XS.NCNAME;
58: }
59:
60: /**
61: * <!-- begin-user-doc -->
62: * <!-- end-user-doc -->
63: *
64: * @generated modifiable
65: */
66: public int getExecutionMode() {
67: return AFTER;
68: }
69:
70: /**
71: * <!-- begin-user-doc -->
72: * <!-- end-user-doc -->
73: *
74: * @generated modifiable
75: */
76: public Class getType() {
77: return String.class;
78: }
79:
80: /**
81: * <!-- begin-user-doc -->
82: * <!-- end-user-doc -->
83: *
84: * @generated modifiable
85: */
86: public Object parse(InstanceComponent instance, Object value)
87: throws Exception {
88: //TODO need to implement a pattern facet. Simply return string value for now
89: return value;
90: }
91: }
|