Class NmTokenAttribute

Direct Known Subclasses:
Attr_hreflang, Attr_lang, Attr_xml_lang, Element_a.Attr_name, Element_bool.Attr_default, Element_comment.Attr_name, Element_entry.Attr_lang, Element_enum.Attr_default, Element_enum.Attr_name, Element_enumeration.Attr_name, Element_enumitem.Attr_compilable, Element_enumset.Attr_name, Element_enumSetContains.Attr_number, Element_enumSetContains.Attr_option, Element_enumSetContains.Attr_value, Element_float.Attr_default, Element_int.Attr_default, Element_map.Attr_name, Element_object.Attr_name, Element_optarg.Attr_number, Element_optarg.Attr_option, Element_option.Attr_abbrev, Element_option.Attr_name, Element_text.Attr_lang, Element_text.Attr_lang, IdAttribute, IdRefAttribute

public abstract class NmTokenAttribute extends TypedAttribute<String>
Base class for all generated classes which realize an Attribute with an "NMTOKEN" type. Offers additionally static methods for checking several flavours of Token definitions from XML, which can be used explicitly by user code, and are used by this and other attribute base classes.
  • Constructor Details

  • Method Details

    • checkValue

      protected void checkValue(@Opt String value) throws TdomAttributeSyntaxException
      Check routine for the validity of the attributes' intended value. Is a call-back, implemented by the sub-classes. Is called only here, by two constructors and the TypedAttribute.setValue(V) method. The value null means "absent" for #IMPLIED attributes and passes the test.
      Specified by:
      checkValue in class TypedAttribute<String>
      Parameters:
      value - the value to test; maybe null.
      Throws:
      TdomAttributeSyntaxException - iff the value does not match the type of the XML attribute, including a forbidden Null.
    • getTypeString

      public String getTypeString()
      The definition text for the "type" of the attribute in the original DTD.
      Specified by:
      getTypeString in class TypedAttribute<String>
    • encode

      public final void encode(EncodingOutputStream out, TypedExtension ext) throws IOException
      Description copied from class: TypedNode
      Abstract fall-back method which MUST be overridden and always throws an Exception.
      Specified by:
      encode in class TypedNode<TypedExtension>
      Throws:
      IOException
    • getStringValue

      public final @Opt String getStringValue(@Opt String s)
      Description copied from class: TypedAttribute
      Returns the textual representation of a possible attribute value (not null), as it would be contained literally in a possible XML text representation. Since the textual representation of a String is the string itself, this method is relevant for enumeration types only (Later: also for "entity" types, but these are not yet supported.)
      Specified by:
      getStringValue in class TypedAttribute<String>
      Returns:
      (never null) the textual representation of this attribute value, as it would be contained literally in a possible XML text representation.