Package org.jsoup.parser
Class Token
- java.lang.Object
-
- org.jsoup.parser.Token
-
- Direct Known Subclasses:
Token.Character
,Token.Comment
,Token.Doctype
,Token.EOF
,Token.Tag
abstract class Token extends java.lang.Object
Parse tokens for the Tokeniser.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
Token.CData
(package private) static class
Token.Character
(package private) static class
Token.Comment
(package private) static class
Token.Doctype
(package private) static class
Token.EndTag
(package private) static class
Token.EOF
(package private) static class
Token.StartTag
(package private) static class
Token.Tag
static class
Token.TokenType
-
Field Summary
Fields Modifier and Type Field Description private int
endPos
private int
startPos
(package private) Token.TokenType
type
(package private) static int
Unset
-
Constructor Summary
Constructors Modifier Constructor Description private
Token(Token.TokenType type)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) Token.Character
asCharacter()
(package private) Token.Comment
asComment()
(package private) Token.Doctype
asDoctype()
(package private) Token.EndTag
asEndTag()
(package private) Token.StartTag
asStartTag()
(package private) int
endPos()
(package private) void
endPos(int pos)
(package private) boolean
isCData()
(package private) boolean
isCharacter()
(package private) boolean
isComment()
(package private) boolean
isDoctype()
(package private) boolean
isEndTag()
(package private) boolean
isEOF()
(package private) boolean
isStartTag()
(package private) Token
reset()
Reset the data represent by this token, for reuse.(package private) static void
reset(java.lang.StringBuilder sb)
(package private) int
startPos()
(package private) void
startPos(int pos)
(package private) java.lang.String
tokenType()
-
-
-
Field Detail
-
type
final Token.TokenType type
-
Unset
static final int Unset
- See Also:
- Constant Field Values
-
startPos
private int startPos
-
endPos
private int endPos
-
-
Constructor Detail
-
Token
private Token(Token.TokenType type)
-
-
Method Detail
-
tokenType
java.lang.String tokenType()
-
reset
Token reset()
Reset the data represent by this token, for reuse. Prevents the need to create transfer objects for every piece of data, which immediately get GCed.
-
startPos
int startPos()
-
startPos
void startPos(int pos)
-
endPos
int endPos()
-
endPos
void endPos(int pos)
-
reset
static void reset(java.lang.StringBuilder sb)
-
isDoctype
final boolean isDoctype()
-
asDoctype
final Token.Doctype asDoctype()
-
isStartTag
final boolean isStartTag()
-
asStartTag
final Token.StartTag asStartTag()
-
isEndTag
final boolean isEndTag()
-
asEndTag
final Token.EndTag asEndTag()
-
isComment
final boolean isComment()
-
asComment
final Token.Comment asComment()
-
isCharacter
final boolean isCharacter()
-
isCData
final boolean isCData()
-
asCharacter
final Token.Character asCharacter()
-
isEOF
final boolean isEOF()
-
-