net.lucidviews.util
Class PropertyException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended bynet.lucidviews.util.PropertyException
All Implemented Interfaces:
java.io.Serializable

public class PropertyException
extends java.lang.Exception

Exception raised by the Properties class when a property is missing or invalid.
The exception stores extra information about the source of the properties table, the id/key of the property and its value.

Since:
1.0
Version:
$Revision: 1.3 $
Author:
Stephen Battey
See Also:
Properties, Serialized Form

Field Summary
protected  java.lang.String _propertyKey
          The key that references the property that was missing/invalid.
protected  java.lang.String _propertySource
          A description of where the properties were read from.
protected  java.lang.String _propertyValue
          The value of the property that was not valid.
static java.lang.String MISSING_VALUE
          Property value used when the error is caused by a missing value.
 
Fields inherited from class java.lang.Exception
 
Fields inherited from class java.lang.Throwable
 
Constructor Summary
PropertyException(java.lang.String propertySource, java.lang.String propertyKey)
          Create a new exception caused by a missing property value.
PropertyException(java.lang.String propertySource, java.lang.String propertyKey, java.lang.String propertyValue, ParseValueException parseException)
          Create a new exception caused by an invalid property value.
 
Method Summary
 java.lang.String getPropertyKey()
           
 java.lang.String getPropertySource()
           
 java.lang.String getPropertyValue()
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MISSING_VALUE

public static final java.lang.String MISSING_VALUE
Property value used when the error is caused by a missing value.

See Also:
Constant Field Values

_propertySource

protected java.lang.String _propertySource
A description of where the properties were read from.


_propertyKey

protected java.lang.String _propertyKey
The key that references the property that was missing/invalid.


_propertyValue

protected java.lang.String _propertyValue
The value of the property that was not valid.

Constructor Detail

PropertyException

public PropertyException(java.lang.String propertySource,
                         java.lang.String propertyKey,
                         java.lang.String propertyValue,
                         ParseValueException parseException)
Create a new exception caused by an invalid property value.

Parameters:
propertySource - a description of where the property was read from
propertyKey - the key that references the property in the Properties table
propertyValue - the value that was invalid
parseException - the error raised when trying to parse the property value

PropertyException

public PropertyException(java.lang.String propertySource,
                         java.lang.String propertyKey)
Create a new exception caused by a missing property value.

Parameters:
propertySource - a description of where the property was expected to be defined
propertyKey - the key that was expected to reference the property in the Properties table
Method Detail

getPropertySource

public java.lang.String getPropertySource()
Returns:
a description of where the properties were read from

getPropertyKey

public java.lang.String getPropertyKey()
Returns:
the key that references the property that was missing/invalid

getPropertyValue

public java.lang.String getPropertyValue()
Returns:
the invalid property value (null if the value did not exist)