Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 1 (11.1.1)

E10653-04

oracle.jbo
Class JboWarning

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by oracle.jbo.JboWarning
All Implemented Interfaces:
java.io.Serializable, JboMessage, MetaObjectBase, Properties
Direct Known Subclasses:
JboException, ServiceJboWarning

public class JboWarning
extends java.lang.RuntimeException
implements java.io.Serializable, MetaObjectBase, JboMessage, Properties

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:

Other methods may be overridden to modify the message format.

Since:
JDeveloper 3.0
See Also:
Serialized Form

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.
 
Fields inherited from interface oracle.jbo.common.MetaObjectBase
TYP_APP_MODULE, TYP_ATTRIBUTE, TYP_ATTRIBUTE_LIST_WITH_DEF, TYP_COMPONENT_OBJECT, TYP_DATA_CONTROL, TYP_DEF_ANY, TYP_DEF_APP_MODULE, TYP_DEF_ASSOC_END, TYP_DEF_ATTRIBUTE, TYP_DEF_COMPONENT_OBJECT, TYP_DEF_DOMAIN, TYP_DEF_ENTITY_ASSOC, TYP_DEF_ENTITY_OBJECT, TYP_DEF_KEY, TYP_DEF_LIST_BINDING, TYP_DEF_METHOD, TYP_DEF_PACKAGE, TYP_DEF_VIEW_ACCESSOR, TYP_DEF_VIEW_LINK, TYP_DEF_VIEW_LINK_END, TYP_DEF_VIEW_OBJECT, TYP_DOMAIN, TYP_ENTITY_ASSOC, TYP_ENTITY_OBJECT, TYP_ENTITY_ROW, TYP_ENTITY_ROW_SET, TYP_ENTITY_ROW_SET_ITERATOR, TYP_ENTITY_USAGE, TYP_PACKAGE, TYP_PERS_DEF_APP_MODULE, TYP_PERS_DEF_ATTRIBUTE, TYP_PERS_DEF_COMPONENT_OBJECT, TYP_PERS_DEF_DOMAIN, TYP_PERS_DEF_ENTITY_ASSOC, TYP_PERS_DEF_ENTITY_OBJECT, TYP_PERS_DEF_OFFSET, TYP_PERS_DEF_PACKAGE, TYP_PERS_DEF_VARIABLE, TYP_PERS_DEF_VIEW_LINK, TYP_PERS_DEF_VIEW_OBJECT, TYP_SORT_CRITERIA, TYP_TRANSACTION, TYP_VALIDATOR_TYPE, TYP_VARIABLE, TYP_VARIABLE_WHERE_CLAUSE, TYP_VIEW_CRITERIA, TYP_VIEW_LINK, TYP_VIEW_OBJECT, TYP_VIEW_ROW, TYP_VIEW_ROW_SET, TYP_VIEW_ROW_SET_ITERATOR
 
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 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

mHelper

protected JboExceptionHelper mHelper

SEVERITY_ERROR

public static final 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. This is the highest level of severity.

See Also:
Constant Field Values

SEVERITY_RECOVERABLE_ERROR

public static final 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.

See Also:
Constant Field Values

SEVERITY_RAC_RECOVERABLE_ERROR

public static final int SEVERITY_RAC_RECOVERABLE_ERROR
Implies that this exception may be recoverable such that retrying after obtaining a new connection may succeed.

See Also:
Constant Field Values

SEVERITY_VETOABLE_WARNING

public static final int SEVERITY_VETOABLE_WARNING
Implies that there's some level of acceptible impropriety in the data being submitted. The client needs to ask the user before proceeding further in the flow.

See Also:
Constant Field Values

SEVERITY_WARNING

public static final int SEVERITY_WARNING
Implies that there's some level of acceptible impropriety in the data being submitted. This is the lowest level of severity.

See Also:
Constant Field Values
Constructor Detail

JboWarning

public JboWarning(java.lang.String message,
                  java.lang.String errorCode,
                  java.lang.Object[] params)
Creates a formattable but non-localizable warning.

If a localizable warning is desired, use the JboWarning(Class, String, Object[]) constructor.

Parameters:
message - the unformatted text of the message.
errorCode - an error code.
params - the error message's parameters.
See Also:
ResourceBundle

JboWarning

public JboWarning(java.lang.String message)
Creates a non-formattable warning.

Parameters:
message - the text of the message.

JboWarning

public JboWarning(java.lang.Class resBundleClass,
                  java.lang.String errorCode,
                  java.lang.Object[] params)
Creates a translatable warning.

Parameters:
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.
See Also:
ResourceBundle

JboWarning

public JboWarning(ResourceBundleDef resBundleDef,
                  java.lang.String errorCode,
                  java.lang.Object[] params)
Creates a translatable warning.

Parameters:
resBundleDef - a ResourceBundleDef.
errorCode - error code, a key associated with a message in the resource bundle.
params - the error message's parameters.
See Also:
ResourceBundle
Method Detail

getMessage

public java.lang.String getMessage()
Formats the message text for the default locale.

Specified by:
getMessage in interface JboMessage
Overrides:
getMessage in class java.lang.Throwable
Returns:
the localized message.

getLocalizedMessage

public java.lang.String getLocalizedMessage(java.util.Locale l)
Formats the message text for a specific Locale.

Specified by:
getLocalizedMessage in interface JboMessage
Parameters:
l - a locale.
Returns:
the localized message.

getBaseMessage

