|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Throwable | +--java.lang.Exception | +--oracle.ifs.common.IfsException
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
.
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 |
public IfsException(int errorCode, java.lang.Object[] parameters, java.lang.Exception nestedException)
errorCode
- the error codeparameters
- an array of Objects to be substituted into
the resource bundle message using using
java.text.MessageFormat
to
produce a localized error messagenestedException
- the exception that led to this exceptionpublic IfsException(int errorCode, java.lang.Exception nestedException)
This constructor variant is used when the error message for the specified error code has no parameters.
errorCode
- the error codenestedException
- the exception that led to this exceptionpublic IfsException(int errorCode, java.lang.Object[] parameters)
This constructor variant is used then the exception has no nested exception.
errorCode
- the error codeparameters
- an array of Objects to be substituted into
the resource bundle message using using
java.text.MessageFormat
to
produce a localized error messagepublic IfsException(int errorCode)
This constructor variant is used then the exception has no nested exception and the error message for the specified error code has no parameters.
errorCode
- the error codeMethod Detail |
public final int getErrorCode()
public final boolean containsErrorCode(int errorCode)
public final java.lang.Object[] getParameters()
public final java.lang.Exception getNestedException()
public final IfsException getNestedIfsException(int errorCode)
errorCode
- the specified error codepublic void printStackTrace()
printStackTrace
in class java.lang.Throwable
public void printStackTrace(java.io.PrintStream stream)
printStackTrace
in class java.lang.Throwable
stream
- the PrintStreampublic void printStackTrace(java.io.PrintWriter writer)
printStackTrace
in class java.lang.Throwable
writer
- the PrintWriterpublic java.lang.String getMessage()
getMessage
in class java.lang.Throwable
public java.lang.String getLocalizedMessage()
The default locale of the Java virtual machine is determined by
invoking the java.util.Locale.getDefault
method.
getLocalizedMessage
in class java.lang.Throwable
public java.lang.String getLocalizedMessage(LibrarySessionInterface session)
session
- a LibrarySession instance, used to
determine the Localizer, that is in turn used to
determine the locale used to
construct the error message.public java.lang.String getLocalizedMessage(Localizer localizer)
localizer
- the Localizer that determines the locale used to
construct the error messagepublic java.lang.String toString()
toString
in class java.lang.Throwable
public java.lang.String toLocalizedString(LibrarySessionInterface session)
session
- a LibrarySession instance, used to
determine the Localizer, that is in turn used to
determine the locale used to
construct the string representationpublic java.lang.String toLocalizedString(Localizer localizer)
localizer
- the Localizer that determines the locale used to
construct the string representationpublic static final void setVerboseMessage(boolean verbose)
toString
and toLocalizedString
produces verbose messages.
Verbose messages include the messages of nested exceptions.
Concise messages are produced by default.
verboseMessage
- whether the messages are verbosepublic static final boolean isVerboseMessage()
toString
and toLocalizedString
produces verbose messages.
Verbose messages include the messages of nested exceptions.
Concise messages are produced by default.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |