org.whattf.datatype
Class Id

java.lang.Object
  extended by org.whattf.datatype.AbstractDatatype
      extended by org.whattf.datatype.Id
All Implemented Interfaces:
Datatype
Direct Known Subclasses:
Idref

public class Id
extends AbstractDatatype

This datatype shall accept any string that consists of one or more characters and does not contain any whitespace characters.

The ID-type of this datatype is ID.

Version:
$Id: Id.java,v 1.4 2006/11/18 11:51:44 hsivonen Exp $
Author:
hsivonen

Field Summary
static Id THE_INSTANCE
          The singleton instance.
 
Fields inherited from interface org.relaxng.datatype.Datatype
ID_TYPE_ID, ID_TYPE_IDREF, ID_TYPE_IDREFS, ID_TYPE_NULL
 
Constructor Summary
protected Id()
          Package-private constructor
 
Method Summary
 void checkValid(CharSequence literal)
          Checks that the value is a proper HTML5 id.
 int getIdType()
          Returns Datatype.ID_TYPE_ID.
 
Methods inherited from class org.whattf.datatype.AbstractDatatype
checkValid, createStreamingValidator, createValue, isContextDependent, isValid, isWhitespace, sameValue, toAsciiLowerCase, toAsciiLowerCase, valueHashCode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

THE_INSTANCE

public static final Id THE_INSTANCE
The singleton instance.

Constructor Detail

Id

protected Id()
Package-private constructor

Method Detail

checkValid

public void checkValid(CharSequence literal)
                throws DatatypeException
Checks that the value is a proper HTML5 id.

Specified by:
checkValid in class AbstractDatatype
Parameters:
literal - the value
context - ignored
Throws:
DatatypeException - if the value isn't valid
See Also:
Datatype.checkValid(java.lang.String, org.relaxng.datatype.ValidationContext)

getIdType

public int getIdType()
Returns Datatype.ID_TYPE_ID.

Specified by:
getIdType in interface Datatype
Overrides:
getIdType in class AbstractDatatype
Returns:
Datatype.ID_TYPE_ID
See Also:
Datatype.getIdType()