Package: org.codehaus.groovy.tools.shell.util

## [Java] Class MessageSource

- org.codehaus.groovy.tools.shell.util.MessageSource

-     public class MessageSource
      extends GroovyObjectSupport

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

- - ### Constructor Summary

    Constructors
    Constructor and description
    `MessageSource(String[] names)` Creates a message source backed by the named resource bundles.
    `MessageSource(String name)` Creates a message source backed by a single named resource bundle.
    `MessageSource(Class[] types)` Creates a message source backed by bundles named after the supplied types.
    `MessageSource(Class type)` Creates a message source backed by the bundle named after the supplied type.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public 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.
    `` | `public String` | `getMessage(String code)` Get a raw message from the resource bundles using the given code.
    `` | `public Object` | `getProperty(String name)` See Also: getMessage(String)

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class GroovyObjectSupport` | `getMetaClass, setMetaClass`

- - ### Constructor Detail

    - #### public MessageSource(String[] names)

      Creates a message source backed by the named resource bundles.

      Parameters:
        `names` - the bundle base names to search

    - #### public MessageSource(String name)

      Creates a message source backed by a single named resource bundle.

      Parameters:
        `name` - the bundle base name

    - #### public MessageSource(Class[] types)

      Creates a message source backed by bundles named after the supplied types.

      Parameters:
        `types` - the types whose names identify resource bundles

    - #### public MessageSource(Class type)

      Creates a message source backed by the bundle named after the supplied type.

      Parameters:
        `type` - the type whose name identifies a resource bundle

  - ### Method Detail

    - #### public 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.

    - #### public String getMessage(String code)

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

    - #### public Object getProperty(String name)

      See Also:
        getMessage(String)