Oracle Content Management SDK

oracle.ifs.common
Class IfsException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--oracle.ifs.common.IfsException
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class IfsException
extends java.lang.Exception
implements java.lang.Cloneable

An IfsException represents an iFS error condition.

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

An 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, an IfsException keeps track of the underlying, or "nested", exceptions (or more precisely, the nested java.lang.Throwables). For any IfsException, the immediately underlying Throwable can be obtained by calling the method getNestedThrowable.

See Also:
Serialized Form

Constructor Summary
IfsException(int errorCode)
          Constructs an IfsException.
IfsException(int errorCode, java.lang.Object[] parameters)
          Constructs an IfsException.
IfsException(int errorCode, java.lang.Object[] parameters, java.lang.Throwable nestedThrowable)
          Constructs an IfsException.
IfsException(int errorCode, java.lang.Throwable nestedThrowable)
          Constructs an IfsException.
 
Method Summary
 boolean containsErrorCode(int errorCode)
          Gets whether 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 locale of the specified session's Localizer.
 java.lang.String getLocalizedMessage(Localizer localizer)
          Gets the description of this IfsException for the locale of the specified Localizer.
 java.lang.String getMessage()
          Gets the US English description of this IfsException.
 IfsException getNestedIfsException(int errorCode)
          Gets a nested IfsException that matches the specified error code.
 java.lang.Throwable getNestedThrowable()
          Gets the Throwable that led to this IfsException.
 java.lang.Object[] getParameters()
          Gets the parameter values for the error message.
static boolean isVerboseMessage()
          Gets whether toString and toLocalizedString produces verbose messages.
 void printLocalizedStackTrace()
          Prints the stack trace of this IfsException to the standard error stream, using the default locale of the Java VM.
 void printLocalizedStackTrace(LibrarySessionInterface session)
          Prints the stack trace of this IfsException to the standard error stream, using the locale of the specified session's Localizer.
 void printLocalizedStackTrace(Localizer localizer)
          Prints the stack trace of this IfsException to the standard error stream, using the locale of the specified Localizer.
 void printLocalizedStackTrace(java.io.PrintStream stream)
          Prints the stack trace of this IfsException to the specified PrintStream, using the default locale of the Java VM.
 void printLocalizedStackTrace(java.io.PrintStream stream, LibrarySessionInterface session)
          Prints the stack trace of this IfsException to the specified PrintStream, using the locale of the specified session's Localizer.
 void printLocalizedStackTrace(java.io.PrintStream stream, Localizer localizer)
          Prints the stack trace of this IfsException to the specified PrintStream, using the locale of the specified Localizer.
 void printLocalizedStackTrace(java.io.PrintWriter writer)
          Prints the stack trace of this IfsException to the specified PrintWriter, using the default locale of the Java VM.
 void printLocalizedStackTrace(java.io.PrintWriter writer, LibrarySessionInterface session)
          Prints the stack trace of this IfsException to the specified PrintWriter, using the locale of the specified session's Localizer.
 void printLocalizedStackTrace(java.io.PrintWriter writer, Localizer localizer)
          Prints the stack trace of this IfsException to the specified PrintWriter, using the locale of the specified Localizer.
 void printStackTrace()
          Prints the stack trace of this IfsException to the standard error stream, using US English.
 void printStackTrace(java.io.PrintStream stream)
          Prints the stack trace of this IfsException to the specified PrintStream, using US English.
 void printStackTrace(java.io.PrintWriter writer)
          Prints the stack trace of this IfsException to the specified PrintWriter, using US English.
static void setVerboseMessage(boolean verbose)
          Specifies whether toString and toLocalizedString produces verbose messages.
 java.lang.String toLocalizedString()
          Represents this IfsException as a localized string, using the default locale of the Java VM.
 java.lang.String toLocalizedString(LibrarySessionInterface session)
          Represents this IfsException as a localized string, using the locale of the specified session's Localizer.
 java.lang.String toLocalizedString(Localizer localizer)
          Represents this IfsException as a localized string, using the locale of the specified Localizer.
 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.Throwable nestedThrowable)
Constructs an 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
nestedThrowable - the Throwable that led to this IfsException

IfsException

public IfsException(int errorCode,
                    java.lang.Throwable nestedThrowable)
Constructs an IfsException.

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

