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
  • Field Details

    • THE_INSTANCE

      public static final Id 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.DatatypeException
      Checks that the value is a proper HTML5 id.
      Specified by:
      checkValid in class AbstractDatatype
      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 class AbstractDatatype