Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.fujitsu.iflow.model.util
Class ModelException

    java.lang.Object
      java.lang.Throwable
          java.lang.Exception
              com.fujitsu.iflow.model.util.ModelException

All Implemented Interfaces:
  java.io.Serializable

Direct Known Subclasses:
  DirException, DMSException, ModelInternalException, WFInternalException, WFServerException

public class ModelException
extends java.lang.Exception

This exception indicates that some errors has occurred inside the Model API.

Catch only exceptions of `ModelException` for future compatibility, even if currently only exceptions of subclasses are thrown.

See Also:
  `DirException`, `DMSException`, `ModelInternalException`, `WFInternalException`, `WFServerException`, Serialized Form

Field Summary
`java.lang.String[]` | `params`

Constructor Summary
`ModelException(int code)` Constructs a ModelException with only an error code.
`ModelException(int code, java.lang.Throwable exp)` Constructs a ModelException with the specified error code and detail exception object.
`ModelException(long code, java.lang.String errorString)` Constructs a ModelException with the specified long error code and a String value.
`ModelException(java.lang.Throwable exp)` Constructs a ModelException with the specified detail exception object.
`ModelException(java.lang.Throwable exp, long code, java.lang.String errorString)` Constructs a ModelException with the specified long error code and a String value.

Method Summary
`java.lang.Throwable` | `getCause()` Returns the reference to the 'causing' exception.
`int` | `getErrorCode()` Returns the error code of this exception.
`java.lang.String` | `getExceptionType()` Deprecated. Use the standard Java 'instanceOf' instead.
`java.lang.String` | `getMessage()` Returns the text form of the message, substituting in the data parameter values into the appropriate places in the message template.
`java.lang.String` | `getParam(int index)` Returns the parameter value specified.
`java.lang.String[]` | `getParams()` Returns all the parameter values.
`java.lang.Throwable` | `getSource()` Returns the reference to the 'causing' exception.
`java.lang.String` | `getTemplate()` The 'Template' is the message, before the parameters have been substituted into it.
`java.lang.String` | `printException(java.lang.String exceptionName)` Prints the exceptions in some specified format.
`void` | `printStackTrace(java.io.PrintStream s)` This prints the stack trace of the 'causing' exception, if there is one.
`void` | `setExceptionType(java.lang.String exceptionType)` Deprecated. Standard Java 'instanceOf' command should be used instead.
`void` | `setParam(int index, int data)` Sets the message parameter that is indicated by 'index' to be the value of the long `data`.
`void` | `setParam(int index, long data)` Sets the message parameter that is indicated by 'index' to be the value of the long 'data'.
`void` | `setParam(int index, java.lang.String data)` Sets the message parameter that is indicated by 'index' to be the value of the string 'data'.
`java.lang.String` | `toString()` Returns the exception message.

Methods inherited from class java.lang.Throwable
`fillInStackTrace, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, setStackTrace`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### params

    public java.lang.String[] params

Constructor Detail

### ModelException

    public ModelException(int code)

  Constructs a ModelException with only an error code.

### ModelException

    public ModelException(int code,
                          java.lang.Throwable exp)

  Constructs a ModelException with the specified error code and detail exception object.

Parameters:
  `code` - The errorCode of the message.
  `exp` - More details in the form of an exception object, usually the exception that was 'caught' and this ModelException is wrapping.

### ModelException

    public ModelException(java.lang.Throwable exp)

  Constructs a ModelException with the specified detail exception object.

Parameters:
  `exp` - More details in the form of an exception object, usually the exception that was 'caught' and this ModelException is wrapping.

### ModelException

    public ModelException(java.lang.Throwable exp,
                          long code,
                          java.lang.String errorString)

  Constructs a ModelException with the specified long error code and a String value. This is a legacy method from the times when a ModelException was just a container for a String along with an error code. This method should be removed once all the calls to it can be cleaned up. Current implementation stored this 'detail message' in the 0th parameter.

