Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.sonalb
Class EnhancedIOException  view EnhancedIOException download EnhancedIOException.java

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byjava.io.IOException
              extended bycom.sonalb.EnhancedIOException
All Implemented Interfaces:
IEnhancedException, java.io.Serializable

public class EnhancedIOException
extends java.io.IOException
implements IEnhancedException

Convenience implementation of IEnhancedException interface, and subclass of java.io.IOException.

Setter methods for the error code, causal Exception, class and method of origin, and data Object are provided. However, once these fields have been set, any subsequent calls to the respective setters throws an UnsupportedOperationException.


Nested Class Summary
 
Nested classes inherited from class java.lang.Throwable
 
Field Summary
private  boolean bCausalSet
           
private  boolean bClassSet
           
private  boolean bCodeSet
           
private  boolean bDataSet
           
private  boolean bMethodSet
           
private  java.lang.Exception causalException
           
static java.lang.String CVSID
           
private  java.lang.Object data
           
private  java.lang.String exceptionCode
           
private static java.util.logging.Logger logger
           
private  java.lang.String originClass
           
private  java.lang.String originMethod
           
 
Fields inherited from class java.io.IOException
 
Fields inherited from class java.lang.Throwable
 
Constructor Summary
EnhancedIOException()
          Constructs a "plain vanilla" EnhancedIOException.
EnhancedIOException(java.lang.Exception under)
          Constructs an EnhancedIOException with the specified causal Exception.
EnhancedIOException(java.lang.String s)
          Constructs an EnhancedIOException with a short detail message.
EnhancedIOException(java.lang.String s, java.lang.Exception under)
          Constructs an EnhancedIOException with the specified detail message and causal Exception.
EnhancedIOException(java.lang.String s, java.lang.Exception under, java.lang.String code, java.lang.Object o, java.lang.String method)
          Constructs an EnhancedIOException with a detail message, causal Exception, error code, class and method of origin.
EnhancedIOException(java.lang.String code, java.lang.Object o, java.lang.String method)
          Constructs an EnhancedIOException with an error code and, class and method of origin.
EnhancedIOException(java.lang.String s, java.lang.String code, java.lang.Object o, java.lang.String method)
          Constructs an EnhancedIOException with a detail message, error code, class and method of origin.
 
Method Summary
 java.lang.Exception getCausalException()
          Returns the underlying Exception (if any) for this instance.
 java.lang.String getCode()
          Returns the application-specific error code associated with this instance.
 java.lang.Object getDataObject()
          Returns the data object (if any) set by the originator.
 java.lang.String getOriginClass()
          Returns the fully-qualified name of the class which constructed this instance.
 java.lang.String getOriginMethod()
          Returns the name of the method in which this instance was constructed.
protected  void internalSetCausalException(java.lang.Exception e)
          Sets the underlying (causal) Exception for this instance.
protected  void internalSetCode(java.lang.String c)
          Sets the error-code which identifies the particular error condition that triggered this exception.
protected  void internalSetDataObject(java.lang.Object o)
          Sets the data Object which will be passed up the call stack.
protected  void internalSetOriginClass(java.lang.Object o)
          Sets the class of origin for this instance.
protected  void internalSetOriginMethod(java.lang.String meth)
          Sets the method of origin for this instance.
 void removeDataObject()
          Removes the data object (if any) contained in this instance.
 void setCausalException(java.lang.Exception e)
          Sets the underlying (causal) Exception for this instance.
 void setCode(java.lang.String c)
          Sets the error-code which identifies the particular error condition that triggered this exception.
 void setDataObject(java.lang.Object o)
          Sets the data Object which will be passed up the call stack.
 void setOriginClass(java.lang.Object o)
          Sets the class of origin for this instance.
 void setOriginMethod(java.lang.String meth)
          Sets the method of origin for this instance.
 java.lang.String toString()
          Returns a short description of this instance.
 
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
 

Field Detail

CVSID

public static final java.lang.String CVSID
See Also:
Constant Field Values

logger

private static java.util.logging.Logger logger

causalException

private java.lang.Exception causalException

exceptionCode

private java.lang.String exceptionCode

originClass

private java.lang.String originClass

originMethod

private java.lang.String originMethod

data

private java.lang.Object data

bDataSet

private boolean bDataSet

bClassSet

private boolean bClassSet

bMethodSet

private boolean bMethodSet

bCodeSet

private boolean bCodeSet

bCausalSet

private boolean bCausalSet
Constructor Detail

EnhancedIOException

public EnhancedIOException()
Constructs a "plain vanilla" EnhancedIOException.


EnhancedIOException

public EnhancedIOException(java.lang.String s)
Constructs an EnhancedIOException with a short detail message.


EnhancedIOException

public EnhancedIOException(java.lang.Exception under)
Constructs an EnhancedIOException with the specified causal Exception.


EnhancedIOException

