Package nu.validator.datatype
Class Id
java.lang.Object
nu.validator.datatype.AbstractDatatype
nu.validator.datatype.Id
- All Implemented Interfaces:
org.relaxng.datatype.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$
- Author:
- hsivonen
-
Nested Class Summary
Nested classes/interfaces inherited from class nu.validator.datatype.AbstractDatatype
AbstractDatatype.CharSequenceWithOffset
-
Field Summary
Fields Modifier and Type Field Description static Id
THE_INSTANCE
The singleton instance. -
Constructor Summary
Constructors Modifier Constructor Description protected
Id()
Package-private constructor -
Method Summary
Modifier and Type Method Description void
checkValid(java.lang.CharSequence literal)
Checks that the value is a proper HTML5 id.java.lang.String
getName()
Methods inherited from class nu.validator.datatype.AbstractDatatype
checkValid, createStreamingValidator, createValue, getIdType, isAsciiDigit, isContextDependent, isValid, isWhitespace, newDatatypeException, newDatatypeException, newDatatypeException, newDatatypeException, newDatatypeException, newDatatypeException, newDatatypeException, newDatatypeException, newDatatypeException, newDatatypeException, newDatatypeException, newDatatypeException, sameValue, split, toAsciiLowerCase, toAsciiLowerCase, toAsciiUpperCase, toAsciiUpperCase, valueHashCode
-
Field Details
-
THE_INSTANCE
The singleton instance.
-
-
Constructor Details
-
Id
protected Id()Package-private constructor
-
-
Method Details
-
checkValid
public void checkValid(java.lang.CharSequence literal) throws org.relaxng.datatype.DatatypeExceptionChecks that the value is a proper HTML5 id.- Specified by:
checkValid
in classAbstractDatatype
- Parameters:
literal
- the value- Throws:
org.relaxng.datatype.DatatypeException
- if the value isn't valid- See Also:
Datatype.checkValid(java.lang.String, org.relaxng.datatype.ValidationContext)
-
getName
public java.lang.String getName()- Specified by:
getName
in classAbstractDatatype
-