gov.nasa.pds.tools
Class LabelParserException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by 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: 7288 $
Author:
pramirez, jagander
See Also:
Serialized Form

Field Summary
protected  File sourceFile
           
protected  URI sourceURI
           
 
Constructor Summary
LabelParserException(Dictionary sourceDictionary, Integer lineNumber, Integer column, String key, Constants.ProblemType type, Object... arguments)
           
LabelParserException(Exception e, Integer lineNumber, Integer column, Constants.ProblemType type)
           
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
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(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
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
 
Method Summary
 Object[] getArguments()
           
 Integer getColumn()
           
 String getKey()
           
 Integer getLineNumber()
           
 File getSourceFile()
           
 URI getSourceURI()
           
 Constants.ProblemType getType()
           
 String toString()
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sourceURI

protected final URI sourceURI

sourceFile

protected final File sourceFile
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 occurred
column - within the file where the exception started
key - used to quickly associate lookup or filter this type of exception
type - classification of the problem
arguments - 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 exception
type - classification of the problem
arguments - 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 occurred
lineNumber - within the file where the exception started
column - within the file where the exception started
key - used to quickly associate lookup or filter this type of exception
type - classification of the problem
arguments - 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 occurred
lineNumber - within the file where the exception started
column - within the file where the exception started
key - used to quickly associate lookup or filter this type of exception
type - classification of the problem
arguments - 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 occurred
lineNumber - within the file where the exception started
column - within the file where the exception started
key - used to quickly associate lookup or filter this type of exception
type - classification of the problem
arguments - 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

toString

public String toString()
Overrides:
toString in class Throwable


Copyright © 2005-2011 Planetary Data System. All Rights Reserved.