|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.Ostermiller.Syntax.Lexer.Token com.Ostermiller.Syntax.Lexer.HTMLToken
public class HTMLToken
A HTMLToken is a token that is returned by a lexer that is lexing a HTML
source file. It has several attributes describing the token:
The type of token, the text of the token, the line number on which it
occurred, the number of characters into the input at which it started, and
similarly, the number of characters into the input at which it ended.
Field Summary | |
---|---|
static int |
COMMENT
|
static int |
DOCTYPE_TAG
|
static int |
END_TAG
|
static int |
ERROR_MALFORMED_TAG
|
static int |
SCRIPT
|
static int |
START_TAG
|
static int |
TEXT
|
static int |
WHITE_SPACE
|
Fields inherited from class com.Ostermiller.Syntax.Lexer.Token |
---|
INITIAL_STATE, UNDEFINED_STATE |
Constructor Summary | |
---|---|
HTMLToken(int ID,
String contents,
int lineNumber,
int charBegin,
int charEnd)
Create a new token. |
|
HTMLToken(int ID,
String contents,
int lineNumber,
int charBegin,
int charEnd,
int state)
Create a new token. |
Method Summary | |
---|---|
String |
errorString()
get a String that explains the error, if this token is an error. |
int |
getCharBegin()
get the offset into the input in characters at which this token started |
int |
getCharEnd()
get the offset into the input in characters at which this token ended |
String |
getContents()
get the contents of this token |
String |
getDescription()
A description of this token. |
int |
getID()
get the ID number of this token |
int |
getLineNumber()
get the line number of the input on which this token started |
int |
getState()
Get an integer representing the state the tokenizer is in after returning this token. |
boolean |
isComment()
Checks this token to see if it is a comment. |
boolean |
isError()
Checks this token to see if it is an Error. |
boolean |
isScript()
Checks this token to see if it is an script. |
boolean |
isTag()
Checks this token to see if it is a tag. |
boolean |
isText()
Checks this token to see if it is text. |
boolean |
isWhiteSpace()
Checks this token to see if it is White Space. |
String |
toString()
get a representation of this token as a human readable string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int START_TAG
public static final int END_TAG
public static final int DOCTYPE_TAG
public static final int TEXT
public static final int SCRIPT
public static final int COMMENT
public static final int WHITE_SPACE
public static final int ERROR_MALFORMED_TAG
Constructor Detail |
---|
public HTMLToken(int ID, String contents, int lineNumber, int charBegin, int charEnd)
ID
- the id number of the tokencontents
- A string representing the text of the tokenlineNumber
- the line number of the input on which this token startedcharBegin
- the offset into the input in characters at which this token startedcharEnd
- the offset into the input in characters at which this token endedpublic HTMLToken(int ID, String contents, int lineNumber, int charBegin, int charEnd, int state)
ID
- the id number of the tokencontents
- A string representing the text of the tokenlineNumber
- the line number of the input on which this token startedcharBegin
- the offset into the input in characters at which this token startedcharEnd
- the offset into the input in characters at which this token endedstate
- the state the tokenizer is in after returning this token.Method Detail |
---|
public int getState()
getState
in class Token
public int getID()
getID
in class Token
public String getContents()
getContents
in class Token
public int getLineNumber()
getLineNumber
in class Token
public int getCharBegin()
getCharBegin
in class Token
public int getCharEnd()
getCharEnd
in class Token
public boolean isTag()
public boolean isText()
public boolean isScript()
public boolean isComment()
isComment
in class Token
public boolean isWhiteSpace()
isWhiteSpace
in class Token
public boolean isError()
isError
in class Token
public String getDescription()
getDescription
in class Token
public String errorString()
errorString
in class Token
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |