Representation of an XSD datatype based on the Xerces-2
XSD implementation.
author: Dave Reynolds version: $Revision: 1.15 $ on $Date: 2008/01/02 12:10:49 $
XSDDatatype(XSSimpleType xstype, String namespace) Constructor used when loading in external user defined XSD types -
should only be used by the internals but public scope because
the internals spread across multiple packages.
convertValidatedDataValue(ValidatedInfo validatedInfo) Convert a validated xerces data value into the corresponding java data value.
This function is currently the most blatently xerces-version dependent part
of this subsystem.
getJavaClass() If this datatype is used as the cannonical representation
for a particular java datatype then return that java type,
otherwise returns null.
Constructor.
Parameters: typeName - the name of the XSD type to be instantiated, this is used to lookup a type definition from the Xerces schema factory.
Constructor.
Parameters: typeName - the name of the XSD type to be instantiated, this is used to lookup a type definition from the Xerces schema factory. Parameters: javaClass - the java class for which this xsd type is to betreated as the cannonical representation
XSDDatatype
public XSDDatatype(XSSimpleType xstype, String namespace)(Code)
Constructor used when loading in external user defined XSD types -
should only be used by the internals but public scope because
the internals spread across multiple packages.
Parameters: xstype - the XSSimpleType definition to be wrapped Parameters: namespace - the namespace for the type (used because the grammar loading doesn't seem to keep that)
Convert a validated xerces data value into the corresponding java data value.
This function is currently the most blatently xerces-version dependent part
of this subsystem. In many cases it also involves reparsing data which has
already been parsed as part of the validation.
Parameters: validatedInfo - a fully populated Xerces data validation context the appropriate java wrapper type
Test if the given typed value is in the right partition of the XSD type space.
If this test passes then if the typed value has a legal lexical form for
this type then it is a legal instance.
Compares two instances of values of the given datatype.
This ignores lang tags and defers to the equality function
defined by the Xerces package - to be checked.
Test whether the given LiteralLabel is a valid instance
of this datatype. This takes into accound typing information
as well as lexical form - for example an xsd:string is
never considered valid as an xsd:integer (even if it is
lexically legal like "1").
Create and register a set of types specified in a user schema file.
We use the (illegal) DAML+OIL approach that the uriref of the type
is the url of the schema file with fragment ID corresponding the
the name of the type.
Parameters: uri - the absolute uri of the schema file to be loaded Parameters: reader - the Reader stream onto the file (useful if you wish to load a cached copy of the schema file) Parameters: encoding - the encoding of the source file (can be null) Parameters: tm - the type mapper into which to load the definitions a List of strings giving the uri's of the newly defined datatypes throws: DatatypeFormatException - if there is a problem during load (not that we use Xerces in default mode for load which may provide diagnostic output direct to stderr)
Create and register a set of types specified in a user schema file.
We use the (illegal) DAML+OIL approach that the uriref of the type
is the url of the schema file with fragment ID corresponding the
the name of the type.
Parameters: uri - the absolute uri of the schema file to be loaded, this should be a resolvable URL Parameters: encoding - the encoding of the source file (can be null) Parameters: tm - the type mapper into which to load the definitions a List of strings giving the uri's of the newly defined datatypes throws: DatatypeFormatException - if there is a problem during load (not that we use Xerces in default mode for load which may provide diagnostic output direct to stderr)
Parse a validated lexical form. Subclasses which use the default
parse implementation and are not convered by the explicit convertValidatedData
cases should override this.