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

E10653-08

oracle.jbo.common
Class JboExHelperLocalized

java.lang.Object
  extended by oracle.jbo.common.PropertiesHelper
      extended by oracle.jbo.common.JboExceptionHelper
          extended by oracle.jbo.common.JboExHelperLocalized
All Implemented Interfaces:
java.io.Serializable, ExprWrappable, Properties

public class JboExHelperLocalized
extends JboExceptionHelper

The superclass for localized exceptions for Business Components.

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:

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: messageBody
For 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:

Other methods may be overridden to modify the message format.

Since:
JDeveloper 3.0
See Also:
JboExceptionHelper, Serialized Form

Field Summary
protected  java.lang.Class mResBundleClass
           
protected  ResourceBundleDef mResBundleDef
           
 
Fields inherited from class oracle.jbo.common.JboExceptionHelper
SEVERITY_ERROR, SEVERITY_RAC_RECOVERABLE_ERROR, SEVERITY_RECOVERABLE_ERROR, SEVERITY_VETOABLE_WARNING, SEVERITY_WARNING
 
Fields inherited from class oracle.jbo.common.PropertiesHelper
mProperties
 
Constructor Summary
JboExHelperLocalized(JboMessage ex, java.lang.Class resBundleClass, java.lang.String errorCode, java.lang.Object[] params)
          Creates a translatable exception.
JboExHelperLocalized(JboMessage ex, ResourceBundleDef resBundleDef, java.lang.String errorCode, java.lang.Object[] params)
          Creates a translatable exception.
 
Method Summary
 java.lang.String getBaseMessage()
          Gets the message without localizing it or inserting parameters.
protected  java.lang.String getErrorMsg(java.util.Locale l, java.lang.Object[] params)
           
protected  java.lang.String getErrorMsgWithNamedTokens(java.util.Locale l, java.util.Map<java.lang.String,java.lang.Object> params)
           
 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.
 ResourceBundleDef getResourceBundleDef()
          getResourceBundleDef gets the mResBundleDef value
 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.
 
Methods inherited from class oracle.jbo.common.JboExceptionHelper
addToDetails, getDetailMessage, getDetails, getDetailsList, getErrorCode, getErrorMsgFormat, getErrorParameters, getErrorParametersMap, getMessage, getProductCode, getProperties, getSeverity, isAppendCodes, setAppendCodes, setDetails, setDetailsList, setErrorParameters, setErrorParametersMap, setLocaleContext, setSeverity
 
Methods inherited from class oracle.jbo.common.PropertiesHelper
closeObject, getImageLoc, getProperty, getProperty, isReadOnly, refreshProperties, refreshProperty, setName, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mResBundleClass

protected java.lang.Class mResBundleClass

mResBundleDef

protected ResourceBundleDef mResBundleDef
Constructor Detail

JboExHelperLocalized

public JboExHelperLocalized(JboMessage ex,
                            java.lang.Class resBundleClass,
                            java.lang.String errorCode,
                            java.lang.Object[] params)
Creates a translatable exception.

Parameters:
ex - a Business Component error or warning.
resBundleClass - a collection of message template, accessed by key.
errorCode - error code; a key associated with a message template in resBundleClass.
params - the error message's parameters.

JboExHelperLocalized

public JboExHelperLocalized(JboMessage ex,
                            ResourceBundleDef resBundleDef,
                            java.lang.String errorCode,
                            java.lang.Object[] params)
Creates a translatable exception.

Parameters:
ex - a Business Component error or warning.
resBundleDef - a ResourceBundleDef.
errorCode - error code; a key associated with a message template in resBundleClass.
params - the error message's parameters.
Method Detail

getResourceBundleDef

public ResourceBundleDef getResourceBundleDef()
getResourceBundleDef gets the mResBundleDef value


getLocalizedMessage

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

Overrides:
getLocalizedMessage in class JboExceptionHelper
Parameters:
l - a locale.
Returns:
the localized message.

getBaseMessage

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

Overrides:
getBaseMessage in class JboExceptionHelper
Returns:
the un-formatted, non-localized message.

getLocalizedBaseMessage

public java.lang.String getLocalizedBaseMessage(java.util.Locale l)
Localizes an un-parameterized message text for a specific Locale.

Overrides:
getLocalizedBaseMessage in class JboExceptionHelper
Parameters:
l - a locale.
Returns:
the localalized but un-formatted message.

getResourceName

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

Overrides:
getResourceName in class JboExceptionHelper
Returns:
the name of this class' ResourceBundle.

getResourceClass

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

Overrides:
getResourceClass in class JboExceptionHelper
Returns:
this class' ResourceBundle.

getErrorMsgWithNamedTokens

protected java.lang.String getErrorMsgWithNamedTokens(java.util.Locale l,
                                                      java.util.Map<java.lang.String,java.lang.Object> params)
Overrides:
getErrorMsgWithNamedTokens in class JboExceptionHelper

getErrorMsg

protected java.lang.String getErrorMsg(java.util.Locale l,
                                       java.lang.Object[] params)
Overrides:
getErrorMsg in class JboExceptionHelper

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

E10653-08

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