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
An error thrown during lexical analysis of a file.
Note: This exception has been called TokenMgrError in PMD 6.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionLexException(int line, int column, @Nullable FileId filename, String message, @Nullable Throwable cause) Create a new exception. -
Method Summary
Modifier and TypeMethodDescriptionprotected StringintintgetLine()protected @NonNull FileLocationlocation()Replace the file name of this error.Methods inherited from class net.sourceforge.pmd.lang.ast.FileAnalysisException
getFileId, getMessage, hasFileName, wrapMethods inherited from class org.apache.commons.lang3.exception.ContextedRuntimeException
addContextValue, getContextEntries, getContextLabels, getContextValues, getFirstContextValue, getFormattedExceptionMessage, getRawMessage, setContextValueMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
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 Details
-
getLine
public int getLine() -
getColumn
public int getColumn() -
location
- Overrides:
locationin classFileAnalysisException
-
errorKind
- Overrides:
errorKindin classFileAnalysisException
-
setFileId
Replace the file name of this error.- Overrides:
setFileIdin classFileAnalysisException- Parameters:
fileId- New filename- Returns:
- A new exception
-