|
Oracle Fusion Middleware Java API Reference for Oracle ADF Model 11g Release 1 (11.1.1.4.0) E10653-05 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Throwable java.lang.Exception java.lang.RuntimeException oracle.jbo.JboWarning
public class JboWarning
The facility for reporting non-fatal errors for the JBO package.
Translation of a message's text occurs at the time
the client calls getLocalizedMessage()
rather than at
creation time since the client may need to present the message in
one a number of different languages.
The components of a message are:
Most subclasses of JboWarning
will provide a
value for the error code in a specialized constructor.
Applications may define subclasses of most JBO warnings. To do this the application should override the following methods to provide the correct set of values for the messaging services:
Field Summary | |
---|---|
protected JboExceptionHelper |
mHelper
|
static int |
SEVERITY_ERROR
Implies that this exception is a fatal exception and the application needs to stop processing it's flow and go to an error page. |
static int |
SEVERITY_RAC_RECOVERABLE_ERROR
Implies that this exception may be recoverable such that retrying after obtaining a new connection may succeed. |
static int |
SEVERITY_RECOVERABLE_ERROR
Implies that there's been a validation error or a business logic error and the application may override the exception/error via a user confirmation or correction of data being submitted. |
static int |
SEVERITY_VETOABLE_WARNING
Implies that there's some level of acceptible impropriety in the data being submitted. |
static int |
SEVERITY_WARNING
Implies that there's some level of acceptible impropriety in the data being submitted. |
Constructor Summary | |
---|---|
JboWarning(java.lang.Class resBundleClass,
java.lang.String errorCode,
java.lang.Object[] params)
Creates a translatable warning. |
|
JboWarning(ResourceBundleDef resBundleDef,
java.lang.String errorCode,
java.lang.Object[] params)
Creates a translatable warning. |
|
JboWarning(java.lang.String message)
Creates a non-formattable warning. |
|
JboWarning(java.lang.String message,
java.lang.String errorCode,
java.lang.Object[] params)
Creates a formattable but non-localizable warning. |
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. |
java.lang.String |
getErrorCode()
Gets the error code. |
java.lang.Object[] |
getErrorParameters()
Gets the error message's parameters. |
java.util.Map |
getErrorParametersMap()
If named tokens are set on this exception object, return a copy of the named tokens and it's evaluated values. |
protected JboExceptionHelper |
getJboExceptionHelper()
Get the Helper object for this exception. |
java.lang.String |
getLocalizedBaseMessage(java.util.Locale l)
Localizes the message text for a specific Locale , but without
inserting parameters. |
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.util.Hashtable |
getProperties()
Gets the table of properties. |
java.lang.Object |
getProperty(java.lang.String hintName)
Retrieves the specified property, if it exists. |
java.lang.Object |
getProperty(java.lang.String hintName,
LocaleContext locale)
|
java.lang.Class |
getResourceClass()
Gets the class of the resource bundle used to localize messages. |
java.lang.String |
getResourceName()
Gets the name of the ResourceBundle used to localize messages. |
int |
getSeverity()
Gets the exception severity. |
static java.lang.String |
getTypeNameFromId(int id)
|
boolean |
isAppendCodes()
Returns true if this exception has to prefix the error message with Product and Message Ids. |
boolean |
isExceptionInNonUIContext()
This method returns true for warnings that must be treated as errors when the application is running in non-interactive context like webservices and batch programs. |
boolean |
isLocalizable()
Tests this message's localizability. |
boolean |
isWarning()
|
java.lang.Object |
refreshProperty(java.lang.String hintName)
Retrieves the specified property, if it exists. |
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. |
protected void |
setErrorParameters(java.lang.Object[] params)
Resets the error parameters. |
protected void |
setErrorParametersMap(java.util.Map params)
Resets the error parameters as a name-value pair. |
void |
setLocaleContext(LocaleContext locale)
Set the default locale for this exception to the given locale. |
void |
setProperty(java.lang.String hintName,
java.lang.Object hintValue)
Sets a value for the specified property.. |
void |
setSeverity(int severity)
Sets the exception severity. |
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected JboExceptionHelper mHelper
public static final int SEVERITY_ERROR
public static final int SEVERITY_RECOVERABLE_ERROR
public static final int SEVERITY_RAC_RECOVERABLE_ERROR
public static final int SEVERITY_VETOABLE_WARNING
public static final int SEVERITY_WARNING
Constructor Detail |
---|
public JboWarning(java.lang.String message, java.lang.String errorCode, java.lang.Object[] params)
If a localizable warning is desired, use the
JboWarning(Class, String, Object[])
constructor.
message
- the unformatted text of the message.errorCode
- an error code.params
- the error message's parameters.ResourceBundle
public JboWarning(java.lang.String message)
message
- the text of the message.public JboWarning(java.lang.Class resBundleClass, java.lang.String errorCode, java.lang.Object[] params)
resBundleClass
- the base class of the ResourceBundle
that will supply the message text.errorCode
- error code, a key associated with a message in the
resource bundle.params
- the error message's parameters.ResourceBundle
public JboWarning(ResourceBundleDef resBundleDef, java.lang.String errorCode, java.lang.Object[] params)
resBundleDef
- a ResourceBundleDef.errorCode
- error code, a key associated with a message in the
resource bundle.params
- the error message's parameters.ResourceBundle
Method Detail |
---|
public java.lang.String getMessage()
getMessage
in interface JboMessage
getMessage
in class java.lang.Throwable
public java.lang.String getLocalizedMessage(java.util.Locale l)
Locale
.
getLocalizedMessage
in interface JboMessage
l
- a locale.
public java.lang.String getBaseMessage()
getBaseMessage
in interface JboMessage
public java.lang.Class getResourceClass()
getResourceClass
in interface JboMessage
ResourceBundle
.public java.lang.String getLocalizedBaseMessage(java.util.Locale l)
Locale
, but without
inserting parameters.
getLocalizedBaseMessage
in interface JboMessage
l
- a locale.
public java.lang.String getResourceName()
ResourceBundle
used to localize messages.
getResourceName
in interface JboMessage
public java.lang.Object[] getErrorParameters()
getErrorParameters
in interface JboMessage
protected void setErrorParameters(java.lang.Object[] params)
public java.util.Map getErrorParametersMap()
protected void setErrorParametersMap(java.util.Map params)
public java.lang.String getErrorCode()
getErrorCode
in interface JboMessage
public java.lang.String getProductCode()
getProductCode
in interface JboMessage
JBO_PRODUCT_CODE
.public java.lang.Object[] getDetails()
getDetails
in interface JboMessage
public java.lang.String getDetailMessage()
getDetailMessage
in interface JboMessage
public void setDetails(java.lang.Object[] details)
setDetails
in interface JboMessage
details
- an array which replaces the current list-of-details
array in this warning object.public void addToDetails(java.lang.Object obj)
addToDetails
in interface JboMessage
obj
- an object to add to the details list.public boolean isLocalizable()
isLocalizable
in interface JboMessage
true
if this message can be localized.protected JboExceptionHelper getJboExceptionHelper()
JboExceptionHelper
public int getSeverity()
JboWarning.SEVERITY_ERROR
, JboWarning.SEVERITY_RECOVERABLE_ERROR
, JboWarning.SEVERITY_VETOABLE_WARNING
and JboWarning.SEVERITY_WARNING
.public void setSeverity(int severity)
severity
- an int value representing the exception severitypublic static java.lang.String getTypeNameFromId(int id)
public java.lang.Object getProperty(java.lang.String hintName)
Properties
getProperty
in interface Properties
hintName
- Property name.
null
.public java.lang.Object getProperty(java.lang.String hintName, LocaleContext locale)
getProperty
in interface Properties
public java.lang.Object refreshProperty(java.lang.String hintName)
Properties
getProperty
.
refreshProperty
in interface Properties
hintName
- Property name.
null
.public java.util.Hashtable getProperties()
Properties
getProperties
in interface Properties
public void setProperty(java.lang.String hintName, java.lang.Object hintValue)
hintName
- Property name.hintValue
- the value of the property.public void setLocaleContext(LocaleContext locale)
public boolean isAppendCodes()
public void setAppendCodes(boolean flag)
public boolean isWarning()
public boolean isExceptionInNonUIContext()
|
Oracle Fusion Middleware Java API Reference for Oracle ADF Model 11g Release 1 (11.1.1.4.0) E10653-05 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |