Skip Headers
Oracle® Fusion Middleware Using Logging Services for Application Logging for Oracle WebLogic Server
12c Release 1 (12.1.1)

Part Number E24419-02
Go to Documentation Home
Home
Go to Table of Contents
Contents
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

A Localizer Class Reference for WebLogic Server

This appendix describes the Localizer classes, Localizer classes, Localizer methods, key values for Localizers, and lookup properties for Localizers.

This appendix includes the following sections:

About Localizer Classes

The weblogic.i18ngen utility creates Localizer classes based on the content of the message catalog.

One Localizer class is generated for each catalog file. The name of the class is the catalog name (without the .xml extension, which is stripped by the utility), followed by LogLocalizer for log message catalogs and TextLocalizer for simple text catalogs. A Localizer class for the catalog ejb.xml is ejbLogLocalizer.

Localizer Methods

Localizers are PropertyResourceBundle objects. Four additional methods are provided to simplify the access of the localization data in the Localizer. These methods are described in Table A-1.

These methods are not part of the Localizer. Rather, they are part of the Localizer class. The Localizer class is used by the Logger and TextFormatter classes to extract data out of the Localizer. Each Localizer has an associated Localizer class that is obtained through L10nLookup, the Localizer lookup object.

Table A-1 Methods for Localization Data Access

Method Description
public Object getObject(String key, String id)

Returns localization text for the key element for message id.

public Object getObject(String key, int id)

Returns localization text for the key element for message id.

public String getString(String key, String id)

Returns localization text for the key element for message id.

public String getString(String key, int id)

Returns localization text for the key element for message id.


Each of the methods for accessing localization data has a key argument. The following list shows the recognized values for the key argument:

With the exception of the Localizer.SEVERITY key, the localization data returned by Localizers are String objects that return an integer object.

The following list shows the severity values that are returned:

The specific strings returned are defined in the message catalogs.

The key argument to the get*() methods identify which element of a definition to return. Acceptable values are defined in the Localizer class definition. The returned text can be further expanded through java.text.MessageFormat.format(). The message body, detail, cause, and action elements are all localizable. The other elements, message ID, severity, and subsystem are not localizable and do not require further processing by MessageFormat.

Localizer Lookup Class

To obtain the correct Localizer for a message, use the L10nLookup class, which is a property class extension that is loaded at system startup from the property file:

i18n_user.properties

This property file is created by weblogic.i18ngen and is included in the WebLogic Server installation. When you start up a user application, any i18n_user.properties files in its classpath are also loaded into L10nLookup.

Properties in the lookup (i18n_user.properties) file have the following format:

nnnnnn=subsystem:Localizer class

The arguments on this line are defined as follows:

For example, message 001234 is identified as an EJB subsystem message ID from the weblogic.i18n.ejbLogLocalizer class by the following property in the lookup file:

001234=EJB:weblogic.i18n.ejbLogLocalizer