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

## oracle.ifs.common
Class IfsException

    java.lang.Object

      |

      +--java.lang.Throwable

            |

            +--java.lang.Exception

                  |

                  +--oracle.ifs.common.IfsException

All Implemented Interfaces:
  java.io.Serializable

public class IfsException
extends java.lang.Exception

A IfsException represents an iFS error condition.

Each IfsException has an integer error code that specifies the type of error encountered.

A IfsException may also have an array of object parameters that can be substituted into a string (obtained from the iFS resource bundle) using `java.text.MessageFormat` to produce a more descriptive, localized error message.

An exception often leads to another higher-level exception, which in turn may result in even-higher level exceptions. Although only the top-level exception is presented to the application by the iFS API, IfsException keeps track of the underlying, or "nested", exceptions. For any IfsException, the immediately underlying exception can be obtained by invoking `getNestedException`.

See Also:
  Serialized Form

Constructor Summary
`IfsException(int errorCode)` Constructs a IfsException.
`IfsException(int errorCode, java.lang.Exception nestedException)` Constructs a IfsException.
`IfsException(int errorCode, java.lang.Object[] parameters)` Constructs a IfsException.
`IfsException(int errorCode, java.lang.Object[] parameters, java.lang.Exception nestedException)` Constructs a IfsException.

Method Summary
`boolean` | `containsErrorCode(int errorCode)` Returns true if this IfsException or any nested IfsExceptions have the specified error code.
`int` | `getErrorCode()` Gets the error code of this IfsException.
`java.lang.String` | `getLocalizedMessage()` Gets the description of this IfsException for the default locale of the Java VM.
`java.lang.String` | `getLocalizedMessage(LibrarySessionInterface session)` Gets the description of this IfsException for the Localizer associated with the specified LibrarySession.
`java.lang.String` | `getLocalizedMessage(Localizer localizer)` Gets the description of this exception for the locale of the specified Localizer.
`java.lang.String` | `getMessage()` Gets the US English description of this IfsException.
`java.lang.Exception` | `getNestedException()` Gets the exception that led to this IfsException.
`IfsException` | `getNestedIfsException(int errorCode)` Gets a nested IfsException that matches the specified error code.
`java.lang.Object[]` | `getParameters()` Gets the parameter values for the error message.
`static boolean` | `isVerboseMessage()` Gets whether `toString` and `toLocalizedString` produces verbose messages.
`void` | `printStackTrace()` Prints the stack trace of this IfsException to the standard error stream.
`void` | `printStackTrace(java.io.PrintStream stream)` Prints the stack trace of this IfsException to the specified PrintStream.
`void` | `printStackTrace(java.io.PrintWriter writer)` Prints the stack trace of this IfsException to the specified PrintWriter.
`static void` | `setVerboseMessage(boolean verbose)` Specifies whether `toString` and `toLocalizedString` produces verbose messages.
`java.lang.String` | `toLocalizedString(LibrarySessionInterface session)` Represents this IfsException as a localized string.
`java.lang.String` | `toLocalizedString(Localizer localizer)` Represents this IfsException as a localized string.
`java.lang.String` | `toString()` Represents this IfsException as a US English string.

Constructor Detail

### IfsException

    public IfsException(int errorCode,
                        java.lang.Object[] parameters,
                        java.lang.Exception nestedException)

  Constructs a IfsException.
  Parameters:
    `errorCode` - the error code
    `parameters` - an array of Objects to be substituted into the resource bundle message using using `java.text.MessageFormat` to produce a localized error message
    `nestedException` - the exception that led to this exception

### IfsException

    public IfsException(int errorCode,
                        java.lang.Exception nestedException)

  Constructs a IfsException.

  This constructor variant is used when the error message for the specified error code has no parameters.

  Parameters:
    `errorCode` - the error code
    `nestedException` - the exception that led to this exception

### IfsException

    public IfsException(int errorCode,
                        java.lang.Object[] parameters)

  Constructs a IfsException.

  This constructor variant is used then the exception has no nested exception.

  Parameters:
    `errorCode` - the error code
    `parameters` - an array of Objects to be substituted into the resource bundle message using using `java.text.MessageFormat` to produce a localized error message