public EnhancedIOException(java.lang.String s,
                           java.lang.Exception under)
Constructs an EnhancedIOException with the specified detail message and causal Exception.


EnhancedIOException

public EnhancedIOException(java.lang.String s,
                           java.lang.Exception under,
                           java.lang.String code,
                           java.lang.Object o,
                           java.lang.String method)
Constructs an EnhancedIOException with a detail message, causal Exception, error code, class and method of origin. For example,
...
throw new EnhancedIOException("Failed to connect to server", excp, "SVR_0090", this, "connect");
...


EnhancedIOException

public EnhancedIOException(java.lang.String code,
                           java.lang.Object o,
                           java.lang.String method)
Constructs an EnhancedIOException with an error code and, class and method of origin. For example,
...
throw new EnhancedIOException("SVR_0090", this, "connect");
...


EnhancedIOException

public EnhancedIOException(java.lang.String s,
                           java.lang.String code,
                           java.lang.Object o,
                           java.lang.String method)
Constructs an EnhancedIOException with a detail message, error code, class and method of origin. For example,
...
throw new EnhancedIOException("Failed to connect to server", "SVR_0090", this, "connect");
...

Method Detail

getCausalException

public java.lang.Exception getCausalException()
Description copied from interface: IEnhancedException
Returns the underlying Exception (if any) for this instance.

Specified by:
getCausalException in interface IEnhancedException

getOriginClass

public java.lang.String getOriginClass()
Description copied from interface: IEnhancedException
Returns the fully-qualified name of the class which constructed this instance.

Specified by:
getOriginClass in interface IEnhancedException

getOriginMethod

public java.lang.String getOriginMethod()
Description copied from interface: IEnhancedException
Returns the name of the method in which this instance was constructed.

Specified by:
getOriginMethod in interface IEnhancedException

getCode

public java.lang.String getCode()
Description copied from interface: IEnhancedException
Returns the application-specific error code associated with this instance.

Specified by:
getCode in interface IEnhancedException

setDataObject

public void setDataObject(java.lang.Object o)
                   throws java.lang.UnsupportedOperationException
Sets the data Object which will be passed up the call stack.


getDataObject

public java.lang.Object getDataObject()
Description copied from interface: IEnhancedException
Returns the data object (if any) set by the originator.

Specified by:
getDataObject in interface IEnhancedException

removeDataObject

public void removeDataObject()
Description copied from interface: IEnhancedException
Removes the data object (if any) contained in this instance.

Specified by:
removeDataObject in interface IEnhancedException

setCode

public void setCode(java.lang.String c)
             throws java.lang.UnsupportedOperationException
Sets the error-code which identifies the particular error condition that triggered this exception.


setOriginClass

public void setOriginClass(java.lang.Object o)
                    throws java.lang.UnsupportedOperationException
Sets the class of origin for this instance. The class of origin is taken as the value returned by o.getClass().getName(). However, if the parameter is itself an instance of Class, then the class of origin is taken as o.getName().


setOriginMethod

public void setOriginMethod(java.lang.String meth)
                     throws java.lang.UnsupportedOperationException
Sets the method of origin for this instance.


setCausalException

public void setCausalException(java.lang.Exception e)
                        throws java.lang.UnsupportedOperationException
Sets the underlying (causal) Exception for this instance.


toString

public java.lang.String toString()
Returns a short description of this instance. If this instance does not contain the error code or the origin info, the returned String is same as would be returned by IOException.toString(). Otherwise, the returned String is formed by concatenating the following :-
  • The name of the actual class of this object
  • ": " (a colon and a space)
  • The result of the Throwable.getMessage()>Throwable.getMessage() 55 method for this object
  • " : Code="
  • The error-code
  • " : OriginClass="
  • The class of origin
  • " : OriginMethod="
  • The method of origin
  • " : CausalException="
  • The name of the class of the causal Exception (if any)


internalSetCausalException

protected void internalSetCausalException(java.lang.Exception e)
Sets the underlying (causal) Exception for this instance. Allows subclasses to have unrestricted access to "causal exception" field.


internalSetOriginMethod

protected void internalSetOriginMethod(java.lang.String meth)
Sets the method of origin for this instance. Allows subclasses to have unrestricted access to "method of origin" field.


internalSetOriginClass

protected void internalSetOriginClass(java.lang.Object o)
Sets the class of origin for this instance. The class of origin is taken as the value returned by o.getClass().getName(). However, if the parameter is itself an instance of Class, then the class of origin is taken as o.getName(). Allows subclasses to have unrestricted access to "class of origin" field.


internalSetCode

protected void internalSetCode(java.lang.String c)
Sets the error-code which identifies the particular error condition that triggered this exception. Allows subclasses to have unrestricted access to "error code" field.


internalSetDataObject

protected void internalSetDataObject(java.lang.Object o)
Sets the data Object which will be passed up the call stack. Allows subclasses to have unrestricted access to "data Object" field.