Class MessageSource
java.lang.Object
groovy.lang.GroovyObjectSupport
org.codehaus.groovy.tools.shell.util.MessageSource
- All Implemented Interfaces:
GroovyObject
public class MessageSource extends GroovyObjectSupport
Message source backed up by one or more
ResourceBundle
instances for simple i18n support.-
Constructor Summary
Constructors Constructor Description MessageSource(Class type)
MessageSource(Class[] types)
MessageSource(String name)
MessageSource(String[] names)
-
Method Summary
Modifier and Type Method Description String
format(String code, Object[] args)
Format a message (based onMessageFormat
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.
-
Constructor Details
-
Method Details
-
getMessage
Get a raw message from the resource bundles using the given code. -
format
Format a message (based onMessageFormat
using the message from the resource bundles using the given code as a pattern and the given objects as arguments. -
getProperty
Description copied from interface:GroovyObject
Retrieves a property value.- Parameters:
name
- the name of the property of interest- Returns:
- the given property
- See Also:
getMessage(String)
-