net.lucidviews.util
Class PropertyException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by net.lucidviews.util.PropertyException
All Implemented Interfaces:
Serializable

public class PropertyException
extends 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  String _propertyKey
          The key that references the property that was missing/invalid.
protected  String _propertySource
          A description of where the properties were read from.
protected  String _propertyValue
          The value of the property that was not valid.
static String MISSING_VALUE
          Property value used when the error is caused by a missing value.
 
Constructor Summary
PropertyException(String propertySource, String propertyKey)
          Create a new exception caused by a missing property value.
PropertyException(String propertySource, String propertyKey, String propertyValue, ParseValueException parseException)
          Create a new exception caused by an invalid property value.
 
Method Summary
 String getPropertyKey()
           
 String getPropertySource()
           
 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 String MISSING_VALUE
Property value used when the error is caused by a missing value.

See Also:
Constant Field Values

_propertySource

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


_propertyKey

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


_propertyValue

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

Constructor Detail

PropertyException

public PropertyException(String propertySource,
                         String propertyKey,
                         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(String propertySource,
                         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 String getPropertySource()
Returns:
a description of where the properties were read from

getPropertyKey

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

getPropertyValue

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