public class PVL_Exception extends Exception
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.
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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 . |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
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.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
.public String toString()
Message
.
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()