Class Messages.Builder

java.lang.Object
org.apache.juneau.BeanBuilder<Messages>
org.apache.juneau.cp.Messages.Builder
Enclosing class:
Messages

public static class Messages.Builder extends BeanBuilder<Messages>
Builder class.
  • Constructor Details

    • Builder

      protected Builder(Class<?> forClass)
      Constructor.
      Parameters:
      forClass - The base class.
  • Method Details

    • buildDefault

      protected Messages buildDefault()
      Description copied from class: BeanBuilder
      Creates the bean when the bean type is null or is the default value.
      Overrides:
      buildDefault in class BeanBuilder<Messages>
      Returns:
      A new bean.
    • parent

      public Messages.Builder parent(Messages parent)
      Adds a parent bundle.
      Parameters:
      parent - The parent bundle. Can be null.
      Returns:
      This object.
    • name

      public Messages.Builder name(String name)
      Specifies the bundle name (e.g. "Messages").
      Parameters:
      name - The bundle name.
      If null, the forClass class name is used.
      Returns:
      This object.
    • baseNames

      public Messages.Builder baseNames(String... baseNames)
      Specifies the base name patterns to use for finding the resource bundle.
      Parameters:
      baseNames - The bundle base names.
      The default is the following:
      • "{package}.{name}"
      • "{package}.i18n.{name}"
      • "{package}.nls.{name}"
      • "{package}.messages.{name}"
      Returns:
      This object.
    • locale

      public Messages.Builder locale(Locale locale)
      Specifies the locale.
      Parameters:
      locale - The locale. If null, the default locale is used.
      Returns:
      This object.
    • locale

      public Messages.Builder locale(String locale)
      Specifies the locale.
      Parameters:
      locale - The locale. If null, the default locale is used.
      Returns:
      This object.
    • location

      public Messages.Builder location(Class<?> baseClass, String bundlePath)
      Specifies a location of where to look for messages.
      Parameters:
      baseClass - The base class.
      bundlePath - The bundle path.
      Returns:
      This object.
    • location

      public Messages.Builder location(String bundlePath)
      Specifies a location of where to look for messages.
      Parameters:
      bundlePath - The bundle path.
      Returns:
      This object.
    • impl

      public Messages.Builder impl(Object value)
      Description copied from class: BeanBuilder
      Overrides the bean returned by the BeanBuilder.build() method.

      Use this method if you want this builder to return an already-instantiated bean.

      Overrides:
      impl in class BeanBuilder<Messages>
      Parameters:
      value - The setting value.
      Returns:
      This object.
    • type

      public Messages.Builder type(Class<?> value)
      Description copied from class: BeanBuilder
      Overrides the bean type produced by the BeanBuilder.build() method.

      Use this method if you want to instantiated a bean subclass.

      Overrides:
      type in class BeanBuilder<Messages>
      Parameters:
      value - The setting value.
      Returns:
      This object.