|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.thaiopensource.datatype.xsd.DatatypeBase
com.thaiopensource.datatype.xsd.ListDatatype
class ListDatatype
Field Summary | |
---|---|
private DatatypeBase |
itemType
|
Fields inherited from class com.thaiopensource.datatype.xsd.DatatypeBase |
---|
WHITE_SPACE_COLLAPSE, WHITE_SPACE_PRESERVE, WHITE_SPACE_REPLACE |
Fields inherited from interface org.relaxng.datatype.Datatype |
---|
ID_TYPE_ID, ID_TYPE_IDREF, ID_TYPE_IDREFS, ID_TYPE_NULL |
Constructor Summary | |
---|---|
ListDatatype(DatatypeBase itemType)
|
Method Summary | |
---|---|
(package private) boolean |
allowsValue(String str,
ValidationContext vc)
|
int |
getIdType()
Checks if the ID/IDREF semantics is associated with this datatype. |
int |
getLength(Object obj)
|
(package private) Measure |
getMeasure()
|
(package private) Object |
getValue(String str,
ValidationContext vc)
|
boolean |
isContextDependent()
Checks if this datatype may need a context object for the validation. |
(package private) boolean |
lexicallyAllows(String str)
|
boolean |
sameValue(Object obj1,
Object obj2)
Tests the equality of two value objects which were originally created by the createValue method of this object. |
int |
valueHashCode(Object obj)
Computes the hash code for a value object, which is consistent with the sameValue method. |
Methods inherited from class com.thaiopensource.datatype.xsd.DatatypeBase |
---|
alwaysValid, checkValid, createStreamingValidator, createValue, getOrderRelation, getPrimitive, getWhiteSpace, isValid, normalizeWhiteSpace |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final DatatypeBase itemType
Constructor Detail |
---|
ListDatatype(DatatypeBase itemType)
Method Detail |
---|
Object getValue(String str, ValidationContext vc)
getValue
in class DatatypeBase
boolean lexicallyAllows(String str)
lexicallyAllows
in class DatatypeBase
boolean allowsValue(String str, ValidationContext vc)
allowsValue
in class DatatypeBase
Measure getMeasure()
getMeasure
in class DatatypeBase
public int getLength(Object obj)
getLength
in interface Measure
public boolean isContextDependent()
Datatype
The callee must return true even when the context is not always necessary. (For example, the "QName" type doesn't need a context object when validating unprefixed string. But nonetheless QName must return true.)
XSD's string
and short
types
are examples of context-independent datatypes.
Its QName
and ENTITY
types
are examples of context-dependent datatypes.
When a datatype is context-independent, then
the Datatype.isValid(java.lang.String, org.relaxng.datatype.ValidationContext)
method, the Datatype.checkValid(java.lang.String, org.relaxng.datatype.ValidationContext)
method,
the Datatype.createStreamingValidator(org.relaxng.datatype.ValidationContext)
method and
the Datatype.createValue(java.lang.String, org.relaxng.datatype.ValidationContext)
method can be called without
providing a context object.
isContextDependent
in interface Datatype
isContextDependent
in class DatatypeBase
public int getIdType()
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.
getIdType
in interface Datatype
getIdType
in class DatatypeBase
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
.public int valueHashCode(Object obj)
Datatype
valueHashCode
in interface Datatype
valueHashCode
in class DatatypeBase
public boolean sameValue(Object obj1, Object obj2)
Datatype
sameValue
in interface Datatype
sameValue
in class DatatypeBase
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |