Oracle ADF Model and Business Components API Reference 10.1.2 B14022-01

oracle.jbo.common
Class JboExHelperLocalized

java.lang.Object
  extended byoracle.jbo.common.JboExceptionHelper
      extended byoracle.jbo.common.JboExHelperLocalized

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

Field Summary
protected  java.lang.Class mResBundleClass
           
 
Constructor Summary
JboExHelperLocalized(JboMessage ex, java.lang.Class resBundleClass, 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)
           
 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.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, getMessage, getProductCode, isAppendCodes, setAppendCodes, setDetails, setDetailsList, setErrorParameters, setLocaleContext
 
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
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.
Method Detail

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.

getErrorMsg

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

Oracle ADF Model and Business Components API Reference 10.1.2 B14022-01

 

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