com.thaiopensource.relaxng.impl
Class TokenDatatype

java.lang.Object
  extended by com.thaiopensource.relaxng.impl.StringDatatype
      extended by com.thaiopensource.relaxng.impl.TokenDatatype
All Implemented Interfaces:
Datatype2, Datatype

 class TokenDatatype
extends StringDatatype


Field Summary
 
Fields inherited from interface org.relaxng.datatype.Datatype
ID_TYPE_ID, ID_TYPE_IDREF, ID_TYPE_IDREFS, ID_TYPE_NULL
 
Constructor Summary
TokenDatatype()
           
 
Method Summary
 Object createValue(String str, ValidationContext vc)
          Converts lexcial value and the current context to the corresponding value object.
 
Methods inherited from class com.thaiopensource.relaxng.impl.StringDatatype
alwaysValid, checkValid, createStreamingValidator, getIdType, isContextDependent, isValid, sameValue, valueHashCode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TokenDatatype

TokenDatatype()
Method Detail

createValue

public Object createValue(String str,
                          ValidationContext vc)
Description copied from interface: Datatype
Converts lexcial value and the current context to the corresponding value object.

The caller cannot generally assume that the value object is a meaningful Java object. For example, the caller cannot expect this method to return java.lang.Number type for the "integer" type of XML Schema Part 2.

Also, the caller cannot assume that the equals method and the hashCode method of the value object are consistent with the semantics of the datatype. For that purpose, the sameValue method and the valueHashCode method have to be used. Note that this means you cannot use classes like java.util.Hashtable to store the value objects.

The returned value object should be used solely for the sameValue and valueHashCode methods.

Specified by:
createValue in interface Datatype
Overrides:
createValue in class StringDatatype
vc - If this datatype is context-dependent (when the Datatype.isContextDependent() method returns true), then the caller must provide a non-null valid context object. Otherwise, the caller can pass null.
Returns:
null when the given lexical value is not a valid lexical value for this type.