Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Business Components
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.jbo
Class JboWarning

    java.lang.Object
      |
      +--oracle.jbo.JboWarning

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

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:

- an untranslated product code string, such as `"FRM"` or `"ORA"`.
- an untranslated error code string, such as `"10234"`
- untranslated message text.
- message parameters, equal in number to the number of '%' symbols in the message text.
- a "details" list containing background information.

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:

- override `getResourceName`
to return the name of the appropriate resource bundle.
- override `getProductCode`
to return the name of the product.

Other methods may be overridden to modify the message format.

Since:
  JDeveloper 3.0
See Also:
  Serialized Form

Fields inherited from interface oracle.jbo.common.MetaObjectBase
`TYP_APP_MODULE, TYP_ATTRIBUTE, TYP_COMPONENT_OBJECT, TYP_DEF_APP_MODULE, TYP_DEF_ATTRIBUTE, TYP_DEF_COMPONENT_OBJECT, TYP_DEF_DOMAIN, TYP_DEF_ENTITY_ASSOC, TYP_DEF_ENTITY_OBJECT, TYP_DEF_PACKAGE, TYP_DEF_VIEW_LINK, 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_PACKAGE, TYP_VALIDATOR_TYPE, 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(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.
`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.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.
`static java.lang.String` | `getTypeNameFromId(int id)`
`boolean` | `isLocalizable()` Tests this message's localizability.
`void` | `setDetails(java.lang.Object[] details)` Sets the list of details.
`protected void` | `setErrorParameters(java.lang.Object[] params)` Resets the error parameters.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

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`

Method Detail

### getMessage

    public java.lang.String getMessage()

  Formats the message text for the default locale.
  Specified by:
    getMessage in interface JboMessage
  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.

### 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`

### getTypeNameFromId

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

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Business Components
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD