Package net.sourceforge.pmd.lang.ast
Class TokenMgrError
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- net.sourceforge.pmd.lang.ast.FileAnalysisException
-
- net.sourceforge.pmd.lang.ast.TokenMgrError
-
- All Implemented Interfaces:
Serializable
public final class TokenMgrError extends FileAnalysisException
An error thrown during lexical analysis of a file.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TokenMgrError(boolean eofSeen, String lexStateName, int errorLine, int errorColumn, String errorAfter, char curChar)
Constructor called by JavaCC.TokenMgrError(int line, int column, @Nullable String filename, String message, @Nullable Throwable cause)
Create a new exception.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
errorKind()
int
getColumn()
int
getLine()
protected String
positionToString()
TokenMgrError
setFileName(String filename)
Replace the file name of this error.-
Methods inherited from class net.sourceforge.pmd.lang.ast.FileAnalysisException
getFileName, getMessage, hasFileName, wrap
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
TokenMgrError
public TokenMgrError(int line, int column, @Nullable String filename, String message, @Nullable Throwable cause)
Create a new exception.- Parameters:
line
- Line numbercolumn
- Column numberfilename
- Filename. If unknown, it can be completed withsetFileName(String)
latermessage
- Message of the errorcause
- Cause of the error, if any
-
TokenMgrError
@InternalApi public TokenMgrError(boolean eofSeen, String lexStateName, int errorLine, int errorColumn, String errorAfter, char curChar)
Constructor called by JavaCC.
-
-
Method Detail
-
getLine
public int getLine()
-
getColumn
public int getColumn()
-
positionToString
protected String positionToString()
- Overrides:
positionToString
in classFileAnalysisException
-
errorKind
protected String errorKind()
- Overrides:
errorKind
in classFileAnalysisException
-
setFileName
public TokenMgrError setFileName(String filename)
Replace the file name of this error.- Overrides:
setFileName
in classFileAnalysisException
- Parameters:
filename
- New filename- Returns:
- A new exception
-
-