Class MessageSource

  • All Implemented Interfaces:
    GroovyObject

    public class MessageSource
    extends GroovyObjectSupport
    Message source backed up by one or more ResourceBundle instances for simple i18n support.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String format​(java.lang.String code, java.lang.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.
      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)
      Retrieves a property value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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

      • getMessage

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

        public java.lang.String format​(java.lang.String code,
                                       java.lang.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.