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
-
Msg(String)
- Creates a simple untranslated Msg.
-
Msg(String, int)
- Creates a Msg by resource and number.
-
Msg(String, int, Object[])
- Creates a formated Msg by resource, number, and format arguments.
-
Msg(String, String)
- Creates a Msg by resource and string key.
-
Msg(String, String, Object[])
- Creates a formated Msg by resource, key, and format arguments.
-
form(Object[])
- Returns a formated string using the specified arguments.
Deprecated.
-
getArgs()
- Accessor method for the message arguments.
-
getKey()
- Accessor method for the key that identifies the message within the resource.
-
getResource()
- Accessor method for the resource.
-
getString()
-
Returns the translated string.
-
getString(Object[])
- Returns a formated string using the specified arguments.
-
str()
-
Returns the translated string.
Deprecated.
-
toString()
-
String conversion method returns translated string.
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.
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.
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.
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.
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.
getResource
public String getResource()
- Accessor method for the resource.
- Returns:
- The resource associated with this Msg object.
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.
getArgs
public Object[] getArgs()
- Accessor method for the message arguments.
- Returns:
- The message arguments.
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.
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.
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.
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.
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