Class UonParser.Builder<SELF extends UonParser.Builder<SELF>>

Direct Known Subclasses:
OpenApiParser.Builder, UonParser.DefaultBuilder, UrlEncodingParser.Builder
Enclosing class:
UonParser

public abstract static class UonParser.Builder<SELF extends UonParser.Builder<SELF>> extends ReaderParser.Builder<SELF>
Builder class.
  • Constructor Details

    • Builder

      protected Builder()
      Constructor, default settings.
    • Builder

      protected Builder(UonParser.Builder<?> copyFrom)
      Copy constructor.
      Parameters:
      copyFrom - The builder to copy from.
      Cannot be null.
    • Builder

      protected Builder(UonParser copyFrom)
      Copy constructor.
      Parameters:
      copyFrom - The bean to copy from.
      Cannot be null.
  • Method Details

    • build

      public UonParser build()
      Description copied from class: Context.Builder
      Build the object.
      Overrides:
      build in class ReaderParser.Builder<SELF extends UonParser.Builder<SELF>>
      Returns:
      The built object.
    • copy

      public abstract SELF copy()
      Description copied from class: Context.Builder
      Copy creator.
      Specified by:
      copy in class ReaderParser.Builder<SELF extends UonParser.Builder<SELF>>
      Returns:
      A new mutable copy of this builder.
    • decoding

      public SELF decoding()
      Decode "%xx" sequences.

      When enabled, URI encoded characters will be decoded. Otherwise it's assumed that they've already been decoded before being passed to this parser.

      Example:

      // Create a decoding UON parser. ReaderParser parser = UonParser. .create() .decoding() .build(); // Produces: ["foo bar", "baz quz"]. String[] foo = parser.read("@(foo%20bar,baz%20qux)", String[].class);

      Returns:
      This object.
    • decoding

      public SELF decoding(boolean value)
      Same as decoding() but allows you to explicitly specify the value.
      Parameters:
      value - The value for this setting.
      Returns:
      This object.
    • hashKey

      public HashKey hashKey()
      Description copied from class: Context.Builder
      Returns the hashkey of this builder.

      Used to return previously instantiated context beans that have matching hashkeys. The HashKey object is suitable for use as a hashmap key of a map of context beans. A context bean is considered equivalent if the HashKey.equals(Object) method is the same.

      Overrides:
      hashKey in class ReaderParser.Builder<SELF extends UonParser.Builder<SELF>>
      Returns:
      The hashkey of this builder.
    • validateEnd

      public SELF validateEnd()
      Validate end.

      When enabled, after parsing a POJO from the input, verifies that the remaining input in the stream consists of only comments or whitespace.

      Example:

      // Create a parser using strict mode. ReaderParser parser = UonParser. .create() .validateEnd() .build(); // Should fail because input has multiple POJOs. String in = "(foo=bar)(baz=qux)"; MyBean myBean = parser.read(in, MyBean.class);

      Returns:
      This object.
    • validateEnd

      public SELF validateEnd(boolean value)
      Same as validateEnd() but allows you to explicitly specify the value.
      Parameters:
      value - The value for this setting.
      Returns:
      This object.