Skip navigation links

Oracle Fusion Middleware
Java API Reference for Oracle WebLogic Server
12c (12.2.1)

Part Number E55141-01
P4 Change 1723563 on 2015/10/09


weblogic.i18n
Class Localizer

java.lang.Object
  extended by weblogic.i18n.Localizer


public final class Localizer
extends Object

Localizer is a class used to look up the various elements of a message definition. A Localizer accesses localization data through properties files generated from the message catalogs using the combination of message element names and message id as keys. For example,

String text = (String) getObject(Localizer.MESSAGE_BODY,"123456")

returns the text for message 123456. Convenience methods are also provided. For instance, the getBody("123456") call is equivalent to the above getObject() call. For log messages, two properties files are generated. One for basic catalog data and one for detailed text. Refer to L10nLookup for information on retrieving detailed vs. basic localization data.


Field Summary
static String ACTION
           
static String CAUSE
           
static String DIAGNOSTIC_VOLUME
           
static String EXCLUDE_PARTITIONED
           
static String I18N_PACKAGE
           
static String L10N_PACKAGE
           
static String MESSAGE_BODY
           
static String MESSAGE_DETAIL
           
static String[] NON_SERVER_SEVERITIES
           
static String PREFIX
           
static String PREFIX_DELIM
           
static String[] SERVER_SEVERITIES
           
static String SEVERITY
           
static String STACKTRACE
           
static String SUBSYSTEM
           
static String VERSION
           

 

Constructor Summary
Localizer(ResourceBundle rb)
           

 

Method Summary
 String get(String id)
          locate text associated with the passed message id.
 String getAction(String id)
          Lookup up message action for message, "id".
 String getBody(String id)
          Lookup up message text for log message, "id".
 ResourceBundle getBundle()
          Returns underlying resource bundle
 String getCause(String id)
          Lookup up message cause for message, "id".
 String getDetail(String id)
          Lookup up message detail for log message, "id".
 String getDiagnosticVolume(String id)
          Lookup DiagnosticVolume for message, "id"
 String getI18nPackage()
          Returns the i18n package associated with this Localizer.
 String getL10nPackage()
          Returns the l10n package associated with this Localizer.
 Object getObject(String key, int id)
          Returns an Object in a Localizer bundle matching the key and the specified message id.
 Object getObject(String key, String id)
          Returns an Object in a Localizer bundle matching the key and the specified message id.
 String getPrefix()
          Returns the prefix associated with this Localizer.
 int getSeverity(String id)
          Lookup up severity for message, "id".
 boolean getStackTrace(String id)
          Lookup stack trace option for message, "id".
 String getString(String key, int id)
          Returns an String in a Localizer bundle matching the key and the specified message id.
 String getString(String key, String id)
          Returns a String-ified version of a value from a Localizer bundle matching the key and the specified message id.
 String getSubSystem()
          Returns the subsystem associated with this Localizer.
 String getVersion()
           

 

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

 

Field Detail

VERSION

public static final String VERSION
See Also:
Constant Field Values

L10N_PACKAGE

public static final String L10N_PACKAGE
See Also:
Constant Field Values

I18N_PACKAGE

public static final String I18N_PACKAGE
See Also:
Constant Field Values

SUBSYSTEM

public static final String SUBSYSTEM
See Also:
Constant Field Values

PREFIX

public static final String PREFIX
See Also:
Constant Field Values

SEVERITY

public static final String SEVERITY
See Also:
Constant Field Values

MESSAGE_BODY

public static final String MESSAGE_BODY
See Also:
Constant Field Values

MESSAGE_DETAIL

public static final String MESSAGE_DETAIL
See Also:
Constant Field Values

CAUSE

public static final String CAUSE
See Also:
Constant Field Values

ACTION

public static final String ACTION
See Also:
Constant Field Values

STACKTRACE

public static final String STACKTRACE
See Also:
Constant Field Values

DIAGNOSTIC_VOLUME

public static final String DIAGNOSTIC_VOLUME
See Also:
Constant Field Values

EXCLUDE_PARTITIONED

public static final String EXCLUDE_PARTITIONED
See Also:
Constant Field Values

