Top Description Methods
org.apache.xerces.util

public Interface MessageFormatter

Known Direct Implementers
org.apache.xerces.xinclude.XIncludeMessageFormatter, org.apache.xerces.xpointer.XPointerMessageFormatter, org.apache.xerces.impl.msg.XMLMessageFormatter, org.apache.xerces.impl.xs.XSMessageFormatter
Imports
java.util.Locale, .MissingResourceException

This interface provides a generic message formatting mechanism and is useful for producing messages that must be localized and/or formatted with replacement text.
Author
Andy Clark
Version
$Id: MessageFormatter.java 809242 2009-08-30 03:34:31Z mrglavas $
See Also
org.apache.xerces.impl.XMLErrorReporter

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

Returns the formatted message.
formatMessage
(Locale
The locale of the message.
locale
,
String
The message key.
key
,
Object[]
The message replacement text arguments. The order of the arguments must match that of the placeholders in the actual message.
arguments
)

Formats a message with the specified arguments using the given locale information.

Method Detail

formatMessageback to summary
public String formatMessage(Locale locale, String key, Object[] arguments) throws MissingResourceException

Formats a message with the specified arguments using the given locale information.

Parameters
locale:Locale

The locale of the message.

key:String

The message key.

arguments:Object[]

The message replacement text arguments. The order of the arguments must match that of the placeholders in the actual message.

Returns:String

Returns the formatted message.

Exceptions
MissingResourceException:
Thrown if the message with the specified key cannot be found.