|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Throwable java.lang.Exception PIRL.PVL.PVL_Exception
public class PVL_Exception
A PVL_Exception is thrown by classes in the PVL package. To
differentiate the possible causes for a PVL_Exception, while avoiding a
profusion of subclasses, a local Message String is provided that
describes the reason for the exception. The getMessage
method of the Exception base class will always return a String that
includes this message along with any other description that was
provided when the exceptpion was created. In addition, a
Location is available which can indicate where a Parser
encountered an exception in an input stream.
Field Summary | |
---|---|
static String |
AGGREGATE_CLOSURE_MISMATCH
Message : Aggregate enclosure parameters do not match. |
static String |
ARRAY_CLOSURE_MISMATCH
Message : Array enclosure characters do not match. |
static String |
BAD_ARGUMENT
Message : Invalid argument. |
static String |
EMPTY_STATEMENT
Message : Empty statement or list. |
static String |
Exception_Name
The name of this exception. |
static String |
FILE_IO
Message : Problem with file I/O. |
static String |
GROUP_VALUE
Message : Inappropriate aggregate identifier (not a string). |
static String |
ID
Class name and version identification. |
static String |
ILLEGAL_SYNTAX
Message : Illegal syntax. |
static String |
INCOMPATIBLE_TYPES
Message : Incompatible object class types. |
static String |
MISSING_AGGREGATE_END
Message : Missing end of aggregate parameters. |
static String |
MISSING_COMMENT_END
Message : Missing end of comment string. |
static String |
MISSING_QUOTE_END
Message : Missing end of quoted string. |
static String |
MISSING_UNITS_END
Message : Missing end of units string. |
static String |
NO_LAST_LOCATION
Message : Could not find the last location. |
static String |
RESERVED_CHARACTER
Message : Reserved character in symbol. |
static String |
SIZED_RECORDS
Message : Binary sized records detected. |
static String |
SYSTEM_ERROR
Message : Unexpected system error! |
static String |
VALUE_OVERFLOW
Message : Numeric value out of range. |
Constructor Summary | |
---|---|
PVL_Exception()
Creates a PVL_Exception with the PVL_Exception class identification String as the default Message . |
|
PVL_Exception(String message)
Creates a PVL_Exception with the specified message. |
|
PVL_Exception(String message,
String explanation)
Creates a PVL_Exception with the specified message and explanation text. |
|
PVL_Exception(String ID,
String message,
String explanation)
Creates a PVL_Exception with the specified ID line, message, and explanation text. |
|
PVL_Exception(String ID,
String message,
String explanation,
long location)
Creates a PVL_Exception with the specified ID line, message, explanation text, and location value. |
Method Summary | |
---|---|
long |
Location()
Gets the exception's location value. |
String |
Message()
Gets the exception's local message String. |
String |
toString()
Gets a String composed of "PVL Exception: " followed by the Message . |
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 |
---|
public static final String ID
public static final String Exception_Name
public static final String SYSTEM_ERROR
Message
: Unexpected system error!
public static final String BAD_ARGUMENT
Message
: Invalid argument.
public static final String INCOMPATIBLE_TYPES
Message
: Incompatible object class types.
public static final String FILE_IO
Message
: Problem with file I/O.
public static final String MISSING_QUOTE_END
Message
: Missing end of quoted string.
public static final String MISSING_COMMENT_END
Message
: Missing end of comment string.
public static final String MISSING_UNITS_END
Message
: Missing end of units string.
public static final String RESERVED_CHARACTER
Message
: Reserved character in symbol.
public static final String ILLEGAL_SYNTAX
Message
: Illegal syntax.
public static final String EMPTY_STATEMENT
Message
: Empty statement or list.
public static final String VALUE_OVERFLOW
Message
: Numeric value out of range.
public static final String ARRAY_CLOSURE_MISMATCH
Message
: Array enclosure characters do not match.
public static final String GROUP_VALUE
Message
: Inappropriate aggregate identifier (not a string).
public static final String MISSING_AGGREGATE_END
Message
: Missing end of aggregate parameters.
public static final String AGGREGATE_CLOSURE_MISMATCH
Message
: Aggregate enclosure parameters do not match.
public static final String SIZED_RECORDS
Message
: Binary sized records detected.
public static final String NO_LAST_LOCATION
Message
: Could not find the last location.
Constructor Detail |
---|
public PVL_Exception()
Message
.
public PVL_Exception(String message)
message
- A String to set as the exception Message
.public PVL_Exception(String message, String explanation)
getMessage
String.
message
- A String to set as the exception Message
.explanation
- A String to append to the exception description.public PVL_Exception(String ID, String message, String explanation)
getMessage
String.
ID
- A String to precede the message in the exception description.message
- A String to set as the exception Message
.explanation
- A String to append to the exception description.public PVL_Exception(String ID, String message, String explanation, long location)
getMessage
String. A line providing
the location value will also be appended.
ID
- A String to precede the message in the exception description.message
- A String to set as the exception Message
.explanation
- A String to append to the exception description.location
- A long to set as the exception Location
.Method Detail |
---|
public String toString()
Message
.
toString
in class Throwable
public String Message()
try { // Some PVL operation. } catch (PVL_Exception exception) { if (exception.Message ().equals (PVL_Exception.FILE_IO)) { // Do something with the file. } // ... }
public long Location()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |