cds.simbad.ident
Class IdentifierDescriptionException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended bycds.simbad.ident.IdentifierDescriptionException
All Implemented Interfaces:
java.io.Serializable

public class IdentifierDescriptionException
extends java.lang.Exception

Exception class for identifier description analysis The exception objects are created by factory methods.

See Also:
Serialized Form

Field Summary
(package private)  int code
           
(package private)  java.lang.String instr
           
static int INVALID_PARAM
           
static int NOVALUE
           
(package private)  int pos
           
static int UNKNOWN_INSTRUCTION
           
static int UNKNOWN_PARAM
           
 
Fields inherited from class java.lang.Exception
 
Fields inherited from class java.lang.Throwable
 
Constructor Summary
IdentifierDescriptionException(int code, java.lang.String instr, int pos)
          Constructor.
 
Method Summary
 int getCode()
          Retuns the error code that triggered the throwing of this exception
 java.lang.String getInstruction()
          Returns the instruction string in which the error occured
 int getPosition()
          Returns the position in the analyzed string where the error occured
static IdentifierDescriptionException invalidParameter(java.lang.String ins, int pos)
          creates a IdentifierDescriptionException object for invalid parameter
static IdentifierDescriptionException noValue(java.lang.String ins, int pos)
          creates a IdentifierDescriptionException object for parameter without value
 java.lang.String toString()
          Produces an error message
static IdentifierDescriptionException unknownInstruction(java.lang.String ins)
          creates a IdentifierDescriptionException object for unknown instruction
static IdentifierDescriptionException unknownParameter(java.lang.String ins, int pos)
          creates a IdentifierDescriptionException object for unknown parameter
 
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

UNKNOWN_INSTRUCTION

public static final int UNKNOWN_INSTRUCTION
See Also:
Constant Field Values

UNKNOWN_PARAM

public static final int UNKNOWN_PARAM
See Also:
Constant Field Values

INVALID_PARAM

public static final int INVALID_PARAM
See Also:
Constant Field Values

NOVALUE

public static final int NOVALUE
See Also:
Constant Field Values

instr

java.lang.String instr

pos

int pos

code

int code
Constructor Detail

IdentifierDescriptionException

public IdentifierDescriptionException(int code,
                                      java.lang.String instr,
                                      int pos)
Constructor.

Parameters:
code - error code
instr - instruction string
pos - error position in the string
Method Detail

unknownInstruction

public static IdentifierDescriptionException unknownInstruction(java.lang.String ins)
creates a IdentifierDescriptionException object for unknown instruction

Parameters:
ins - instruction string in which the error occured
Returns:
the exception object to throw

unknownParameter

public static IdentifierDescriptionException unknownParameter(java.lang.String ins,
                                                              int pos)
creates a IdentifierDescriptionException object for unknown parameter

Parameters:
ins - instruction string in which the error occured
pos - position in the parameter string where the error was found
Returns:
the exception object to throw

invalidParameter

public static IdentifierDescriptionException invalidParameter(java.lang.String ins,
                                                              int pos)
creates a IdentifierDescriptionException object for invalid parameter

Parameters:
ins - instruction string in which the error occured
pos - position in the parameter string where the error was found
Returns:
the exception object to throw

noValue

public static IdentifierDescriptionException noValue(java.lang.String ins,
                                                     int pos)
creates a IdentifierDescriptionException object for parameter without value

Parameters:
ins - instruction string in which the error occured
pos - position in the parameter string where the error was found
Returns:
the exception object to throw

getCode

public int getCode()
Retuns the error code that triggered the throwing of this exception

Returns:
the error code. It may be
  • IdentifierDescriptionException.UNKNOWN_INSTRUCTION
  • IdentifierDescriptionException.UNKNOWN_PARAM
  • IdentifierDescriptionException.UNKNOWN_NOVALUE

getPosition

public int getPosition()
Returns the position in the analyzed string where the error occured

Returns:
the offset of the error in its instruction string

getInstruction

public java.lang.String getInstruction()
Returns the instruction string in which the error occured

Returns:
the instruction string

toString

public java.lang.String toString()
Produces an error message

Returns:
the error message string