public class MessageSource extends GroovyObjectSupport
ResourceBundle
instances for simple i18n support.| Constructor and Description |
|---|
MessageSource(Class type) |
MessageSource(Class[] types) |
MessageSource(String name) |
MessageSource(String[] names) |
| Modifier and Type | Method and Description |
|---|---|
String |
format(String code,
Object[] args)
Format a message (based on
MessageFormat using the message
from the resource bundles using the given code as a pattern and the
given objects as arguments. |
String |
getMessage(String code)
Get a raw message from the resource bundles using the given code.
|
Object |
getProperty(String name)
Retrieves a property value.
|
getMetaClass, invokeMethod, setMetaClass, setPropertypublic MessageSource(String[] names)
public MessageSource(String name)
public MessageSource(Class[] types)
public MessageSource(Class type)
public String getMessage(String code)
public String format(String code, Object[] args)
MessageFormat using the message
from the resource bundles using the given code as a pattern and the
given objects as arguments.public Object getProperty(String name)
GroovyObjectgetProperty in interface GroovyObjectgetProperty in class GroovyObjectSupportname - the name of the property of interestgetMessage(String)