public abstract class XSDatatypeImpl extends Object implements XSDatatype
This class should be considered as the implementation-detail, and applications should not access this class.
APPLICABLE, DERIVATION_BY_LIST, DERIVATION_BY_RESTRICTION, DERIVATION_BY_UNION, FACET_ENUMERATION, FACET_FRACTIONDIGITS, FACET_LENGTH, FACET_MAXEXCLUSIVE, FACET_MAXINCLUSIVE, FACET_MAXLENGTH, FACET_MINEXCLUSIVE, FACET_MININCLUSIVE, FACET_MINLENGTH, FACET_PATTERN, FACET_TOTALDIGITS, FACET_WHITESPACE, FIXED, NOT_ALLOWED, VARIETY_ATOMIC, VARIETY_LIST, VARIETY_UNION, XMLSCHEMA_NSURI| Modifier | Constructor and Description |
|---|---|
protected |
XSDatatypeImpl(String uri,
String typeName,
WhiteSpaceProcessor whiteSpace) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
_checkValid(String content,
org.relaxng.datatype.ValidationContext context)
actual 'meat' of the checkValid method
|
protected abstract Object |
_createJavaObject(String literal,
org.relaxng.datatype.ValidationContext context) |
protected abstract Object |
_createValue(String content,
org.relaxng.datatype.ValidationContext context)
converts a whitespace-processed lexical value into the corresponding value object
|
protected abstract boolean |
checkFormat(String literal,
org.relaxng.datatype.ValidationContext context) |
void |
checkValid(String content,
org.relaxng.datatype.ValidationContext context) |
Object |
createJavaObject(String literal,
org.relaxng.datatype.ValidationContext context)
converts lexcial value to a corresponding Java-friendly object
by using the given context information.
|
org.relaxng.datatype.DatatypeStreamingValidator |
createStreamingValidator(org.relaxng.datatype.ValidationContext context) |
Object |
createValue(String lexicalValue,
org.relaxng.datatype.ValidationContext context) |
XSDatatype |
getAncestorBuiltinType()
Gets the nearest ancestor built-in type.
|
String[] |
getApplicableFacetNames()
Gets the names of all applicable facets.
|
abstract ConcreteType |
getConcreteType()
gets the concrete type object of the restriction chain.
|
DataTypeWithFacet |
getFacetObject(String facetName)
gets the facet object that restricts the specified facet
|
int |
getIdType()
A property for RELAX NG DTD compatibility datatypes.
|
String |
getName()
gets the local name of the type.
|
String |
getNamespaceUri()
Gets the namespace URI of this simple type definition.
|
boolean |
isAlwaysValid()
Returns true if this datatype is known to accept any string.
|
boolean |
isContextDependent()
A property for RELAX NG DTD compatibility datatypes.
|
boolean |
isDerivedTypeOf(XSDatatype baseType,
boolean restrictionAllowed)
tests if this type is a derived type of the specified type.
|
static boolean |
isDerivedTypeOf(XSDatatype base,
XSDatatype derived,
boolean restrictionAllowed)
an implementation of
"Type Derivation OK (Simple)"
of the spec.
|
boolean |
isValid(String literal,
org.relaxng.datatype.ValidationContext context) |
static String |
localize(String prop) |
static String |
localize(String prop,
Object arg1) |
static String |
localize(String prop,
Object[] args) |
static String |
localize(String prop,
Object arg1,
Object arg2) |
static String |
localize(String prop,
Object arg1,
Object arg2,
Object arg3) |
protected boolean |
needValueCheck() |
boolean |
sameValue(Object o1,
Object o2) |
int |
valueHashCode(Object o) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconvertToLexicalValue, displayName, getBaseType, getVariety, isFacetApplicable, isFinalgetJavaObjectType, serializeJavaObjectpublic final WhiteSpaceProcessor whiteSpace
protected static final org.relaxng.datatype.ValidationContext serializedValueChecker
public static final String ERR_INAPPROPRIATE_FOR_TYPE
public static final String ERR_TOO_MUCH_PRECISION
public static final String ERR_TOO_MUCH_SCALE
public static final String ERR_ENUMERATION
public static final String ERR_ENUMERATION_WITH_ARG
public static final String ERR_OUT_OF_RANGE
public static final String ERR_LENGTH
public static final String ERR_MINLENGTH
public static final String ERR_MAXLENGTH
public static final String ERR_PATTERN_1
public static final String ERR_PATTERN_MANY
public static final String ERR_INVALID_ITEMTYPE
public static final String ERR_INVALID_MEMBER_TYPE
public static final String ERR_INVALID_BASE_TYPE
public static final String ERR_INVALID_WHITESPACE_VALUE
public static final String ERR_PARSE_ERROR
public static final String ERR_INVALID_VALUE_FOR_THIS_TYPE
public static final String ERR_FACET_MUST_BE_NON_NEGATIVE_INTEGER
public static final String ERR_FACET_MUST_BE_POSITIVE_INTEGER
public static final String ERR_OVERRIDING_FIXED_FACET
public static final String ERR_INCONSISTENT_FACETS_1
public static final String ERR_INCONSISTENT_FACETS_2
public static final String ERR_X_AND_Y_ARE_EXCLUSIVE
public static final String ERR_LOOSENED_FACET
public static final String ERR_SCALE_IS_GREATER_THAN_PRECISION
public static final String ERR_DUPLICATE_FACET
public static final String ERR_NOT_APPLICABLE_FACET
public static final String ERR_EMPTY_UNION
protected XSDatatypeImpl(String uri, String typeName, WhiteSpaceProcessor whiteSpace)
public String getNamespaceUri()
XSDatatypegetNamespaceUri in interface XSDatatypepublic String getName()
XSDatatypeIn the terminology of the spec, this method returns the name property of this simple type component. If the name property is absent, this method returns null.
getName in interface XSDatatypepublic final Object createValue(String lexicalValue, org.relaxng.datatype.ValidationContext context)
createValue in interface org.relaxng.datatype.Datatypeprotected abstract Object _createValue(String content, org.relaxng.datatype.ValidationContext context)
public final void checkValid(String content, org.relaxng.datatype.ValidationContext context) throws org.relaxng.datatype.DatatypeException
checkValid in interface org.relaxng.datatype.Datatypeorg.relaxng.datatype.DatatypeExceptionprotected abstract void _checkValid(String content, org.relaxng.datatype.ValidationContext context) throws org.relaxng.datatype.DatatypeException
org.relaxng.datatype.DatatypeExceptionpublic final Object createJavaObject(String literal, org.relaxng.datatype.ValidationContext context)
DatabindableDatatypeFor the actual types returned by each type, see here.
Note that due to the difference between those Java friendly types
and actual XML Schema specification, the returned object sometimes
loses accuracy. For example, the "time" type allows "0.0000000000001 sec"
which cannot be represented in java.util.Calendar class.
createJavaObject in interface DatabindableDatatypeprotected abstract Object _createJavaObject(String literal, org.relaxng.datatype.ValidationContext context)
public final boolean isValid(String literal, org.relaxng.datatype.ValidationContext context)
isValid in interface org.relaxng.datatype.Datatypepublic boolean isAlwaysValid()
XSDatatypeThis method can return false even if the datatype actually accepts any string. That is, it's perfectly OK for any datatype to return false from this method.
isAlwaysValid in interface XSDatatypepublic org.relaxng.datatype.DatatypeStreamingValidator createStreamingValidator(org.relaxng.datatype.ValidationContext context)
createStreamingValidator in interface org.relaxng.datatype.Datatypeprotected abstract boolean checkFormat(String literal, org.relaxng.datatype.ValidationContext context)
protected boolean needValueCheck()
public DataTypeWithFacet getFacetObject(String facetName)
getFacetObject in interface XSDatatypepublic String[] getApplicableFacetNames()
XSDatatypegetApplicableFacetNames in interface XSDatatypepublic abstract ConcreteType getConcreteType()
public final boolean sameValue(Object o1, Object o2)
sameValue in interface org.relaxng.datatype.Datatypepublic final int valueHashCode(Object o)
valueHashCode in interface org.relaxng.datatype.Datatypepublic final boolean isDerivedTypeOf(XSDatatype baseType, boolean restrictionAllowed)
XSDatatypeThis method is an implementation of "Type Derivation OK (Simple)" of the spec. Therefore use caution if what you want is a casual method because this method may cause a lot of unintuitive result.
Note to implementors Use the static version of this method defined in the XSDatatypeImpl class. You don't need to implement this method from scratch.
isDerivedTypeOf in interface XSDatatyperestrictionAllowed - This test needs "a subset of {extension,restriction,list,union}
(of which only restriction is actually relevant). If this flag is
set to true, this method behaves as if the empty set is passed as the set.
This is usually what you want if you're simply trying to check the
derivation relationship.
If this flag is set to false, this method behaves as if {restriction} is passed as the set.
public static boolean isDerivedTypeOf(XSDatatype base, XSDatatype derived, boolean restrictionAllowed)
isDerivedTypeOf(XSDatatype,boolean)public XSDatatype getAncestorBuiltinType()
XSDatatypeThis method traverses the inheritance chain from this datatype to the root type (anySimpleType) and return the first built-in type it finds.
For example, if you derive a type Foo from NCName and Bar from Foo, then this method returns NCName.
getAncestorBuiltinType in interface XSDatatypepublic int getIdType()
ID_TYPE_NULL is returned by default.getIdType in interface org.relaxng.datatype.Datatypepublic boolean isContextDependent()
isContextDependent in interface org.relaxng.datatype.DatatypeCopyright © 2016 Oracle Corporation. All Rights Reserved.