All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.wizards.core.Msg

java.lang.Object
   |
   +----com.sun.wizards.core.Msg

public class Msg
extends Object
implements Serializable
The Msg object represents a localized String. It contains a message key and the resource to use when looking up the translation in MsgCat (the message catalog). It can be used to store a string key at buuildtime, then at runtime, have the string be retrieved and simultaneously localized into a locale-specific String.

See Also:
ListResourceBundle

Constructor Index

 o Msg(String)
Creates a simple untranslated Msg.
 o Msg(String, int)
Creates a Msg by resource and number.
 o Msg(String, int, Object[])
Creates a formated Msg by resource, number, and format arguments.
 o Msg(String, String)
Creates a Msg by resource and string key.
 o Msg(String, String, Object[])
Creates a formated Msg by resource, key, and format arguments.

Method Index

 o form(Object[])
Returns a formated string using the specified arguments. Deprecated.
 o getArgs()
Accessor method for the message arguments.
 o getKey()
Accessor method for the key that identifies the message within the resource.
 o getResource()
Accessor method for the resource.
 o getString()
Returns the translated string.
 o getString(Object[])
Returns a formated string using the specified arguments.
 o str()
Returns the translated string. Deprecated.
 o toString()
String conversion method returns translated string.

Constructors

 o Msg
 public Msg(String msgResource,
            int msgNum)
Creates a Msg by resource and number.

Parameters:
msgResource - The name of the resource containing the desired string.
msgNum - The string identifier.
 o Msg
 public Msg(String msgResource,
            String msgKey)
Creates a Msg by resource and string key.

Parameters:
msgResource - The name of the resource containing the desired string.
msgKey - The string identifier.
 o Msg
 public Msg(String msgResource,
            int msgNum,
            Object msgArgs[])
Creates a formated Msg by resource, number, and format arguments. This constructor should be used for localized strings that require runtime parameters to be inserted.

Parameters:
msgResource - The name of the resource containing the desired string.
msgNum - The string identifier.
msgArgs - The arguments to be inserted into the localized string.
 o Msg
 public Msg(String msgResource,
            String msgKey,
            Object msgArgs[])
Creates a formated Msg by resource, key, and format arguments. This constructor should be used for localized strings that require runtime parameters to be inserted.

Parameters:
msgResource - The name of the resource containing the desired string.
msgKey - The string identifier.
msgArgs - The arguments to be inserted into the localized string.
 o Msg
 public Msg(String simpleString)
Creates a simple untranslated Msg. Its the same as a String. Would be used for cases where a Msg object is in API but no translation was wanted or required.

Parameters:
simpleString - The string.

Methods

 o getResource
 public String getResource()
Accessor method for the resource.

Returns:
The resource associated with this Msg object.
 o getKey
 public String getKey()
Accessor method for the key that identifies the message within the resource.

Returns:
The key that identifies the message within the resource.
 o getArgs
 public Object[] getArgs()
Accessor method for the message arguments.

Returns:
The message arguments.
 o str
 public String str()
Note: str() is deprecated. Use getString().

Returns the translated string. If arguments were specified, they will be inserted into the localized string.

Returns:
The translated string represented by this object.
 o getString
 public String getString()
Returns the translated string. If arguments were specified, they will be inserted into the localized string.

Returns:
The translated string represented by this object.
 o form
 public String form(Object msgArgs[])
Note: form() is deprecated. Use getString(Object[]).

Returns a formated string using the specified arguments.

Returns:
The translated string represented by this object.
 o getString
 public String getString(Object msgArgs[])
Returns a formated string using the specified arguments.

Parameters:
msgArgs - The arguments to be used in the translated message.
Returns:
The translated string represented by this object.
 o toString
 public String toString()
String conversion method returns translated string.

Returns:
The translated string represented by this object.
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index