|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.muse.util.messages.Messages
public class Messages
Messages is a wrapper for a java.util.ResourceBundle that provides a search-and-replace mechanism for filling in message context. Users can create properties files with messages that include XXX placeholders and then fill in the values of these placeholders at runtime. This allows for as much message externalization as possible while still making it easy to provide runtime-specific information.
MessagesFactory
,
ResourceBundle
Constructor Summary | |
---|---|
Messages(String bundleName)
Creates a new message collection using the given resource bundle. |
|
Messages(String bundleName,
ClassLoader loader)
Creates a new message collection using the given resource bundle and classloader. |
Method Summary | |
---|---|
String |
get(String name)
|
String |
get(String name,
boolean includeID)
|
String |
get(String name,
Object[] filler)
Retrieves the value specified and replaces any placeholders (XXX values) with the values in the given array. |
String |
get(String name,
Object[] filler,
boolean includeID)
Retrieves the value specified and replaces any placeholders (XXX values) with the values in the given array. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Messages(String bundleName)
bundleName
- The qualified name of the resource bundle to parse.public Messages(String bundleName, ClassLoader loader)
bundleName
- The qualified name of the resource bundle to parse.loader
- The class loader that has the bundle file in its classpath.Method Detail |
---|
public String get(String name)
name
- The name of the property/message to lookup.
public String get(String name, boolean includeID)
name
- The name of the property/message to lookup.includeID
- True if you want the message to include [ID = "MessageName"]
for debugging purposes.
public String get(String name, Object[] filler)
name
- The name of the property/message to lookup.filler
- The values to substitute for the placeholders (if any).
public String get(String name, Object[] filler, boolean includeID)
name
- The name of the property/message to lookup.filler
- The values to substitute for the placeholders (if any).includeID
- True if you want the message to include [ID = "MessageName"]
for debugging purposes.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |