|
Oracle ADF Model and Business Components API Reference 10.1.2 B14022-01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.jbo.common.JboExceptionHelper
The top-level class for Business Component exceptions.
This class provides tools for localizing exception messages for various target languages, and for message formatting.
Message-text localization occurs when
the client calls getLocalizedMessage()
, rather than at
time the exception occurs, because the client may need to present the message in
a number of different languages.
The components of a message are:
"FRM"
or "ORA"
."10234"
Additional components may be introduced in future.
A counterpart subclass of ResourceBundle
,
JboExceptionBundle
,
is used to determine the overall formatting of the message.
The default format is
productCode-errorCode: messageBodyFor example,
ORA-10234: I don't think so.
Most subclasses wll provide a value for the error code in a specialized constructor.
Applications may define subclasses of most JBO exceptions. To do this the application should override the following methods to provide the correct set of values for the messaging services:
getResourceName
getProductCode
JboExHelperLocalized
,
JboException
Constructor Summary | |
JboExceptionHelper(JboMessage ex,
java.lang.String msg,
java.lang.String errorCode,
java.lang.Object[] params)
Creates a translatable exception. |
Method Summary | |
void |
addToDetails(java.lang.Object obj)
Adds to the list of details. |
java.lang.String |
getBaseMessage()
Gets the message without localizing it or inserting parameters. |
java.lang.String |
getDetailMessage()
Constructs a message incorporating the list of details. |
java.lang.Object[] |
getDetails()
Gets the list of objects and exceptions that spawned this message. |
com.sun.java.util.collections.ArrayList |
getDetailsList()
|
java.lang.String |
getErrorCode()
Gets the error code. |
protected java.lang.String |
getErrorMsg(java.util.Locale l,
java.lang.Object[] params)
|
protected java.lang.String |
getErrorMsgFormat(java.util.Locale l)
Return the default format to print messages in. |
java.lang.Object[] |
getErrorParameters()
Gets the error message parameters. |
java.lang.String |
getLocalizedBaseMessage(java.util.Locale l)
Localizes an un-parameterized message text for a specific Locale . |
java.lang.String |
getLocalizedMessage(java.util.Locale l)
Formats the message text for a specific Locale . |
java.lang.String |
getMessage()
Formats the message text for the default locale. |
java.lang.String |
getProductCode()
Gets the product code. |
java.lang.Class |
getResourceClass()
Gets the resource bundle used to localize messages. |
java.lang.String |
getResourceName()
Gets the name of the ResourceBundle used to localize messages. |
boolean |
isAppendCodes()
Returns true if this exception has to prefix the error message with Product and Message Ids. |
void |
setAppendCodes(boolean flag)
Set false if this exception should not prefix the error message with Product and Message Ids. |
void |
setDetails(java.lang.Object[] details)
Sets the list of details. |
void |
setDetailsList(com.sun.java.util.collections.ArrayList details)
Sets the list of details. |
void |
setErrorParameters(java.lang.Object[] params)
Resets the error parameters. |
void |
setLocaleContext(LocaleContext locale)
Set the default locale for this exception to the given locale. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JboExceptionHelper(JboMessage ex, java.lang.String msg, java.lang.String errorCode, java.lang.Object[] params)
ex
- a Business Component error or warning.errorCode
- error code; a key associated with a message in a
resource bundle.params
- the error message's parameters.ResourceBundle
Method Detail |
public java.lang.String getMessage()
public java.lang.String getLocalizedMessage(java.util.Locale l)
Locale
.
l
- a locale.
public java.lang.String getBaseMessage()
public java.lang.String getLocalizedBaseMessage(java.util.Locale l)
Locale
.
l
- a locale.
public java.lang.String getResourceName()
ResourceBundle
used to localize messages.
null
.public java.lang.Class getResourceClass()
null
.public java.lang.Object[] getErrorParameters()
public void setErrorParameters(java.lang.Object[] params)
public java.lang.String getErrorCode()
public java.lang.String getProductCode()
protected java.lang.String getErrorMsg(java.util.Locale l, java.lang.Object[] params)
protected java.lang.String getErrorMsgFormat(java.util.Locale l)
In general, the Message format consists of 3 elements, these are:
getProductCode
getErrorCode
{0}-{1}: {2}
".
An example message in this form might look like:JBO-100: A Mandatory attribute is missing.
l
- the locale for the formatted message.
public java.lang.Object[] getDetails()
public java.lang.String getDetailMessage()
public void setDetails(java.lang.Object[] details)
details
- an array which replaces the current list of details.public void setDetailsList(com.sun.java.util.collections.ArrayList details)
details
- an array which replaces the current list of details.public com.sun.java.util.collections.ArrayList getDetailsList()
public void addToDetails(java.lang.Object obj)
obj
- an object to add to the details list.public boolean isAppendCodes()
public void setAppendCodes(boolean flag)
public void setLocaleContext(LocaleContext locale)
|
Oracle ADF Model and Business Components API Reference 10.1.2 B14022-01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2004, Oracle. All rights reserved.