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 SummaryConstructors Constructor Description MessageSource(java.lang.Class type)MessageSource(java.lang.Class[] types)MessageSource(java.lang.String name)MessageSource(java.lang.String[] names)
- 
Method SummaryModifier and Type Method Description java.lang.Stringformat(java.lang.String code, java.lang.Object[] args)Format a message (based onMessageFormatusing the message from the resource bundles using the given code as a pattern and the given objects as arguments.java.lang.StringgetMessage(java.lang.String code)Get a raw message from the resource bundles using the given code.java.lang.ObjectgetProperty(java.lang.String name)Retrieves a property value.Methods inherited from class groovy.lang.GroovyObjectSupportgetMetaClass, setMetaClassMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface groovy.lang.GroovyObjectinvokeMethod, setProperty
- 
Constructor Details- 
MessageSourcepublic MessageSource(java.lang.String[] names)
- 
MessageSourcepublic MessageSource(java.lang.String name)
- 
MessageSourcepublic MessageSource(java.lang.Class[] types)
- 
MessageSourcepublic MessageSource(java.lang.Class type)
 
- 
- 
Method Details- 
getMessagepublic java.lang.String getMessage(java.lang.String code)Get a raw message from the resource bundles using the given code.
- 
formatpublic java.lang.String format(java.lang.String code, java.lang.Object[] args)Format a message (based onMessageFormatusing the message from the resource bundles using the given code as a pattern and the given objects as arguments.
- 
getPropertypublic java.lang.Object getProperty(java.lang.String name)Description copied from interface:GroovyObjectRetrieves a property value.- Parameters:
- name- the name of the property of interest
- Returns:
- the given property
- See Also:
- getMessage(String)
 
 
-