jCookie v0.8b

com.sonalb
Interface IEnhancedException

All Known Implementing Classes:
EnhancedRuntimeException, EnhancedException, EnhancedIOException

public interface IEnhancedException

Allows implementing classes to contain an application-specific error code, the class and method of origin, a data Object, and any underlying (causal) Exception.

These enhancements are described below :-

Following are some guidelines for implementations :-

NOTE: Direct implementing classes DO NOT follow the same hierarchy as followed by the Exceptions in the core Java packages. For example, EnhancedIOException is NOT a direct subclass of EnhancedException, even though IOException is a direct subclass of Exception. In other words, (EnhancedIOException instanceof EnhancedException) returns false even though (IOException instanceof Exception) returns true.

Author:
Sonal Bansal
See Also:
Exception, EnhancedException, EnhancedIOException

Method Summary
 Exception getCausalException()
          Returns the underlying Exception (if any) for this instance.
 String getCode()
          Returns the application-specific error code associated with this instance.
 Object getDataObject()
          Returns the data object (if any) set by the originator.
 String getOriginClass()
          Returns the fully-qualified name of the class which constructed this instance.
 String getOriginMethod()
          Returns the name of the method in which this instance was constructed.
 void removeDataObject()
          Removes the data object (if any) contained in this instance.
 

Method Detail

getOriginClass

public String getOriginClass()
Returns the fully-qualified name of the class which constructed this instance.
Returns:
the String representing the class of origin ; "UNKNOWN" if it was not set.

getOriginMethod

public String getOriginMethod()
Returns the name of the method in which this instance was constructed.
Returns:
the String representing the method of origin ; "UNKNOWN" if it was not set.

getCode

public String getCode()
Returns the application-specific error code associated with this instance.
Returns:
the String representing the error code ; "UNSPECIFIED" if it was not set.

getCausalException

public Exception getCausalException()
Returns the underlying Exception (if any) for this instance.
Returns:
the underlying (causal) Exception ; null if there is none.

getDataObject

public Object getDataObject()
Returns the data object (if any) set by the originator.
Returns:
the Object ; null if there is none.

removeDataObject

public void removeDataObject()
Removes the data object (if any) contained in this instance.

Copyright (c) 2001-2002 Sonal Bansal