Class EncoderSet.Builder

java.lang.Object
org.apache.juneau.marshall.encoders.EncoderSet.Builder
All Implemented Interfaces:
BeanStoreOverridable<EncoderSet.Builder>
Enclosing class:
EncoderSet

public static class EncoderSet.Builder extends Object implements BeanStoreOverridable<EncoderSet.Builder>
Builder class.
  • Constructor Details

    • Builder

      protected Builder(BeanStore beanStore)
      Constructor.
      Parameters:
      beanStore - The bean store to use for creating beans.
    • Builder

      protected Builder(EncoderSet.Builder copyFrom)
      Copy constructor.
      Parameters:
      copyFrom - The builder being copied.
  • Method Details

    • beanStore

      public BeanStore beanStore()
      Returns the bean store used by this builder.
      Returns:
      The bean store used by this builder.
    • overridingBeanStore

      Installs the supplied BeanStore as the overridingParent of this builder's bean store.

      Wraps the current beanStore() in a fresh BasicBeanStore whose overridingParent is the supplied store, so test-time overrides win over the builder's regular bean lookups during construction-time reflective injection. Passing null is a no-op.

      Specified by:
      overridingBeanStore in interface BeanStoreOverridable<EncoderSet.Builder>
      Parameters:
      store - The override layer. Can be null (no-op).
      Returns:
      This object.
      Since:
      10.0.0
    • add

      public EncoderSet.Builder add(Class<?>... values)
      Registers the specified encoders with this group.

      Entries are added in-order to the beginning of the list.

      Parameters:
      values - The encoders to add to this group.
      Returns:
      This object.
      Throws:
      IllegalArgumentException - if any class does not extend from Encoder.
    • add

      public EncoderSet.Builder add(Encoder... values)
      Registers the specified encoders with this group.

      Entries are added to the beginning of the list.

      Parameters:
      values - The encoders to add to this group.
      Returns:
      This object.
    • clear

      Clears out any existing encoders in this group.
      Returns:
      This object.
    • copy

      Makes a copy of this builder.
      Returns:
      A new copy of this builder.
    • impl

      public EncoderSet.Builder impl(Object value)
      Overrides the bean returned by the build() method with a pre-built instance.
      Parameters:
      value - The pre-built instance.
      Returns:
      This object.
    • inner

      public List<Object> inner()
      Returns direct access to the Encoder objects and classes in this builder.

      Provided to allow for any extraneous modifications to the list not accomplishable via other methods on this builder such as re-ordering/adding/removing entries.

      Note that it is up to the user to ensure that the list only contains Encoder objects and classes.

      Returns:
      The inner list of entries in this builder.
    • isEmpty

      public boolean isEmpty()
      Returns true if this builder is empty.
      Returns:
      true if this builder is empty.
    • set

      public EncoderSet.Builder set(Class<?>... values)
      Sets the encoders in this group.

      All encoders in this group are replaced with the specified values.

      If EncoderSet.Inherit is specified (or any other class whose simple name is "Inherit", the existing values are preserved and inserted into the position in the values array.

      Parameters:
      values - The encoders to add to this group.
      Returns:
      This object.
      Throws:
      IllegalArgumentException - if any class does not extend from Encoder.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • build

      public EncoderSet build()
      Builds the encoder set.
      Returns:
      A new EncoderSet.