com.cburch.editor.scanners
Enum HtmlTokenType

java.lang.Object
  extended by java.lang.Enum<HtmlTokenType>
      extended by com.cburch.editor.scanners.HtmlTokenType
All Implemented Interfaces:
TokenType, java.io.Serializable, java.lang.Comparable<HtmlTokenType>

public enum HtmlTokenType
extends java.lang.Enum<HtmlTokenType>
implements TokenType

Defines the different categories of tokens that might be encountered in an HTML file.

Version:
0.1 2005-05-31
Author:
Carl Burch

Enum Constant Summary
ANCHOR_TEXT
          Text within an anchor element.
COMMENT
          A comment.
DEPRECATED_TAG
          A deprecated tag.
ERROR
          A sequence of invalid characters.
TAG
          A recognized, valid tag.
TEXT
          Text within a regular element.
UNKNOWN_TAG
          An unknown tag.
 
Method Summary
 javax.swing.text.AttributeSet getAttributeSet()
          Return the style in which tokens of this type should be drawn.
 java.lang.String getDescriptor()
          Returns a terse description of what sort of token this corresponds to.
static HtmlTokenType valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static HtmlTokenType[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

TAG

public static final HtmlTokenType TAG
A recognized, valid tag.


DEPRECATED_TAG

public static final HtmlTokenType DEPRECATED_TAG
A deprecated tag.


UNKNOWN_TAG

public static final HtmlTokenType UNKNOWN_TAG
An unknown tag.


TEXT

public static final HtmlTokenType TEXT
Text within a regular element.


ANCHOR_TEXT

public static final HtmlTokenType ANCHOR_TEXT
Text within an anchor element.


COMMENT

public static final HtmlTokenType COMMENT
A comment.


ERROR

public static final HtmlTokenType ERROR
A sequence of invalid characters.

Method Detail

values

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

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static HtmlTokenType 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

getDescriptor

public java.lang.String getDescriptor()
Returns a terse description of what sort of token this corresponds to.

Returns:
the terse description.

getAttributeSet

public javax.swing.text.AttributeSet getAttributeSet()
Return the style in which tokens of this type should be drawn.

Specified by:
getAttributeSet in interface TokenType
Returns:
the style for tokens of this type.