Parameters:
  `exp` - More details in the form of an exception object, usually the exception that was 'caught' and this ModelException is wrapping.
  `code` - The errorCode of the message.
  `errorString` - The 0th parameter data value.

### ModelException

    public ModelException(long code,
                          java.lang.String errorString)

  Constructs a ModelException with the specified long error code and a String value. This is a legacy method from the times when a ModelException was just a container for a string along with an error code. This method should be removed once all the calls to it can be cleaned up. Current implementation stored this 'detail message' in the 0th parameter.

Parameters:
  `code` - The errorCode of the message.

Method Detail

### getErrorCode

    public int getErrorCode()

  Returns the error code of this exception.

  Returns:
    The error code

### getCause

    public java.lang.Throwable getCause()

  Returns the reference to the 'causing' exception. Returns `null` if there is no causing exception. The causing exception is the exception that is wrapped by this exception.

  Returns:
    The Causing exception.

### setParam

    public void setParam(int index,
                         java.lang.String data)

  Sets the message parameter that is indicated by 'index' to be the value of the string 'data'.

  Parameters:
    `index` - The number of the message parameter to set. This value can be any positive integer, but remember that large values will cause the string array to be large, so typically this will be from 0 to 5 or 6.
    `data` - The `String` data that will be substituted into the message.

### setParam

    public void setParam(int index,
                         long data)

  Sets the message parameter that is indicated by 'index' to be the value of the long 'data'.

  Parameters:
    `index` - The number of the message parameter to set. This value can be any positive integer, but remember that large values will cause the string array to be large, so typically this will be from 0 to 5 or 6.
    `data` - The long data that will be substituted into the message.

### setParam

    public void setParam(int index,
                         int data)

  Sets the message parameter that is indicated by 'index' to be the value of the long `data`.

  Parameters:
    `index` - The number of the message parameter to set. This value can be any positive integer, but remember that large values will cause the string array to be large, so typically this will be from 0 to 5 or 6.
    `data` - The int data that will be substituted into the message.

### getParam

    public java.lang.String getParam(int index)

  Returns the parameter value specified.

  Returns `null` if no param is available for the supplied index.

  Parameters:
    `index` - The number of the value to be returned.
  Returns:
    The specified value.

### getTemplate

    public java.lang.String getTemplate()

  The 'Template' is the message, before the parameters have been substituted into it. Different subclasses may provide different ways to get the process definition, and then this base class will substitute in the parameters and the causing exception, if any. Override this method in a subclass if your error message is not in the ErrorMessage bundle.

  Returns:
    The message of current error code

### getMessage

    public java.lang.String getMessage()

  Returns the text form of the message, substituting in the data parameter values into the appropriate places in the message template.

  Returns:
    Text message.

### getSource

    public java.lang.Throwable getSource()

  Returns the reference to the 'causing' exception. Returns null if there is no causing exception. The causing exception is the exception that is wrapped by this exception.

  Returns:
    Causing exception.

### getExceptionType

    public java.lang.String getExceptionType()

  Deprecated. Use the standard Java 'instanceOf' instead.

### setExceptionType

    public void setExceptionType(java.lang.String exceptionType)

  Deprecated. Standard Java 'instanceOf' command should be used instead.

### printException

    public java.lang.String printException(java.lang.String exceptionName)

  Prints the exceptions in some specified format.

  Parameters:
    `exceptionName` - Name of the exception.
  Returns:
    The formatted exception.

### toString

    public java.lang.String toString()

  Returns the exception message.

  Returns:
    Returns the exception message.

### printStackTrace

    public void printStackTrace(java.io.PrintStream s)

  This prints the stack trace of the 'causing' exception, if there is one. If not, then it prints the stack trace of this exception.

  If the supplied PrintStream is `null`, calling this method will have no effect.

  Parameters:
    `s` - The stream to print out.

### getParams

    public java.lang.String[] getParams()

  Returns all the parameter values.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD