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 javax.xml.namespace.QName;
019:
020: import org.geotools.xml.InstanceComponent;
021: import org.geotools.xml.SimpleBinding;
022:
023: /**
024: * Binding object for the type http://www.w3.org/2001/XMLSchema:string.
025: *
026: * <p>
027: * <pre>
028: * <code>
029: * <xs:simpleType name="string" id="string">
030: * <xs:annotation>
031: * <xs:appinfo>
032: * <hfp:hasFacet name="length"/>
033: * <hfp:hasFacet name="minLength"/>
034: * <hfp:hasFacet name="maxLength"/>
035: * <hfp:hasFacet name="pattern"/>
036: * <hfp:hasFacet name="enumeration"/>
037: * <hfp:hasFacet name="whiteSpace"/>
038: * <hfp:hasProperty name="ordered" value="false"/>
039: * <hfp:hasProperty name="bounded" value="false"/>
040: * <hfp:hasProperty name="cardinality" value="countably infinite"/>
041: * <hfp:hasProperty name="numeric" value="false"/>
042: * </xs:appinfo>
043: * <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#string"/>
044: * </xs:annotation>
045: * <xs:restriction base="xs:anySimpleType">
046: * <xs:whiteSpace value="preserve" id="string.preserve"/>
047: * </xs:restriction>
048: * </xs:simpleType>
049: *
050: * </code>
051: * </pre>
052: * </p>
053: *
054: * @generated
055: */
056: public class XSStringBinding implements SimpleBinding {
057: /**
058: * @generated
059: */
060: public QName getTarget() {
061: return XS.STRING;
062: }
063:
064: /**
065: * <!-- begin-user-doc -->
066: * <!-- end-user-doc -->
067: *
068: * @generated modifiable
069: */
070: public int getExecutionMode() {
071: return OVERRIDE;
072: }
073:
074: /**
075: * <!-- begin-user-doc -->
076: * This binding returns objects of type {@link String}.
077: * <!-- end-user-doc -->
078: *
079: * @generated modifiable
080: */
081: public Class getType() {
082: return String.class;
083: }
084:
085: /**
086: * <!-- begin-user-doc -->
087: * The string datatype represents character strings in XML.
088: * <!-- end-user-doc -->
089: *
090: * @generated modifiable
091: */
092: public Object parse(InstanceComponent instance, Object value)
093: throws Exception {
094: return value;
095: }
096:
097: /**
098: * <!-- begin-user-doc -->
099: * <!-- end-user-doc -->
100: *
101: * @generated modifiable
102: */
103: public String encode(Object object, String value) {
104: return (String) object;
105: }
106: }
|