|
Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client 11g Release 1 (11.1.1) E17503-02 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectoracle.jbo.common.PropertiesHelper
oracle.jbo.common.JboExceptionHelper
public class 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
Field Summary | |
---|---|
static int |
SEVERITY_ERROR
|
static int |
SEVERITY_RECOVERABLE_ERROR
|
static int |
SEVERITY_VETOABLE_WARNING
|
static int |
SEVERITY_WARNING
|
Fields inherited from class oracle.jbo.common.PropertiesHelper |
---|
mProperties |
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. |
List |
getDetailsList()
|
java.lang.String |
getErrorCode()
Gets the error code. |
protected java.lang.String |
getErrorMsg(Locale l,
java.lang.Object[] params)
|
protected java.lang.String |
getErrorMsgFormat(Locale l)
Return the default format to print messages in. |
protected java.lang.String |
getErrorMsgWithNamedTokens(Locale l,
java.util.Hashtable params)
|
java.lang.Object[] |
getErrorParameters()
Gets the error message parameters. |
Map |
getErrorParametersMap()
|
java.lang.String |
getLocalizedBaseMessage(Locale l)
Localizes an un-parameterized message text for a specific Locale . |
java.lang.String |
getLocalizedMessage(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.util.Hashtable |
getProperties()
Gets the table of properties. |
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. |
int |
getSeverity()
|
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(List details)
Sets the list of details. |
void |
setErrorParameters(java.lang.Object[] params)
Resets the error parameters. |
void |
setErrorParametersMap(Map params)
|
void |
setLocaleContext(LocaleContext locale)
Set the default locale for this exception to the given locale. |
void |
setSeverity(int severity)
|
Methods inherited from class oracle.jbo.common.PropertiesHelper |
---|
closeObject, getImageLoc, getProperty, getProperty, isReadOnly, refreshProperties, refreshProperty, setName, setProperty |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int SEVERITY_RECOVERABLE_ERROR
public static final int SEVERITY_ERROR
public static final int SEVERITY_WARNING
public static final int SEVERITY_VETOABLE_WARNING
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.msg
- the default text of the message.errorCode
- error code; a key associated with a message in a resource bundle.params
- the error message's parameters.java.util.ResourceBundle
Method Detail |
---|
public java.lang.String getMessage()
public java.lang.String getLocalizedMessage(Locale l)
Locale
.
l
- a locale.
public java.lang.String getBaseMessage()
public java.lang.String getLocalizedBaseMessage(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 Map getErrorParametersMap()
public void setErrorParameters(java.lang.Object[] params)
public void setErrorParametersMap(Map params)
public java.lang.String getErrorCode()
public java.lang.String getProductCode()
protected java.lang.String getErrorMsg(Locale l, java.lang.Object[] params)
protected java.lang.String getErrorMsgWithNamedTokens(Locale l, java.util.Hashtable params)
protected java.lang.String getErrorMsgFormat(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(List details)
details
- an array which replaces the current list of details.public List 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)
public java.util.Hashtable getProperties()
Properties
getProperties
in interface Properties
getProperties
in class PropertiesHelper
public int getSeverity()
public void setSeverity(int severity)
|
Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client 11g Release 1 (11.1.1) E17503-02 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |