HtmlTokenType.java revision 4e867904c8295537803c1c8a076e130df5674b58
1package org.owasp.html;
2
3/**
4 * Types of html tokens.
5 *
6 * @author mikesamuel@gmail.com
7 */
8enum HtmlTokenType {
9  /**
10   * An html or xml attribute name consisting of characters other than
11   * whitespace, =, or specials.
12   */
13  ATTRNAME,
14  /** An html value, possibly a quoted string. */
15  ATTRVALUE,
16  /** An html or xml style comment, <tt>&lt;!-- for example --></tt>. */
17  COMMENT,
18  /**
19   * A directive such as a DOCTYPE declaration.
20   */
21  DIRECTIVE,
22  /** Unescaped tag, for instance, inside a script, or xmp tag. */
23  UNESCAPED,
24  /**
25   * A quoted string.  Should not show up in well formed html, but may where
26   * there is an attribute value without a corresponding name.
27   */
28  QSTRING,
29  /**
30   * The beginning of a tag -- not to be confused with a start tag.
31   * Valid tag beginnings include <tt>&lt;a</tt> and <tt>&lt;/a</tt>.  The
32   * rest of the tag is a series of attribute names, values, and the tag end.
33   */
34  TAGBEGIN,
35  /** The end of a tag.  Either <tt>&gt;</tt> or <tt>/&gt;</tt>. */
36  TAGEND,
37  /** A block of text, either inside a tag, or as element content. */
38  TEXT,
39  /** Ignorable whitespace nodes. */
40  IGNORABLE,
41  /** A server side script block a la php or jsp. */
42  SERVERCODE,
43  ;
44}
45