com.ccg.io
Class ConfigException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.ccg.io.ConfigException
All Implemented Interfaces:
Serializable

public class ConfigException
extends Exception

Fundamental exception type thrown by the "config" file classes.

For an general overview of configuration issues (and how this class fits in to the scheme), refer to the Configuration Files document.

This exception is thrown by some of the methods found in the "config" file related classes. It provides a common exception for all of these classes to share.

This class also provides a means to specify the underlying cause of the exception. For example, if a IOException occurred while trying to open a config file, then this exception would be assigned at the time of construction. Others would then be able to inspect the underlying problem via the getException() and getIOException() methods.

Since:
1.0
Version:
$Revision: 1.1.1.1 $
Author:
$Author: pkb $
See Also:
ConfigSource, ConfigAttributes, Serialized Form

Constructor Summary
ConfigException(String text, Exception cause)
          Constructs the exception with a text message and underlying problem.
 
Method Summary
 Exception getException()
          Get the underlying Exception which cause the problem.
 IOException getIOException()
          See if underlying problem was a IOException.
 String toString()
          Form a string representation of the exception.
 
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
 

Constructor Detail

ConfigException

public ConfigException(String text,
                       Exception cause)
Constructs the exception with a text message and underlying problem.

Use this method to construct these exception types. You must pass both a text message describing the problem, and a underlying Exception (if applicable) which triggered the problem.

Parameters:
text - Text message explaining what triggered the exception
cause - Underlying Exception which triggered the problem (or null if there wasn't one).
Since:
1.0
See Also:
getException()
Method Detail

getException

public Exception getException()
Get the underlying Exception which cause the problem.

Returns:
Current Exception value assigned.
See Also:
getIOException()

getIOException

public IOException getIOException()
See if underlying problem was a IOException.

If the configuration exception was triggered by a IOException (such as a file not found), this method will return a non-null reference to the IOException which occurred. If a underlying exception was not set, or is not a descendant of IOException, this method returns null.

Returns:
The IOException which was the underlying problem, or null if a IOException was not the underlying problem.
See Also:
getException()

toString

public String toString()
Form a string representation of the exception.

This method builds a composite string from the text string assigned to this object (at construction) and any underlying exception which was also assigned.

Overrides:
toString in class Throwable
Returns:
Composite string representation of problem.
Since:
1.0


Copyright 1998-1998-2006 null. All Rights Reserved.