com.metamatrix.api.exception
Class MetaMatrixException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.metamatrix.core.MetaMatrixCoreException
              extended by com.metamatrix.api.exception.MetaMatrixException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ConfigObjectsNotResolvableException, CryptoException, DBIDGeneratorException, DbWriterException, ExternalException, InvalidConfigurationElementException, InvalidRequestException, LogConfigurationException, ManagedConnectionException, MessagingException, MetaMatrixComponentException, MetaMatrixProcessingException, ModificationException, MultiplicityExpressionException, SourceWarning, StartupStateException, TransactionException, TransformationException, TreeNodeException, UnsupportedCallbackException, XMLTranslationException

public class MetaMatrixException
extends MetaMatrixCoreException

A generic exception which contains a reference to another exception. This class can be used to maintain a linked list of exceptions.

Subclasses of this exception typically only need to implement whatever constructors they need.

This class assumes all messages internationalization has been resolved before the constructor is called. There will be no automatic lookup performed by this class.

See Also:
Serialized Form

Constructor Summary
MetaMatrixException()
          No-arg Constructor
MetaMatrixException(java.lang.String message)
          Construct an instance with the specified error message.
MetaMatrixException(java.lang.String code, java.lang.String message)
          Construct an instance with the specified error code and message.
MetaMatrixException(java.lang.Throwable e)
          Construct an instance with a linked exception specified.
MetaMatrixException(java.lang.Throwable e, java.lang.String message)
          Construct an instance with the linked exception and error message specified.
MetaMatrixException(java.lang.Throwable e, java.lang.String code, java.lang.String message)
          Construct an instance with the linked exception, error code, and error message specified.
 
Method Summary
 java.lang.Throwable getChild()
          Get the exception which is linked to this exception.
 java.lang.String getCode()
          Get the error code.
 java.lang.String getFullMessage()
          Get the full error message, including any message(s) from child exceptions.
 java.lang.String getMessage()
           
 void readExternal(java.io.ObjectInput in)
           
 void setCode(java.lang.String code)
          Set the error code.
 java.lang.String toString()
          Returns a string representation of this class.
 void writeExternal(java.io.ObjectOutput out)
           
 
Methods inherited from class com.metamatrix.core.MetaMatrixCoreException
getCause, initCause
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getStackTrace, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MetaMatrixException

public MetaMatrixException()
No-arg Constructor


MetaMatrixException

public MetaMatrixException(java.lang.String message)
Construct an instance with the specified error message.

Parameters:
message - The error message

MetaMatrixException

public MetaMatrixException(java.lang.String code,
                           java.lang.String message)
Construct an instance with the specified error code and message.

Parameters:
code - The error code
message - The error message

MetaMatrixException

public MetaMatrixException(java.lang.Throwable e)
Construct an instance with a linked exception specified. If the exception is a MetaMatrixException or a MetaMatrixRuntimeException, then the code will be set to the exception's code.

Parameters:
e - An exception to chain to this exception

MetaMatrixException

public MetaMatrixException(java.lang.Throwable e,
                           java.lang.String message)
Construct an instance with the linked exception and error message specified. If the exception is a MetaMatrixException or a MetaMatrixRuntimeException, then the code will be set to the exception's code.

Parameters:
e - The exception to chain to this exception
message - The error message

MetaMatrixException

public MetaMatrixException(java.lang.Throwable e,
                           java.lang.String code,
                           java.lang.String message)
Construct an instance with the linked exception, error code, and error message specified. If the exception is a MetaMatrixException or a MetaMatrixRuntimeException, then the code will be set to the exception's code.

Parameters:
e - The exception to chain to this exception
code - The error code
message - The error message
Method Detail

getChild

public java.lang.Throwable getChild()
Get the exception which is linked to this exception.

Returns:
The linked exception

getCode

public java.lang.String getCode()
Get the error code.

Returns:
The error code

getFullMessage

public java.lang.String getFullMessage()
Get the full error message, including any message(s) from child exceptions. Messages of any exceptions chained to this exception are prepended with their "level" in the chain.

Returns:
The full error message
See Also:
getFormattedMessage(java.lang.Throwable, int)

getMessage

public java.lang.String getMessage()
Overrides:
getMessage in class java.lang.Throwable

setCode

public void setCode(java.lang.String code)
Set the error code.

Parameters:
code - The error code

toString

public java.lang.String toString()
Returns a string representation of this class.

Overrides:
toString in class java.lang.Throwable
Returns:
String representation of instance

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Throws:
java.io.IOException
java.lang.ClassNotFoundException
See Also:
Externalizable.readExternal(java.io.ObjectInput)

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Throws:
java.io.IOException
See Also:
Externalizable.writeExternal(java.io.ObjectOutput)


Copyright © 2009. All Rights Reserved.