Package org.jdom2

Enum AttributeType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<AttributeType>

    public enum AttributeType
    extends java.lang.Enum<AttributeType>
    Use a simple enumeration for the Attribute Types
    Author:
    Rolf Lear
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      CDATA
      Attribute type: the attribute value is a string.
      ENTITIES
      Attribute type: the attribute value is a list of entity names.
      ENTITY
      Attribute type: the attribute value is the name of an entity.
      ENUMERATION
      Attribute type: the attribute value is a name token from an enumeration.
      ID
      Attribute type: the attribute value is a unique identifier.
      IDREF
      Attribute type: the attribute value is a reference to a unique identifier.
      IDREFS
      Attribute type: the attribute value is a list of references to unique identifiers.
      NMTOKEN
      Attribute type: the attribute value is a name token.
      NMTOKENS
      Attribute type: the attribute value is a list of name tokens.
      NOTATION
      Attribute type: the attribute value is the name of a notation.
      UNDECLARED
      Attribute type: the attribute has not been declared or type is unknown.
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static AttributeType byIndex​(int index)
      Deprecated.
      Use normal Enums instead of int's
      static AttributeType getAttributeType​(java.lang.String typeName)
      Returns the the JDOM AttributeType value from the SAX 2.0 attribute type string provided by the parser.
      static AttributeType valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static AttributeType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • values

        public static AttributeType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (AttributeType c : AttributeType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static AttributeType valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • byIndex

        @Deprecated
        public static final AttributeType byIndex​(int index)
        Deprecated.
        Use normal Enums instead of int's
        Obtain a AttributeType by a int constant. This goes against the logic of enums, but this is used for backward compatibility. Thus, this method is marked Deprecated.
        Parameters:
        index - The AttributeType int equivalent to retrieve
        Returns:
        The AttributeType corresponding to the specified equivalent
        Throws:
        java.lang.IllegalArgumentException - if there is no equivalent
      • getAttributeType

        public static final AttributeType getAttributeType​(java.lang.String typeName)
        Returns the the JDOM AttributeType value from the SAX 2.0 attribute type string provided by the parser.
        Parameters:
        typeName - String the SAX 2.0 attribute type string.
        Returns:
        int the JDOM attribute type.
        See Also:
        Attribute.setAttributeType(org.jdom2.AttributeType), Attributes.getType(int)