IBM Rational Software Modeler
Release 6.0

com.ibm.xtools.transform.core
Class TransformException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byjava.lang.RuntimeException
              extended bycom.ibm.xtools.transform.core.TransformException
All Implemented Interfaces:
Serializable

public class TransformException
extends RuntimeException

Capture an exception thrown during the execution of a transformation.

This exception class wraps an exception that occurs during the execution of the default transformation engine. When the original exception occurs, the corresponding transform execute context is needed.

This exception saves the context and creates an appropriate IStatus object that can be used to report the error in the UI (ErrorDialog). When this exception is created, it is automatically logged.

See Also:
Serialized Form

Constructor Summary
TransformException(org.eclipse.core.runtime.IStatus status, Throwable cause, ITransformContext context)
          Constructs a new transformation exception with the specified status record, cause and execution context.
TransformException(String message, Throwable cause, ITransformContext context)
          Constructs a new transformation exception with the specified detail message, cause, and transformation context.
TransformException(Throwable cause, ITransformContext context)
          Constructs a new transformation exception with the specified cause and execution context.
 
Method Summary
 ITransformContext getContext()
          Returns the transformation context for the cause of this throwable or null if the context is nonexistent or unknown.
 org.eclipse.core.runtime.IStatus getStatus()
          Returns the status for this exception.
 
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
 

Constructor Detail

TransformException

public TransformException(Throwable cause,
                          ITransformContext context)
Constructs a new transformation exception with the specified cause and execution context. The detailed message is extracted from the cause if the cause is defined. The context should always be defined.

Parameters:
cause - The cause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
context - The transformation context in which the error occurred.

TransformException

public TransformException(String message,
                          Throwable cause,
                          ITransformContext context)
Constructs a new transformation exception with the specified detail message, cause, and transformation context.

Note that the detail message associated with cause is not automatically incorporated in this chained runtime exception's detail message.

Parameters:
message - The detail message (which is saved for later retrieval by the Throwable.getMessage() method).
cause - The cause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
context - The transformation context in which the error occurred.

TransformException

public TransformException(org.eclipse.core.runtime.IStatus status,
                          Throwable cause,
                          ITransformContext context)
Constructs a new transformation exception with the specified status record, cause and execution context. The detailed message is extracted from the status record and the resulting multi-status record returned from getStatus() includes the given status record as a child. The context should always be defined.

Parameters:
status - The status record for the problem cannot be null.
cause - The cause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
context - The transformation context in which the error occurred.
Method Detail

getContext

public ITransformContext getContext()
Returns the transformation context for the cause of this throwable or null if the context is nonexistent or unknown.

Returns:
The transformation context in which the error occurred.

getStatus

public org.eclipse.core.runtime.IStatus getStatus()
Returns the status for this exception. The returned status is a multi-status item that incorporates the descriptions from the contexts. This status is designed to be displayed in the UI.

Returns:
The transformation context in which the error occurred.

IBM Rational Software Modeler
Release 6.0


Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2004. All rights reserved.