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 FileId 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 @NonNull FileLocation
location()
TokenMgrError
setFileId(FileId fileId)
Replace the file name of this error.-
Methods inherited from class net.sourceforge.pmd.lang.ast.FileAnalysisException
getFileId, 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 FileId filename, String message, @Nullable Throwable cause)
Create a new exception.- Parameters:
line
- Line numbercolumn
- Column numberfilename
- Filename. If unknown, it can be completed with#setFileName(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()
-
location
protected @NonNull FileLocation location()
- Overrides:
location
in classFileAnalysisException
-
errorKind
protected String errorKind()
- Overrides:
errorKind
in classFileAnalysisException
-
setFileId
public TokenMgrError setFileId(FileId fileId)
Replace the file name of this error.- Overrides:
setFileId
in classFileAnalysisException
- Parameters:
fileId
- New filename- Returns:
- A new exception
-
-