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.InstanceComponent;
21: import org.geotools.xml.SimpleBinding;
22:
23: /**
24: * Binding object for the type http://www.w3.org/2001/XMLSchema:unsignedInt.
25: *
26: * <p>
27: * <pre>
28: * <code>
29: * <xs:simpleType name="unsignedInt" id="unsignedInt">
30: * <xs:annotation>
31: * <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#unsignedInt"/>
32: * </xs:annotation>
33: * <xs:restriction base="xs:unsignedLong">
34: * <xs:maxInclusive value="4294967295" id="unsignedInt.maxInclusive"/>
35: * </xs:restriction>
36: * </xs:simpleType>
37: *
38: * </code>
39: * </pre>
40: * </p>
41: *
42: * @generated
43: */
44: public class XSUnsignedIntBinding implements SimpleBinding {
45: /**
46: * @generated
47: */
48: public QName getTarget() {
49: return XS.UNSIGNEDINT;
50: }
51:
52: /**
53: * <!-- begin-user-doc -->
54: * <!-- end-user-doc -->
55: *
56: * @generated modifiable
57: */
58: public int getExecutionMode() {
59: return AFTER;
60: }
61:
62: /**
63: * <!-- begin-user-doc -->
64: * This binding returns objects of type {@link Long}.
65: * <!-- end-user-doc -->
66: *
67: * @generated modifiable
68: */
69: public Class getType() {
70: return Long.class;
71: }
72:
73: /**
74: * <!-- begin-user-doc -->
75: * This binding returns objects of type {@link Long}.
76: * <!-- end-user-doc -->
77: *
78: * @generated modifiable
79: */
80: public Object parse(InstanceComponent instance, Object value)
81: throws Exception {
82: return new Long((String) value);
83: }
84:
85: /**
86: * <!-- begin-user-doc -->
87: * <!-- end-user-doc -->
88: *
89: * @generated modifiable
90: */
91: public String encode(Object object, String value) {
92: Long l = (Long) object;
93:
94: return l.toString();
95: }
96: }
|