Class TokenDocument<T extends GenericToken<T>>
- java.lang.Object
-
- net.sourceforge.pmd.lang.ast.impl.TokenDocument<T>
-
- Direct Known Subclasses:
JavaccTokenDocument
public abstract class TokenDocument<T extends GenericToken<T>> extends Object
Token layer of a parsed file. This object is used to store state global to all tokens of a single file, e.g. the text document. Not all languages currently have an implementation of a token document.- See Also:
JavaccTokenDocument
-
-
Constructor Summary
Constructors Constructor Description TokenDocument(TextDocument textDocument)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract T
getFirstToken()
Returns the first token of the token chain.Chars
getFullText()
Returns the original text of the file (without escaping).TextDocument
getTextDocument()
-
-
-
Constructor Detail
-
TokenDocument
public TokenDocument(TextDocument textDocument)
-
-
Method Detail
-
getFullText
public Chars getFullText()
Returns the original text of the file (without escaping).
-
getTextDocument
public TextDocument getTextDocument()
-
getFirstToken
public abstract T getFirstToken()
Returns the first token of the token chain.- Throws:
IllegalStateException
- If the document has not been parsed yet
-
-