PIRL.PVL

## Class PVL_Exception

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - PIRL.PVL.PVL_Exception

All Implemented Interfaces:
  Serializable

    public class PVL_Exception
    extends 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.

See Also:
  Serialized Form

### Field Summary

Fields
`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

Constructors
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.

### Method Summary

Methods
`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

`addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Field Detail

#### ID

    public static final String ID

Class name and version identification.

See Also:
  Constant Field Values

#### Exception_Name

    public static final String Exception_Name

The name of this exception.

See Also:
  Constant Field Values

#### SYSTEM_ERROR

    public static final String SYSTEM_ERROR

`Message`: Unexpected system error!

See Also:
  Constant Field Values

#### BAD_ARGUMENT

    public static final String BAD_ARGUMENT

`Message`: Invalid argument.

See Also:
  Constant Field Values

#### INCOMPATIBLE_TYPES

    public static final String INCOMPATIBLE_TYPES

`Message`: Incompatible object class types.

See Also:
  Constant Field Values

#### FILE_IO

    public static final String FILE_IO

`Message`: Problem with file I/O.

See Also:
  Constant Field Values

#### MISSING_QUOTE_END

    public static final String MISSING_QUOTE_END

`Message`: Missing end of quoted string.

See Also:
  Constant Field Values

#### MISSING_COMMENT_END

    public static final String MISSING_COMMENT_END

`Message`: Missing end of comment string.

See Also:
  Constant Field Values

#### MISSING_UNITS_END

    public static final String MISSING_UNITS_END

`Message`: Missing end of units string.

See Also:
  Constant Field Values

#### RESERVED_CHARACTER

    public static final String RESERVED_CHARACTER

`Message`: Reserved character in symbol.

See Also:
  Constant Field Values

#### ILLEGAL_SYNTAX

    public static final String ILLEGAL_SYNTAX

`Message`: Illegal syntax.

See Also:
  Constant Field Values

#### EMPTY_STATEMENT

    public static final String EMPTY_STATEMENT

`Message`: Empty statement or list.

See Also:
  Constant Field Values

#### VALUE_OVERFLOW

    public static final String VALUE_OVERFLOW

`Message`: Numeric value out of range.

See Also:
  Constant Field Values

#### ARRAY_CLOSURE_MISMATCH

    public static final String ARRAY_CLOSURE_MISMATCH

`Message`: Array enclosure characters do not match.

See Also:
  Constant Field Values

#### GROUP_VALUE

    public static final String GROUP_VALUE

`Message`: Inappropriate aggregate identifier (not a string).

See Also:
  Constant Field Values

#### MISSING_AGGREGATE_END

    public static final String MISSING_AGGREGATE_END

`Message`: Missing end of aggregate parameters.

See Also:
  Constant Field Values

#### AGGREGATE_CLOSURE_MISMATCH

    public static final String AGGREGATE_CLOSURE_MISMATCH

`Message`: Aggregate enclosure parameters do not match.

See Also:
  Constant Field Values

#### SIZED_RECORDS

    public static final String SIZED_RECORDS

`Message`: Binary sized records detected.

See Also:
  Constant Field Values

#### NO_LAST_LOCATION

    public static final String NO_LAST_LOCATION

`Message`: Could not find the last location.

See Also:
  Constant Field Values

### Constructor Detail

#### PVL_Exception

    public PVL_Exception()

Creates a PVL_Exception with the PVL_Exception class identification String as the default `Message`.

#### PVL_Exception

    public PVL_Exception(String message)

Creates a PVL_Exception with the specified message.

Parameters:
  `message` - A String to set as the exception `Message`.

#### PVL_Exception

    public PVL_Exception(String message,
                 String explanation)

Creates a PVL_Exception with the specified message and explanation text. The expanation will follow the message after a newline in the `getMessage` String.

Parameters:
  `message` - A String to set as the exception `Message`.
  `explanation` - A String to append to the exception description.

#### PVL_Exception

    public PVL_Exception(String ID,
                 String message,
                 String explanation)

Creates a PVL_Exception with the specified ID line, message, and explanation text. The ID line will precede the message, and the expanation will follow, in the `getMessage` String.

Parameters:
  `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.

#### PVL_Exception

    public 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. The ID line will precede the message, and the expanation will follow, in the `getMessage` String. A line providing the location value will also be appended.

Parameters:
  `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

#### toString

    public String toString()

Gets a String composed of "PVL Exception: " followed by the `Message`.

Overrides:
  `toString` in class `Throwable`
Returns:
  A brief description of the exception.

#### Message

    public String Message()

Gets the exception's local message String. The message String identifies the specific cause for the exception. It might be used as follows:

    try
        {
        // Some PVL operation.
        }
    catch (PVL_Exception exception)
        {
        if (exception.Message ().equals (PVL_Exception.FILE_IO))
            {
            // Do something with the file.
            }
        // ...
        }

Returns:
  The exception's local message String.

#### Location

    public long Location()

Gets the exception's location value. The value will be -1 if no value was set.

Returns:
  The exception's location value.