This package implements the recommendation version of W3C XML Schema Part 2 datatypes. The latest version of the spec is here.
Application developers should understand the usage of
the following classes:
com.sun.msv.datatype.xsd.DatatypeFactory,
com.sun.msv.datatype.xsd.XSDatatype,
org.relaxng.datatype.Datatype, and
org.relaxng.datatype.ValidationContext.
Other classes are implementations of those types and therefore not important in most cases.
The current release has several limitations. See readme.txt for details.
createJavaObject method
The following W3C XML Schema types return java.lang.String, with no loss of accuracy.
The "language" type also returns java.lang.String, but it always returns a string in all lower-case.
The "anyURI" type returns java.lang.String too. It doesn't perform any escaping. So
"%20" as a value of the "anyURI" type results in "%20", not " ".
For other types:
| XSD type | Java type |
| string | java.lang.String(*5) |
| ENTITY | |
| normalizedString | |
| token | |
| NMTOKEN | |
| Name | |
| NCName | |
| NOTATION | |
| anyURI (*3) | |
| language (*4) | |
| boolean | java.lang.Boolean |
| number | java.math.BigDecimal |
| float | java.lang.Float |
| double | java.lang.Double |
| integer |
a derived class of java.lang.Number |
| negativeInteger | |
| positiveInteger | |
| nonNegativeInteger | |
| nonPositiveInteger | |
| unsignedLong | |
| unsignedInt | |
| unsignedShort | |
| unsignedByte | |
| long | |
| int | |
| short | |
| byte | |
| QName | java.lang.String[2](*1) |
| base64Binary | byte[] |
| hexBinary | |
| dateTime | java.util.Calendar(*2) |
| date | |
| time | |
| gYear | |
| gYearMonth | |
| gMonth | |
| gMonthDay | |
| gDay |
For types derived by list, the createJavaObject method returns java.lang.Object[]
that contains Java values of the item type.
For types derived by restriction, the method returns the same type as the base type.
For types derived by union, the method returns Java values of one of the member types.
The createJavaObject method currently returns meaningless types for "duration" datatype.
MILLISECOND field of the returned Calendar object
is not set. This field is set only when the XML representation contains
fractional seconds (e.g., "01:02:03.5").
| Modifier and Type | Interface and Description |
|---|---|
| public interface | Comparator
Comparable datatype. |
| pack-priv interface | Discrete
base interface of types to which length-related facets are applicable. |
| public interface | XSDatatype
Publicly accesible interface of W3C XML Schema datatype (simple type). |
| Modifier and Type | Class and Description |
|---|---|
| public class | AnyURIType
"anyURI" type. |
| public class | Base64BinaryType
"base64Binary" type. |
| pack-priv abstract class | BinaryBaseType
base implementation for "hexBinary" and "base64Binary" types. |
| pack-priv class | BinaryValueType
value type of "base64Binary" and "hexBinary" type. |
| public class | BooleanType
"boolean" type. |
| public abstract class | BuiltinAtomicType
base class for atomic built-in types; those types which can be used by itself (int,uriReference,string, etc) . |
| public class | ByteType
"byte" type. |
| public class | CommandLineTester
command-line tester of datatype library. |
| public abstract class | ConcreteType
base class for types that union/list/atomic. |
| public class | DatatypeFactory
Datatype object factory. |
| public abstract class | DataTypeWithFacet
Base implementation of facet-restricted datatype |
| pack-priv abstract class | DataTypeWithLexicalConstraintFacet
base class for facets which constrains lexical space of data |
| pack-priv abstract class | DataTypeWithValueConstraintFacet
base class for facets which constrain value space. |
| pack-priv abstract class | DateTimeBaseType
base implementation of dateTime and dateTime-truncated types. |
| public class | DateTimeType
"dateTime" type. |
| public class | DateType
"date" type. |
| public class | DoubleType
"double" type. |
| public class | DurationType
"duration" type. |
| public class | EntityType
"ENTITY" type. |
| public class | EnumerationFacet
"enumeration" facets validator. |
| public class | ErrorType
A dummy datatype that can be used to recover from errors. |
| public class | FinalComponent
"final" component. |
| pack-priv abstract class | FloatingNumberType
base class of FloatType and DoubleType |
| public class | FloatType
"float" type. |
| public class | FractionDigitsFacet
'fractionDigits' facet. |
| public class | GDayType
"gDay" type. |
| public class | GMonthDayType
"gMonthDay" type. |
| public class | GMonthType
"gMonth" type. |
| public class | GYearMonthType
"gYearMonth" type. |
| public class | GYearType
"gYear" type. |
| public class | HexBinaryType
"hexBinary" type. |
| public class | IDREFType
very limited 'IDREF' type of XML Schema Part 2. |
| public class | IDType
very limited 'ID' type of XML Schema Part 2. |
| pack-priv abstract class | IntegerDerivedType
base class for types derived from integer. |
| public class | IntegerType
"integer" type. |
| public class | IntegerValueType
Value object of "integer" type. |
| public class | IntType
"int" type. |
| public class | LanguageType
"language" type. |
| public class | LengthFacet
"length", "minLength", and "maxLength" facet validator. |
| public class | ListType
List type. |
| public class | ListValueType
value object of ListType. |
| public class | LongType
"long" type. |
| public class | MaxExclusiveFacet
'maxExclusive' facet |
| public class | MaxInclusiveFacet
'maxInclusive' facet |
| public class | MaxLengthFacet
'maxLength' facet |
| public class | MinExclusiveFacet
'minExclusive' facet |
| public class | MinInclusiveFacet
'minInclusive' facet |
| public class | MinLengthFacet
'minLength' facet |
| public class | NameType
"Name" type. |
| public class | NcnameType
"NCName" type. |
| public class | NegativeIntegerType
"negativeInteger" type. |
| public class | NmtokenType
"NMTOKEN" type. |
| public class | NonNegativeIntegerType
"nonNegativeInteger" type. |
| public class | NonPositiveIntegerType
"nonPositiveInteger" type. |
| public class | NormalizedStringType
"normalizedString" type. |
| public class | NumberType
"decimal" type. |
| public class | PatternFacet
"pattern" facet validator "pattern" is a constraint facet which is applied against lexical space. |
| public class | PositiveIntegerType
"positiveInteger" type. |
| public class | Proxy
Delegates all methods to the base type. |
| public class | QnameType
"QName" type. |
| public class | QnameValueType
value object of QName. |
| public abstract class | RangeFacet
Base class of "(max|min)(In|Ex)clusive" facet validator |
| public class | ShortType
"short" type. |
| public class | SimpleURType
simple "ur-type" type. |
| public class | StringType
"string" type. |
| public class | TimeType
"time" type. |
| public class | TokenType
"token" type. |
| public class | TotalDigitsFacet
'totalDigits' facet. |
| public class | TypeIncubator
derives a new type by adding facets. |
| public class | UnicodeUtil
Unicode-related utility functions. |
| public class | UnionType
union type. |
| public class | UnsignedByteType
"unsignedByte" type. |
| public class | UnsignedIntType
"unsignedInt" type. |
| public class | UnsignedLongType
"unsignedLong" type. |
| public class | UnsignedShortType
"unsignedShort" type. |
| public class | WhiteSpaceFacet
whiteSpace facet validator |
| public abstract class | WhiteSpaceProcessor
processes white space normalization |
| public class | XmlNames
This class contains static methods used to determine whether identifiers may appear in certain roles in XML documents. |
| public abstract class | XSDatatypeImpl
base implementaion for XSDatatype interface. |