### IfsException

    public IfsException(int errorCode)

  Constructs a IfsException.

  This constructor variant is used then the exception has no nested exception and the error message for the specified error code has no parameters.

  Parameters:
    `errorCode` - the error code

Method Detail

### getErrorCode

    public final int getErrorCode()

  Gets the error code of this IfsException.
  Returns:
    the error code

### containsErrorCode

    public final boolean containsErrorCode(int errorCode)

  Returns true if this IfsException or any nested IfsExceptions have the specified error code.
  Returns:
    true if this IfsException or any nested IfsExceptions have the specified error code.

### getParameters

    public final java.lang.Object[] getParameters()

  Gets the parameter values for the error message.
  Returns:
    an array of parameter values

### getNestedException

    public final java.lang.Exception getNestedException()

  Gets the exception that led to this IfsException.
  Returns:
    the nested exception, or null if this is the originating exception

### getNestedIfsException

    public final IfsException getNestedIfsException(int errorCode)

  Gets a nested IfsException that matches the specified error code.
  Parameters:
    `errorCode` - the specified error code
  Returns:
    the nested exception, or null if specified error code is not nested below this exception.

### printStackTrace

    public void printStackTrace()

  Prints the stack trace of this IfsException to the standard error stream.
  Overrides:
    `printStackTrace` in class `java.lang.Throwable`

### printStackTrace

    public void printStackTrace(java.io.PrintStream stream)

  Prints the stack trace of this IfsException to the specified PrintStream.
  Overrides:
    `printStackTrace` in class `java.lang.Throwable`
  Parameters:
    `stream` - the PrintStream

### printStackTrace

    public void printStackTrace(java.io.PrintWriter writer)

  Prints the stack trace of this IfsException to the specified PrintWriter.
  Overrides:
    `printStackTrace` in class `java.lang.Throwable`
  Parameters:
    `writer` - the PrintWriter

### getMessage

    public java.lang.String getMessage()

  Gets the US English description of this IfsException.
  Overrides:
    `getMessage` in class `java.lang.Throwable`
  Returns:
    the error message

### getLocalizedMessage

    public java.lang.String getLocalizedMessage()

  Gets the description of this IfsException for the default locale of the Java VM.

  The default locale of the Java virtual machine is determined by invoking the `java.util.Locale.getDefault` method.

  Overrides:
    `getLocalizedMessage` in class `java.lang.Throwable`
  Returns:
    the error message

### getLocalizedMessage

    public java.lang.String getLocalizedMessage(LibrarySessionInterface session)

  Gets the description of this IfsException for the Localizer associated with the specified LibrarySession.
  Parameters:
    `session` - a LibrarySession instance, used to determine the Localizer, that is in turn used to determine the locale used to construct the error message.
  Returns:
    the error message

### getLocalizedMessage

    public java.lang.String getLocalizedMessage(Localizer localizer)

  Gets the description of this exception for the locale of the specified Localizer.
  Parameters:
    `localizer` - the Localizer that determines the locale used to construct the error message
  Returns:
    the error message

### toString

    public java.lang.String toString()

  Represents this IfsException as a US English string.
  Overrides:
    `toString` in class `java.lang.Throwable`
  Returns:
    a string representation of this IfsException

### toLocalizedString

    public java.lang.String toLocalizedString(LibrarySessionInterface session)

  Represents this IfsException as a localized string.
  Parameters:
    `session` - a LibrarySession instance, used to determine the Localizer, that is in turn used to determine the locale used to construct the string representation
  Returns:
    a string representation of this IfsException

### toLocalizedString

    public java.lang.String toLocalizedString(Localizer localizer)

  Represents this IfsException as a localized string.
  Parameters:
    `localizer` - the Localizer that determines the locale used to construct the string representation
  Returns:
    a string representation of this IfsException

### setVerboseMessage

    public static final void setVerboseMessage(boolean verbose)

  Specifies whether `toString` and `toLocalizedString` produces verbose messages.

  Verbose messages include the messages of nested exceptions.

  Concise messages are produced by default.

  Parameters:
    `verboseMessage` - whether the messages are verbose

### isVerboseMessage

    public static final boolean isVerboseMessage()

  Gets whether `toString` and `toLocalizedString` produces verbose messages.

  Verbose messages include the messages of nested exceptions.

  Concise messages are produced by default.

  Returns:
    whether the messages are verbose

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