SERVER_SEVERITIES

public static final String[] SERVER_SEVERITIES

NON_SERVER_SEVERITIES

public static final String[] NON_SERVER_SEVERITIES

PREFIX_DELIM

public static final String PREFIX_DELIM
See Also:
Constant Field Values

Constructor Detail

Localizer

public Localizer(ResourceBundle rb)

Method Detail

getBundle

public ResourceBundle getBundle()
Returns underlying resource bundle
Returns:
resource bundle for the localizer

getVersion

public String getVersion()
                  throws MissingResourceException
Throws:
MissingResourceException

getL10nPackage

public String getL10nPackage()
                      throws MissingResourceException
Returns the l10n package associated with this Localizer.
Returns:
package name
Throws:
MissingResourceException

getI18nPackage

public String getI18nPackage()
                      throws MissingResourceException
Returns the i18n package associated with this Localizer.
Returns:
package name
Throws:
MissingResourceException

getSubSystem

public String getSubSystem()
                    throws MissingResourceException
Returns the subsystem associated with this Localizer.
Returns:
subsystem name
Throws:
MissingResourceException

getPrefix

public String getPrefix()
Returns the prefix associated with this Localizer.
Returns:
prefix name

getObject

public Object getObject(String key,
                        String id)
                 throws MissingResourceException
Returns an Object in a Localizer bundle matching the key and the specified message id.
Parameters:
key - Element of a message definition.
id - Message id.
Returns:
Object from the Localizer ResourceBundle.
Throws:
MissingResourceException - There is no entry in the Localizer for key/id.

getObject

public Object getObject(String key,
                        int id)
                 throws MissingResourceException
Returns an Object in a Localizer bundle matching the key and the specified message id.
Parameters:
key - Element of a message definition.
id - Message id.
Returns:
Object from the Localizer ResourceBundle.
Throws:
MissingResourceException - There is no entry in the Localizer for key/id.

getString

public String getString(String key,
                        String id)
                 throws MissingResourceException
Returns a String-ified version of a value from a Localizer bundle matching the key and the specified message id. getString is a convenience method to save casting from getObject().
Parameters:
key - Element of a message definition.
id - Message id.
Returns:
String from the Localizer ResourceBundle.
Throws:
MissingResourceException - There is no entry in the Localizer for key/id.

getString

public String getString(String key,
                        int id)
                 throws MissingResourceException
Returns an String in a Localizer bundle matching the key and the specified message id. getString is a convenience method to save casting from getObject().
Parameters:
key - Element of a message definition.
id - Message id.
Returns:
String from the Localizer ResourceBundle.
Throws:
MissingResourceException - There is no entry in the Localizer for key/id.

get

public String get(String id)
locate text associated with the passed message id. This method is useful for users of simple text message catalogs.
Returns:
message text

getBody

public String getBody(String id)
Lookup up message text for log message, "id".
Returns:
message body text for message identified by id param. An empty String is returned if message not in catalog.

getDetail

public String getDetail(String id)
Lookup up message detail for log message, "id".
Returns:
message detail text for message identified by id param. An empty String is returned if message not in catalog.

getCause

public String getCause(String id)
Lookup up message cause for message, "id".
Returns:
message cause text for the log message identified by id param. An empty String is returned if message not in catalog.

getAction

public String getAction(String id)
Lookup up message action for message, "id".
Returns:
message action text for the log message identified by id param. An empty String is returned if message not in catalog.

getSeverity

public int getSeverity(String id)
Lookup up severity for message, "id".
Returns:
severity value for the log message identified by id param. Zero is returned if message not in catalog.

getStackTrace

public boolean getStackTrace(String id)
Lookup stack trace option for message, "id".
Returns:
true if option excists and value is "true". Otherwise false.

getDiagnosticVolume

public String getDiagnosticVolume(String id)
Lookup DiagnosticVolume for message, "id"
Returns:
diagnostic volume

Skip navigation links

Copyright 1996, 2015, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

Oracle Fusion Middleware
Java API Reference for Oracle WebLogic Server
12c (12.2.1)

Part Number E55141-01
P4 Change 1723563 on 2015/10/09