Groovy Documentation

org.codehaus.groovy.tools.shell.util
[Java] Class MessageSource

java.lang.Object
  groovy.lang.GroovyObjectSupport
      org.codehaus.groovy.tools.shell.util.MessageSource

public class MessageSource
extends GroovyObjectSupport

Message source backed up by one or more java.util.ResourceBundle instances for simple i18n support.

Authors:
Jason Dillon
Version:
\$Id\$


Constructor Summary
MessageSource(java.lang.String[] names)

MessageSource(java.lang.String name)

MessageSource(java.lang.Class[] types)

MessageSource(java.lang.Class type)

 
Method Summary
java.lang.String format(java.lang.String code, java.lang.Object[] args)

Format a message (based on java.text.MessageFormat using the message from the resource bundles using the given code as a pattern and the given objects as arguments.

java.lang.String getMessage(java.lang.String code)

Get a raw message from the resource bundles using the given code.

java.lang.Object getProperty(java.lang.String name)

@see #getMessage(String)

 
Methods inherited from class GroovyObjectSupport
getMetaClass, getProperty, invokeMethod, setMetaClass, setProperty
 
Methods inherited from class java.lang.Object
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Constructor Detail

MessageSource

public MessageSource(java.lang.String[] names)


MessageSource

public MessageSource(java.lang.String name)


MessageSource

public MessageSource(java.lang.Class[] types)


MessageSource

public MessageSource(java.lang.Class type)


 
Method Detail

format

public java.lang.String format(java.lang.String code, java.lang.Object[] args)
Format a message (based on java.text.MessageFormat using the message from the resource bundles using the given code as a pattern and the given objects as arguments.


getMessage

public java.lang.String getMessage(java.lang.String code)
Get a raw message from the resource bundles using the given code.


getProperty

public java.lang.Object getProperty(java.lang.String name)
See Also:
getMessage(String)


 

Groovy Documentation