com.thaiopensource.datatype.xsd
Class RestrictDatatype
java.lang.Object
com.thaiopensource.datatype.xsd.DatatypeBase
com.thaiopensource.datatype.xsd.RestrictDatatype
- All Implemented Interfaces:
- Datatype2, Datatype
- Direct Known Subclasses:
- PatternRestrictDatatype, ValueRestrictDatatype
class RestrictDatatype
- extends DatatypeBase
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
base
protected final DatatypeBase base
RestrictDatatype
RestrictDatatype(DatatypeBase base)
RestrictDatatype
RestrictDatatype(DatatypeBase base,
int whiteSpace)
lexicallyAllows
boolean lexicallyAllows(String str)
- Specified by:
lexicallyAllows
in class DatatypeBase
allowsValue
boolean allowsValue(String str,
ValidationContext vc)
- Overrides:
allowsValue
in class DatatypeBase
getOrderRelation
OrderRelation getOrderRelation()
- Overrides:
getOrderRelation
in class DatatypeBase
getMeasure
Measure getMeasure()
- Overrides:
getMeasure
in class DatatypeBase
getValue
Object getValue(String str,
ValidationContext vc)
- Specified by:
getValue
in class DatatypeBase
getPrimitive
DatatypeBase getPrimitive()
- Overrides:
getPrimitive
in class DatatypeBase
getIdType
public int getIdType()
- Description copied from interface:
Datatype
- Checks if the ID/IDREF semantics is associated with this
datatype.
This method is introduced to support the RELAX NG DTD
compatibility spec. (Of course it's always free to use
this method for other purposes.)
If you are implementing a datatype library and have no idea about
the "RELAX NG DTD compatibility" thing, just return
ID_TYPE_NULL
is fine.
- Specified by:
getIdType
in interface Datatype
- Overrides:
getIdType
in class DatatypeBase
- Returns:
- If this datatype doesn't have any ID/IDREF semantics,
it returns
Datatype.ID_TYPE_NULL
. If it has such a semantics
(for example, XSD:ID, XSD:IDREF and comp:ID type), then
it returns Datatype.ID_TYPE_ID
, Datatype.ID_TYPE_IDREF
or
Datatype.ID_TYPE_IDREFS
.
sameValue
public boolean sameValue(Object value1,
Object value2)
- Description copied from interface:
Datatype
- Tests the equality of two value objects which were originally
created by the createValue method of this object.
The behavior is undefined if objects not created by this type
are passed. It is the caller's responsibility to ensure that
value objects belong to this type.
- Specified by:
sameValue
in interface Datatype
- Overrides:
sameValue
in class DatatypeBase
- Returns:
- true if two value objects are considered equal according to
the definition of this datatype; false if otherwise.
valueHashCode
public int valueHashCode(Object value)
- Description copied from interface:
Datatype
- Computes the hash code for a value object,
which is consistent with the sameValue method.
- Specified by:
valueHashCode
in interface Datatype
- Overrides:
valueHashCode
in class DatatypeBase
- Returns:
- hash code for the specified value object.