Griffon 1.2.0

griffon.core.i18n
[Java] Interface MessageSource


public interface MessageSource

Interface for resolving messages, with support for the parameterization and internationalization of such messages.

Authors:
Andres Almiray
Alexander Klein
Since:
1.1.0


Method Summary
String getMessage(String key)

Try to resolve the message.

String getMessage(String key, Locale locale)

Try to resolve the message.

String getMessage(String key, Object[] args)

Try to resolve the message.

String getMessage(String key, Object[] args, Locale locale)

Try to resolve the message.

String getMessage(String key, List args)

Try to resolve the message.

String getMessage(String key, List args, Locale locale)

Try to resolve the message.

String getMessage(String key, String defaultMessage)

Try to resolve the message.

String getMessage(String key, String defaultMessage, Locale locale)

Try to resolve the message.

String getMessage(String key, Object[] args, String defaultMessage)

Try to resolve the message.

String getMessage(String key, Object[] args, String defaultMessage, Locale locale)

Try to resolve the message.

String getMessage(String key, List args, String defaultMessage)

Try to resolve the message.

String getMessage(String key, List args, String defaultMessage, Locale locale)

Try to resolve the message.

String getMessage(String key, Map args)

Try to resolve the message.

String getMessage(String key, Map args, Locale locale)

Try to resolve the message.

String getMessage(String key, Map args, String defaultMessage)

Try to resolve the message.

String getMessage(String key, Map args, String defaultMessage, Locale locale)

Try to resolve the message.

 

Method Detail

getMessage

public String getMessage(String key)
Try to resolve the message.
throws:
NoSuchMessageException if no message is found
Parameters:
key - Key to lookup, such as 'log4j.appenders.console'
Returns:
The resolved message at the given key for the default locale


getMessage

public String getMessage(String key, Locale locale)
Try to resolve the message.
throws:
NoSuchMessageException if no message is found
Parameters:
key - Key to lookup, such as 'log4j.appenders.console'
locale - Locale in which to lookup
Returns:
The resolved message at the given key for the given locale


getMessage

public String getMessage(String key, Object[] args)
Try to resolve the message.
throws:
NoSuchMessageException if no message is found
Parameters:
key - Key to lookup, such as 'log4j.appenders.console'
args - Arguments that will be filled in for params within the message (params look like "{0}" within a message, but this might differ between implementations), or null if none.
Returns:
The resolved message at the given key for the default locale


getMessage

public String getMessage(String key, Object[] args, Locale locale)
Try to resolve the message.
throws:
NoSuchMessageException if no message is found
Parameters:
key - Key to lookup, such as 'log4j.appenders.console'
args - Arguments that will be filled in for params within the message (params look like "{0}" within a message, but this might differ between implementations), or null if none.
locale - Locale in which to lookup
Returns:
The resolved message at the given key for the given locale


getMessage

public String getMessage(String key, List args)
Try to resolve the message.
throws:
NoSuchMessageException if no message is found
Parameters:
key - Key to lookup, such as 'log4j.appenders.console'
args - Arguments that will be filled in for params within the message (params look like "{0}" within a message, but this might differ between implementations), or null if none.
Returns:
The resolved message at the given key for the default locale


getMessage

public String getMessage(String key, List args, Locale locale)
Try to resolve the message.
throws:
NoSuchMessageException if no message is found
Parameters:
key - Key to lookup, such as 'log4j.appenders.console'
args - Arguments that will be filled in for params within the message (params look like "{0}" within a message, but this might differ between implementations), or null if none.
locale - Locale in which to lookup
Returns:
The resolved message at the given key for the given locale


getMessage

public String getMessage(String key, String defaultMessage)
Try to resolve the message. Return default message if no message was found.
Parameters:
key - Key to lookup, such as 'log4j.appenders.console'
defaultMessage - Message to return if the lookup fails
Returns:
The resolved message at the given key for the default locale


getMessage

public String getMessage(String key, String defaultMessage, Locale locale)
Try to resolve the message. Return default message if no message was found.
Parameters:
key - Key to lookup, such as 'log4j.appenders.console'
defaultMessage - Message to return if the lookup fails
locale - Locale in which to lookup
Returns:
The resolved message at the given key for the given locale


getMessage

public String getMessage(String key, Object[] args, String defaultMessage)
Try to resolve the message. Return default message if no message was found.
Parameters:
key - Key to lookup, such as 'log4j.appenders.console'
args - Arguments that will be filled in for params within the message (params look like "{0}" within a message, but this might differ between implementations), or null if none.
defaultMessage - Message to return if the lookup fails
Returns:
The resolved message at the given key for the default locale


getMessage

public String getMessage(String key, Object[] args, String defaultMessage, Locale locale)
Try to resolve the message. Return default message if no message was found.
Parameters:
key - Key to lookup, such as 'log4j.appenders.console'
args - Arguments that will be filled in for params within the message (params look like "{0}" within a message, but this might differ between implementations), or null if none.
defaultMessage - Message to return if the lookup fails
locale - Locale in which to lookup
Returns:
The resolved message at the given key for the given locale


getMessage

public String getMessage(String key, List args, String defaultMessage)
Try to resolve the message. Return default message if no message was found.
Parameters:
key - Key to lookup, such as 'log4j.appenders.console'
args - Arguments that will be filled in for params within the message (params look like "{0}" within a message, but this might differ between implementations), or null if none.
defaultMessage - Message to return if the lookup fails
Returns:
The resolved message at the given key for the default locale


getMessage

public String getMessage(String key, List args, String defaultMessage, Locale locale)
Try to resolve the message. Return default message if no message was found.
Parameters:
key - Key to lookup, such as 'log4j.appenders.console'
args - Arguments that will be filled in for params within the message (params look like "{0}" within a message, but this might differ between implementations), or null if none.
defaultMessage - Message to return if the lookup fails
locale - Locale in which to lookup
Returns:
The resolved message at the given key for the given locale


getMessage

public String getMessage(String key, Map args)
Try to resolve the message.
throws:
NoSuchMessageException if no message is found
Parameters:
key - Key to lookup, such as 'log4j.appenders.console'
args - Arguments that will be filled in for params within the message (params look like "{:key}" within a message, but this might differ between implementations), or null if none.
Returns:
The resolved message at the given key for the default locale


getMessage

public String getMessage(String key, Map args, Locale locale)
Try to resolve the message.
throws:
NoSuchMessageException if no message is found
Parameters:
key - Key to lookup, such as 'log4j.appenders.console'
args - Arguments that will be filled in for params within the message (params look like "{:key}" within a message, but this might differ between implementations), or null if none.
locale - Locale in which to lookup
Returns:
The resolved message at the given key for the given locale


getMessage

public String getMessage(String key, Map args, String defaultMessage)
Try to resolve the message. Return default message if no message was found.
Parameters:
key - Key to lookup, such as 'log4j.appenders.console'
args - Arguments that will be filled in for params within the message (params look like "{:key}" within a message, but this might differ between implementations), or null if none.
defaultMessage - Message to return if the lookup fails
Returns:
The resolved message at the given key for the default locale


getMessage

public String getMessage(String key, Map args, String defaultMessage, Locale locale)
Try to resolve the message. Return default message if no message was found.
Parameters:
key - Key to lookup, such as 'log4j.appenders.console'
args - Arguments that will be filled in for params within the message (params look like "{:key}" within a message, but this might differ between implementations), or null if none.
defaultMessage - Message to return if the lookup fails
locale - Locale in which to lookup
Returns:
The resolved message at the given key for the given locale


 

Groovy Documentation