001: /*
002: * GeoTools - OpenSource mapping toolkit
003: * http://geotools.org
004: * (C) 2002-2006, GeoTools Project Managment Committee (PMC)
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation;
009: * version 2.1 of the License.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: */
016: package org.geotools.xs.bindings;
017:
018: import java.math.BigDecimal;
019:
020: import javax.xml.namespace.QName;
021:
022: import org.geotools.xml.InstanceComponent;
023: import org.geotools.xml.SimpleBinding;
024:
025: /**
026: * Binding object for the type http://www.w3.org/2001/XMLSchema:unsignedLong.
027: *
028: * <p>
029: * <pre>
030: * <code>
031: * <xs:simpleType name="unsignedLong" id="unsignedLong">
032: * <xs:annotation>
033: * <xs:appinfo>
034: * <hfp:hasProperty name="bounded" value="true"/>
035: * <hfp:hasProperty name="cardinality" value="finite"/>
036: * </xs:appinfo>
037: * <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#unsignedLong"/>
038: * </xs:annotation>
039: * <xs:restriction base="xs:nonNegativeInteger">
040: * <xs:maxInclusive value="18446744073709551615" id="unsignedLong.maxInclusive"/>
041: * </xs:restriction>
042: * </xs:simpleType>
043: *
044: * </code>
045: * </pre>
046: * </p>
047: *
048: * @generated
049: */
050: public class XSUnsignedLongBinding implements SimpleBinding {
051: /**
052: * @generated
053: */
054: public QName getTarget() {
055: return XS.UNSIGNEDLONG;
056: }
057:
058: /**
059: * <!-- begin-user-doc -->
060: * <!-- end-user-doc -->
061: *
062: * @generated modifiable
063: */
064: public int getExecutionMode() {
065: return AFTER;
066: }
067:
068: /**
069: * <!-- begin-user-doc -->
070: * This binding returns objects of type {@link BigDecimal}.
071: * <!-- end-user-doc -->
072: *
073: * @generated modifiable
074: */
075: public Class getType() {
076: return BigDecimal.class;
077: }
078:
079: /**
080: * <!-- begin-user-doc -->
081: * This binding returns objects of type {@link BigDecimal}.
082: * <!-- end-user-doc -->
083: *
084: * @generated modifiable
085: */
086: public Object parse(InstanceComponent instance, Object value)
087: throws Exception {
088: return new BigDecimal((String) value);
089: }
090:
091: /**
092: * <!-- begin-user-doc -->
093: * <!-- end-user-doc -->
094: *
095: * @generated modifiable
096: */
097: public String encode(Object object, String value) {
098: BigDecimal decimal = (BigDecimal) object;
099:
100: return decimal.toString();
101: }
102: }
|