com.thaiopensource.datatype.xsd
Class QNameDatatype

java.lang.Object
  extended by com.thaiopensource.datatype.xsd.DatatypeBase
      extended by com.thaiopensource.datatype.xsd.QNameDatatype
All Implemented Interfaces:
Datatype2, Datatype

 class QNameDatatype
extends DatatypeBase


Nested Class Summary
(package private) static class QNameDatatype.QName
           
 
Field Summary
 
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
QNameDatatype()
           
 
Method Summary
(package private)  boolean allowsValue(String str, ValidationContext vc)
           
(package private)  Object getValue(String str, ValidationContext vc)
           
 boolean isContextDependent()
          Checks if this datatype may need a context object for the validation.
 boolean lexicallyAllows(String str)
           
 
Methods inherited from class com.thaiopensource.datatype.xsd.DatatypeBase
alwaysValid, checkValid, createStreamingValidator, createValue, getIdType, getMeasure, getOrderRelation, getPrimitive, getWhiteSpace, isValid, normalizeWhiteSpace, sameValue, valueHashCode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QNameDatatype

QNameDatatype()
Method Detail

lexicallyAllows

public boolean lexicallyAllows(String str)
Specified by:
lexicallyAllows in class DatatypeBase

getValue

Object getValue(String str,
                ValidationContext vc)
Specified by:
getValue in class DatatypeBase

allowsValue

boolean allowsValue(String str,
                    ValidationContext vc)
Overrides:
allowsValue in class DatatypeBase

isContextDependent

public boolean isContextDependent()
Description copied from interface: Datatype
Checks if this datatype may need a context object for the validation.

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.

Specified by:
isContextDependent in interface Datatype
Overrides:
isContextDependent in class DatatypeBase
Returns:
true if this datatype is context-dependent (it needs a context object sometimes); false if this datatype is context-independent (it never needs a context object).