Class TokenDocument<T extends GenericToken>
- java.lang.Object
-
- net.sourceforge.pmd.lang.ast.impl.TokenDocument<T>
-
- Direct Known Subclasses:
JavaccTokenDocument
@Experimental public abstract class TokenDocument<T extends GenericToken> extends Object
Token layer of a parsed file.
-
-
Constructor Summary
Constructors Constructor Description TokenDocument(String fullText)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description int
columnFromOffset(int offsetInclusive)
abstract T
getFirstToken()
Returns the first token of the token chain.String
getFullText()
Returns the original text of the file (without escaping).int
lineNumberFromOffset(int offset)
-
-
-
Constructor Detail
-
TokenDocument
public TokenDocument(String fullText)
-
-
Method Detail
-
getFullText
public String getFullText()
Returns the original text of the file (without escaping).
-
lineNumberFromOffset
public int lineNumberFromOffset(int offset)
-
columnFromOffset
public int columnFromOffset(int offsetInclusive)
-
getFirstToken
public abstract T getFirstToken()
Returns the first token of the token chain.- Throws:
IllegalStateException
- If the document has not been parsed yet
-
-