|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.whattf.datatype.AbstractDatatype
abstract class AbstractDatatype
Common superclass for HTML5 datatypes. Implements all methods of the
Datatype interface and leaves a new checkValid for
subclasses to implement.
| Field Summary | |
|---|---|
private static int |
CASE_MASK
Mask for ASCII case folding. |
| Fields inherited from interface org.relaxng.datatype.Datatype |
|---|
ID_TYPE_ID, ID_TYPE_IDREF, ID_TYPE_IDREFS, ID_TYPE_NULL |
| Constructor Summary | |
|---|---|
AbstractDatatype()
Constructor |
|
| Method Summary | |
|---|---|
abstract void |
checkValid(CharSequence literal)
|
void |
checkValid(String literal,
ValidationContext context)
Delegates to checkValid(CharSequence literal). |
DatatypeStreamingValidator |
createStreamingValidator(ValidationContext context)
Merely returns a DatatypeStreamingValidatorImpl. |
Object |
createValue(String literal,
ValidationContext context)
Implements strict string equality semantics by returning literal
itself. |
int |
getIdType()
Always returns Datatype.ID_TYPE_NULL. |
boolean |
isContextDependent()
Always returns false |
boolean |
isValid(String literal,
ValidationContext context)
Calls checkValid(CharSequence literal). |
protected boolean |
isWhitespace(char c)
Checks if a UTF-16 code unit represents a whitespace character (U+0020, U+0009, U+000D or U+000A). |
boolean |
sameValue(Object value1,
Object value2)
Implements strict string equality semantics by performing a standard equals check on the arguments. |
protected char |
toAsciiLowerCase(char c)
If the argument is an upper case ASCII letter, returns the letter in lower case. |
protected String |
toAsciiLowerCase(String str)
|
int |
valueHashCode(Object value)
Implements strict stirng equality semantics by returning the java.lang.Object-level hashCode of
the object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final int CASE_MASK
| Constructor Detail |
|---|
AbstractDatatype()
| Method Detail |
|---|
public final boolean isValid(String literal,
ValidationContext context)
checkValid(CharSequence literal).
isValid in interface Datatypeliteral - the valuecontext - the validation context (ignored by subclasses)
true if valid and false if notDatatype.isValid(java.lang.String, org.relaxng.datatype.ValidationContext)
public final void checkValid(String literal,
ValidationContext context)
throws DatatypeException
checkValid(CharSequence literal).
checkValid in interface Datatypeliteral - the valuecontext - the validation context (ignored by subclasses)
DatatypeException - if the literal does not conform to the datatype definitionDatatype.checkValid(java.lang.String, org.relaxng.datatype.ValidationContext)
public abstract void checkValid(CharSequence literal)
throws DatatypeException
DatatypeExceptionpublic DatatypeStreamingValidator createStreamingValidator(ValidationContext context)
DatatypeStreamingValidatorImpl.
createStreamingValidator in interface Datatypecontext - the validation context (ignored by subclasses)
DatatypeStreamingValidatorDatatype.createStreamingValidator(org.relaxng.datatype.ValidationContext)
public Object createValue(String literal,
ValidationContext context)
literal
itself.
createValue in interface Datatypeliteral - the value (get returned)context - ignored
literal that was passed inDatatype.createValue(java.lang.String, org.relaxng.datatype.ValidationContext)
public final boolean sameValue(Object value1,
Object value2)
equals check on the arguments.
sameValue in interface Datatypevalue1 - an object returned by createValuevalue2 - another object returned by createValue
true if the values are equal, false otherwiseDatatype.sameValue(java.lang.Object, java.lang.Object)public final int valueHashCode(Object value)
java.lang.Object-level hashCode of
the object.
valueHashCode in interface Datatypevalue - an object returned by createValue
Datatype.valueHashCode(java.lang.Object)public int getIdType()
Datatype.ID_TYPE_NULL. (Overridden by subclasses
that have a different ID-type.)
getIdType in interface DatatypeDatatype.ID_TYPE_NULLDatatype.getIdType()public final boolean isContextDependent()
false
isContextDependent in interface DatatypefalseDatatype.isContextDependent()protected final boolean isWhitespace(char c)
c - the code unit
true if whitespace, false otherwiseprotected final char toAsciiLowerCase(char c)
c - a UTF-16 code unit
protected final String toAsciiLowerCase(String str)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||