Package net.sourceforge.pmd.lang.ast
Class LexException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- org.apache.commons.lang3.exception.ContextedRuntimeException
-
- net.sourceforge.pmd.lang.ast.FileAnalysisException
-
- net.sourceforge.pmd.lang.ast.LexException
-
- All Implemented Interfaces:
Serializable
,org.apache.commons.lang3.exception.ExceptionContext
public final class LexException extends FileAnalysisException
An error thrown during lexical analysis of a file.Note: This exception has been called TokenMgrError in PMD 6.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LexException(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()
LexException
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 org.apache.commons.lang3.exception.ContextedRuntimeException
addContextValue, getContextEntries, getContextLabels, getContextValues, getFirstContextValue, getFormattedExceptionMessage, getRawMessage, setContextValue
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
LexException
public LexException(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 withsetFileId(FileId)
} latermessage
- Message of the errorcause
- Cause of the error, if any
-
-
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 LexException setFileId(FileId fileId)
Replace the file name of this error.- Overrides:
setFileId
in classFileAnalysisException
- Parameters:
fileId
- New filename- Returns:
- A new exception
-
-