Parameters:
errorCode - the error code
nestedThrowable - the Throwable that led to this IfsException

IfsException

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

This constructor variant is used then the IfsException has no nested Throwable.

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 an IfsException.

This constructor variant is used then the IfsException has no nested Throwable 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

getParameters

public final java.lang.Object[] getParameters()
Gets the parameter values for the error message.
Returns:
an array of parameter values

getNestedThrowable

public final java.lang.Throwable getNestedThrowable()
Gets the Throwable that led to this IfsException.
Returns:
the nested Throwable, 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 IfsException, or null if the specified error code is not nested below this IfsException

containsErrorCode

public final boolean containsErrorCode(int errorCode)
Gets whether this IfsException or any nested IfsExceptions have the specified error code.
Parameters:
errorCode - the error code of interest
Returns:
whether this IfsException or any nested IfsExceptions have the specified error code

printStackTrace

public void printStackTrace()
Prints the stack trace of this IfsException to the standard error stream, using US English.
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, using US English.
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, using US English.
Overrides:
printStackTrace in class java.lang.Throwable
Parameters:
writer - the PrintWriter

printLocalizedStackTrace

public void printLocalizedStackTrace()
Prints the stack trace of this IfsException to the standard error stream, using 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.

printLocalizedStackTrace

public void printLocalizedStackTrace(java.io.PrintStream stream)
Prints the stack trace of this IfsException to the specified PrintStream, using 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.

Parameters:
stream - the PrintStream

printLocalizedStackTrace

public void printLocalizedStackTrace(java.io.PrintWriter writer)
Prints the stack trace of this IfsException to the specified PrintWriter, using 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.

Parameters:
writer - the PrintWriter

printLocalizedStackTrace

public void printLocalizedStackTrace(LibrarySessionInterface session)
Prints the stack trace of this IfsException to the standard error stream, using the locale of the specified session's Localizer.
Parameters:
session - the session

printLocalizedStackTrace

public void printLocalizedStackTrace(java.io.PrintStream stream,
                                     LibrarySessionInterface session)
Prints the stack trace of this IfsException to the specified PrintStream, using the locale of the specified session's Localizer.
Parameters:
stream - the PrintStream
session - the session

printLocalizedStackTrace

public void printLocalizedStackTrace(java.io.PrintWriter writer,
                                     LibrarySessionInterface session)
Prints the stack trace of this IfsException to the specified PrintWriter, using the locale of the specified session's Localizer.
Parameters:
writer - the PrintWriter
session - the session

printLocalizedStackTrace

public void printLocalizedStackTrace(Localizer localizer)
Prints the stack trace of this IfsException to the standard error stream, using the locale of the specified Localizer.
Parameters:
localizer - the Localizer

printLocalizedStackTrace

public void printLocalizedStackTrace(java.io.PrintStream stream,
                                     Localizer localizer)
Prints the stack trace of this IfsException to the specified PrintStream, using the locale of the specified Localizer.
Parameters:
stream - the PrintStream
localizer - the Localizer

printLocalizedStackTrace

public void printLocalizedStackTrace(java.io.PrintWriter writer,
                                     Localizer localizer)
Prints the stack trace of this IfsException to the specified PrintWriter, using the locale of the specified Localizer.
Parameters:
writer - the PrintWriter
localizer - the Localizer

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 locale of the specified session's Localizer.
Parameters:
session - the session
Returns:
the error message

getLocalizedMessage

public java.lang.String getLocalizedMessage(Localizer localizer)
Gets the description of this IfsException for the locale of the specified Localizer.
Parameters:
localizer - the Localizer
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()
Represents this IfsException as a localized string, using 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.

Returns:
a string representation of this IfsException

toLocalizedString

public java.lang.String toLocalizedString(LibrarySessionInterface session)
Represents this IfsException as a localized string, using the locale of the specified session's Localizer.
Parameters:
session - the session
Returns:
a string representation of this IfsException

toLocalizedString

public java.lang.String toLocalizedString(Localizer localizer)
Represents this IfsException as a localized string, using the locale of the specified Localizer.
Parameters:
localizer - the Localizer
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 Throwables.

Verbose 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 Throwables.

Verbose messages are produced by default.

Returns:
whether the messages are verbose

Oracle Content Management SDK

(c) 2002 Copyright Oracle Corporation. All rights reserved.