|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.perforce.p4java.messages.PerforceMessages
public class PerforceMessages
Handles formatting Perforce messages. It provides locale (language & country) specific messages. The default locale is set during startup of the JVM based on the host environment.
Additionally, this class provides a convenient way to format messages with parameters.
| Field Summary | |
|---|---|
static String |
MESSAGE_BUNDLE
Default name of the Perforce message bundle properties file. |
| Constructor Summary | |
|---|---|
PerforceMessages()
Instantiates a new perforce messages using the default message bundle properties file package path name . |
|
PerforceMessages(Locale locale)
Instantiates a new perforce messages. |
|
PerforceMessages(String propertiesFile)
Instantiates a new perforce messages base on the passed-in message bundle properties file package path name. |
|
| Method Summary | |
|---|---|
String |
format(String message,
Object[] params)
Format a message with parameters. |
Locale |
getLocale()
Gets the locale. |
String |
getMessage(String key)
Gets the message. |
String |
getMessage(String key,
Object[] params)
Gets the message. |
ResourceBundle |
getMessages()
Gets the messages. |
void |
setLocale(Locale locale)
Sets the locale. |
void |
setMessages(ResourceBundle messages)
Sets the messages. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String MESSAGE_BUNDLE
| Constructor Detail |
|---|
public PerforceMessages()
public PerforceMessages(String propertiesFile)
propertiesFile - the name (without the extension) of the properties file
including the full package path name (i.e.
com.perforce.p4java.messages.PerforceMessages)public PerforceMessages(Locale locale)
locale - the locale| Method Detail |
|---|
public Locale getLocale()
public void setLocale(Locale locale)
locale - the new localepublic ResourceBundle getMessages()
public void setMessages(ResourceBundle messages)
messages - the new messagespublic String getMessage(String key)
key - the key
public String getMessage(String key,
Object[] params)
key - the keyparams - the params
public String format(String message,
Object[] params)
message - the messageparams - the params
MessageFormat
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||