public java.lang.String getBaseMessage()
Gets the message without localizing it or inserting parameters.

Specified by:
getBaseMessage in interface JboMessage
Returns:
the unformatted, non-localized message.

getResourceClass

public java.lang.Class getResourceClass()
Gets the class of the resource bundle used to localize messages.

Specified by:
getResourceClass in interface JboMessage
Returns:
a ResourceBundle.

getLocalizedBaseMessage

public java.lang.String getLocalizedBaseMessage(java.util.Locale l)
Localizes the message text for a specific Locale, but without inserting parameters.

Specified by:
getLocalizedBaseMessage in interface JboMessage
Parameters:
l - a locale.
Returns:
the localalized but unformatted message.

getResourceName

public java.lang.String getResourceName()
Gets the name of the ResourceBundle used to localize messages.

Specified by:
getResourceName in interface JboMessage
Returns:
a string identifying a resource bundle.

getErrorParameters

public java.lang.Object[] getErrorParameters()
Gets the error message's parameters.

Specified by:
getErrorParameters in interface JboMessage
Returns:
an array.

setErrorParameters

protected void setErrorParameters(java.lang.Object[] params)
Resets the error parameters. This method is for use by derived classes who create their own set of parameters but do not want the "thrower" to know about it.


getErrorParametersMap

public 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.


setErrorParametersMap

protected void setErrorParametersMap(java.util.Map params)
Resets the error parameters as a name-value pair. This method is for use by derived classes who create their own set of parameters but do not want the "thrower" to know about it.


getErrorCode

public java.lang.String getErrorCode()
Gets the error code.

Specified by:
getErrorCode in interface JboMessage
Returns:
a string containing an error code.

getProductCode

public java.lang.String getProductCode()
Gets the product code.

Specified by:
getProductCode in interface JboMessage
Returns:
JBO_PRODUCT_CODE.

getDetails

public java.lang.Object[] getDetails()
Gets the list of objects and exceptions that spawned this message.

Specified by:
getDetails in interface JboMessage
Returns:
an array.

getDetailMessage

public java.lang.String getDetailMessage()
Constructs a message incorporating the list of details.

Specified by:
getDetailMessage in interface JboMessage
Returns:
a text string.

setDetails

public void setDetails(java.lang.Object[] details)
Sets the list of details.

Specified by:
setDetails in interface JboMessage
Parameters:
details - an array which replaces the current list-of-details array in this warning object.

addToDetails

public void addToDetails(java.lang.Object obj)
Adds to the list of details.

Specified by:
addToDetails in interface JboMessage
Parameters:
obj - an object to add to the details list.

isLocalizable

public boolean isLocalizable()
Tests this message's localizability.

Specified by:
isLocalizable in interface JboMessage
Returns:
true if this message can be localized.

getJboExceptionHelper

protected JboExceptionHelper getJboExceptionHelper()
Get the Helper object for this exception. The helper object contains all of the shared storage for both the JboRuntimeException and the JboException.

Returns:
the JboExceptionHelper object.
See Also:
JboExceptionHelper

getSeverity

public int getSeverity()
Gets the exception severity.

Returns:
an int value representing the exception severity. Valid values are JboWarning.SEVERITY_ERROR, JboWarning.SEVERITY_RECOVERABLE_ERROR, JboWarning.SEVERITY_VETOABLE_WARNING and JboWarning.SEVERITY_WARNING.

setSeverity

public void setSeverity(int severity)
Sets the exception severity.

Parameters:
severity - an int value representing the exception severity

getTypeNameFromId

public static java.lang.String getTypeNameFromId(int id)

getProperty

public java.lang.Object getProperty(java.lang.String hintName)
Description copied from interface: Properties
Retrieves the specified property, if it exists.

Specified by:
getProperty in interface Properties
Parameters:
hintName - Property name.
Returns:
the value of the property, if any, otherwise null.

getProperty

public java.lang.Object getProperty(java.lang.String hintName,
                                    LocaleContext locale)
Specified by:
getProperty in interface Properties

refreshProperty

public java.lang.Object refreshProperty(java.lang.String hintName)
Description copied from interface: Properties
Retrieves the specified property, if it exists. If the application running in a 3 tier environment, it retrieves the property from the middle-tier server, refreshing the value on the client side. If the application is running in a 2 tier environment, it is equivalent to getProperty.

Specified by:
refreshProperty in interface Properties
Parameters:
hintName - Property name.
Returns:
the value of the property, if any, otherwise null.

getProperties

public java.util.Hashtable getProperties()
Description copied from interface: Properties
Gets the table of properties.

Specified by:
getProperties in interface Properties
Returns:
a hashtable of properties.

setProperty

public void setProperty(java.lang.String hintName,
                        java.lang.Object hintValue)
Sets a value for the specified property..

Parameters:
hintName - Property name.
hintValue - the value of the property.

setLocaleContext

public void setLocaleContext(LocaleContext locale)
Set the default locale for this exception to the given locale. This locale will be used when returning message from getMessage.


isAppendCodes

public boolean isAppendCodes()
Returns true if this exception has to prefix the error message with Product and Message Ids.


setAppendCodes

public void setAppendCodes(boolean flag)
Set false if this exception should not prefix the error message with Product and Message Ids. By default this flag is set to true.


isWarning

public boolean isWarning()

Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 1 (11.1.1)

E10653-04

Copyright © 1997, 2010, Oracle. All rights reserved.