Package gov.nasa.pds.tools
Class LabelParserException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- gov.nasa.pds.tools.LabelParserException
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
DefinitionNotFoundException
,InvalidLengthException
,InvalidTypeException
,OutOfRangeException
,UnknownDefinitionException
,UnsupportedTypeException
public class LabelParserException extends Exception
This class captures any exceptions that arise during label parsing. If possible the exception retains the context in which it occurred.- Version:
- $Revision$
- Author:
- pramirez, jagander
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected File
sourceFile
protected URI
sourceURI
-
Constructor Summary
Constructors Constructor Description LabelParserException(Dictionary sourceDictionary, Integer lineNumber, Integer column, String key, Constants.ProblemType type, Object... arguments)
LabelParserException(Label label, Integer lineNumber, Integer column, String key, Constants.ProblemType type, Object... arguments)
Use this constructor for exceptions that are associated with a specific file but not on a given line (e.g.LabelParserException(Statement statement, Integer column, String key, Constants.ProblemType type, Object... arguments)
Use of this constructor is encouraged where possible as it retains the context of the exception.LabelParserException(File sourceFile, Integer lineNumber, Integer column, String key, Constants.ProblemType type, Object... arguments)
Use this constructor for exceptions to be reported about a file that can be traced back to a line and columnLabelParserException(Exception e, Integer lineNumber, Integer column, Constants.ProblemType type)
LabelParserException(String key, Constants.ProblemType type, Object... arguments)
Use this constructor for exceptions not associated to a specific file such as not being able to parse due to missing file or bad URLLabelParserException(URI sourceURI, Integer lineNumber, Integer column, String key, Constants.ProblemType type, Object... arguments)
Use this constructor for exceptions to be reported about a URI that can be traced back to a line and column
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object[]
getArguments()
Integer
getColumn()
String
getKey()
Integer
getLineNumber()
File
getSourceFile()
URI
getSourceURI()
Statement
getStatement()
Constants.ProblemType
getType()
String
toString()
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
-
-
-
Constructor Detail
-
LabelParserException
public LabelParserException(Statement statement, Integer column, String key, Constants.ProblemType type, Object... arguments)
Use of this constructor is encouraged where possible as it retains the context of the exception.- Parameters:
statement
- in which the exception occurredcolumn
- within the file where the exception startedkey
- used to quickly associate lookup or filter this type of exceptiontype
- classification of the problemarguments
- to be used in generating problem messages
-
LabelParserException
public LabelParserException(String key, Constants.ProblemType type, Object... arguments)
Use this constructor for exceptions not associated to a specific file such as not being able to parse due to missing file or bad URL- Parameters:
key
- used to quickly associate lookup or filter this type of exceptiontype
- classification of the problemarguments
- to be used in generating problem messages
-
LabelParserException
public LabelParserException(Label label, Integer lineNumber, Integer column, String key, Constants.ProblemType type, Object... arguments)
Use this constructor for exceptions that are associated with a specific file but not on a given line (e.g. missing statements)- Parameters:
label
- within which the exception occurredlineNumber
- within the file where the exception startedcolumn
- within the file where the exception startedkey
- used to quickly associate lookup or filter this type of exceptiontype
- classification of the problemarguments
- to be used in generating problem messages
-
LabelParserException
public LabelParserException(File sourceFile, Integer lineNumber, Integer column, String key, Constants.ProblemType type, Object... arguments)
Use this constructor for exceptions to be reported about a file that can be traced back to a line and column- Parameters:
sourceFile
- within which the exception occurredlineNumber
- within the file where the exception startedcolumn
- within the file where the exception startedkey
- used to quickly associate lookup or filter this type of exceptiontype
- classification of the problemarguments
- to be used in generating problem messages
-
LabelParserException
public LabelParserException(URI sourceURI, Integer lineNumber, Integer column, String key, Constants.ProblemType type, Object... arguments)
Use this constructor for exceptions to be reported about a URI that can be traced back to a line and column- Parameters:
sourceURI
- within which the exception occurredlineNumber
- within the file where the exception startedcolumn
- within the file where the exception startedkey
- used to quickly associate lookup or filter this type of exceptiontype
- classification of the problemarguments
- to be used in generating problem messages
-
LabelParserException
public LabelParserException(Dictionary sourceDictionary, Integer lineNumber, Integer column, String key, Constants.ProblemType type, Object... arguments)
- Parameters:
sourceDictionary
-lineNumber
-column
-key
-type
-arguments
-
-
LabelParserException
public LabelParserException(Exception e, Integer lineNumber, Integer column, Constants.ProblemType type)
- Parameters:
e
-lineNumber
-column
-type
-
-
-
Method Detail
-
getSourceURI
public URI getSourceURI()
- Returns:
- URI of the file in which the exception occurred
-
getSourceFile
public File getSourceFile()
- Returns:
- File in which the exception occurred
-
getLineNumber
public Integer getLineNumber()
- Returns:
- Line number of the exception if applicable
-
getColumn
public Integer getColumn()
- Returns:
- Column number of the exception if applicable
-
getType
public Constants.ProblemType getType()
- Returns:
- classification of the problem
-
getArguments
public Object[] getArguments()
- Returns:
- arguments to be used in producing a message about this exception
-
getKey
public String getKey()
- Returns:
- key of this exception which is useful for filtering
-
getStatement
public Statement getStatement()
- Returns:
- statement in which the exception occurred.
-
-