W3C XML Schema Datatypes implementation.
See: Description
Interface Summary | |
---|---|
Comparator | Comparable datatype. |
XSDatatype | Publicly accesible interface of W3C XML Schema datatype (simple type). |
Class Summary | |
---|---|
AnyURIType | "anyURI" type. |
Base64BinaryType | "base64Binary" type. type of the value object is BinaryValueType. |
BooleanType |
"boolean" type.
type of the value object is java.lang.Boolean .
|
BuiltinAtomicType | base class for atomic built-in types; those types which can be used by itself (int,uriReference,string, etc) . |
ByteType |
"byte" type.
type of the value object is java.lang.Byte .
|
ConcreteType | base class for types that union/list/atomic. |
DatatypeFactory | Datatype object factory. |
DataTypeWithFacet | Base implementation of facet-restricted datatype |
DateTimeType | "dateTime" type. type of the value object is IDateTimeValueType. |
DateType | "date" type. type of the value object is IDateTimeValueType. |
DoubleType |
"double" type.
type of the value object is java.lang.Double .
|
DurationType | "duration" type. type of the value object is ITimeDurationValueType. |
EntityType |
"ENTITY" type.
type of the value object is java.lang.String .
|
EnumerationFacet | "enumeration" facets validator. |
ErrorType | A dummy datatype that can be used to recover from errors. |
FinalComponent | "final" component. |
FloatType |
"float" type.
type of the value object is java.lang.Float .
|
FractionDigitsFacet | 'fractionDigits' facet. this class holds these facet information and performs validation. |
GDayType | "gDay" type. type of the value object is IDateTimeValueType. |
GMonthDayType | "gMonthDay" type. type of the value object is IDateTimeValueType. |
GMonthType | "gMonth" type. type of the value object is IDateTimeValueType. |
GYearMonthType | "gYearMonth" type. type of the value object is IDateTimeValueType. |
GYearType | "gYear" type. type of the value object is IDateTimeValueType. |
HexBinaryType | "hexBinary" type. type of the value object is BinaryValueType. |
IDREFType | very limited 'IDREF' type of XML Schema Part 2. |
IDType | very limited 'ID' type of XML Schema Part 2. |
IntegerType | "integer" type. type of the value object is IntegerValueType. |
IntegerValueType | Value object of "integer" type. |
IntType |
"int" type.
type of the value object is java.lang.Integer .
|
LanguageType |
"language" type.
type of the value object is java.lang.String .
|
LengthFacet | "length", "minLength", and "maxLength" facet validator. this class also detects inconsistent facet setting (for example, minLength=100 and maxLength=0) |
ListType | List type. type of the value object is ListValueType. |
ListValueType | value object of ListType. |
LongType |
"long" type.
type of the value object is java.lang.Long .
|
MaxExclusiveFacet | 'maxExclusive' facet |
MaxInclusiveFacet | 'maxInclusive' facet |
MaxLengthFacet | 'maxLength' facet |
MinExclusiveFacet | 'minExclusive' facet |
MinInclusiveFacet | 'minInclusive' facet |
MinLengthFacet | 'minLength' facet |
NameType |
"Name" type.
type of the value object is java.lang.String .
|
NcnameType |
"NCName" type.
type of the value object is java.lang.String .
|
NegativeIntegerType | "negativeInteger" type. type of the value object is IntegerValueType. |
NmtokenType |
"NMTOKEN" type.
type of the value object is java.lang.String .
|
NonNegativeIntegerType | "nonNegativeInteger" type. type of the value object is IntegerValueType. |
NonPositiveIntegerType | "nonPositiveInteger" type. type of the value object is IntegerValueType. |
NormalizedStringType |
"normalizedString" type.
type of the value object is java.lang.String .
|
NumberType |
"decimal" type.
type of the value object is java.math.BigDecimal .
|
PatternFacet | "pattern" facet validator "pattern" is a constraint facet which is applied against lexical space. |
PositiveIntegerType | "positiveInteger" type. type of the value object is IntegerValueType. |
Proxy | Delegates all methods to the base type. |
QnameType | "QName" type. type of the value object is QnameValueType. |
QnameValueType | value object of QName. |
RangeFacet | Base class of "(max|min)(In|Ex)clusive" facet validator |
ShortType |
"short" type.
type of the value object is java.lang.Short .
|
SimpleURType |
simple "ur-type" type.
type of the value object is java.lang.String .
|
StringType |
"string" type.
type of the value object is java.lang.String .
|
TimeType | "time" type. type of the value object is IDateTimeValueType. |
TokenType |
"token" type.
type of the value object is java.lang.String .
|
TotalDigitsFacet | 'totalDigits' facet. this class holds these facet information and performs validation. |
TypeIncubator | derives a new type by adding facets. |
UnicodeUtil | Unicode-related utility functions. |
UnionType | union type. |
UnsignedByteType |
"unsignedByte" type.
type of the value object is java.lang.Short .
|
UnsignedIntType |
"unsignedInt" type.
type of the value object is java.lang.Long .
|
UnsignedLongType | "unsignedLong" type. type of the value object is IntegerValueType. |
UnsignedShortType |
"unsignedShort" type.
type of the value object is java.lang.Integer .
|
WhiteSpaceFacet | whiteSpace facet validator |
WhiteSpaceProcessor | processes white space normalization |
XmlNames | This class contains static methods used to determine whether identifiers may appear in certain roles in XML documents. |
XSDatatypeImpl | base implementaion for XSDatatype interface. |
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").