Class OpenApiParser.Builder

Enclosing class:
OpenApiParser

Builder class.
  • Constructor Details

    • Builder

      protected Builder()
      Constructor, default settings.
    • Builder

      protected Builder(OpenApiParser.Builder copyFrom)
      Copy constructor.
      Parameters:
      copyFrom - The builder to copy from.
    • Builder

      protected Builder(OpenApiParser copyFrom)
      Copy constructor.
      Parameters:
      copyFrom - The bean to copy from.
  • Method Details

    • build

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

      OpenApiCommon configuration property:  Default collection format for HTTP parts.

      Specifies the collection format to use for HTTP parts when not otherwise specified via Schema.collectionFormat().

      Example:

      // Create a parser using CSV for collections. OpenApiParser parser1 = OpenApiParser .create() .collectionFormat(CSV) .build(); // Create a serializer using UON for collections. OpenApiParser parser2 = OpenApiParser .create() .collectionFormat(UON) .build(); // Parse CSV. JsonList list1 = parser1.read("foo=bar,baz=qux\,true\,123", JsonList.class) // Parse UON. JsonList list2 = parser2.read("(foo=bar,baz=@(qux,true,123))", JsonList.class)

      • HttpPartFormat
        • CSV - (default) Comma-separated values (e.g. "foo,bar").
        • SSV - Space-separated values (e.g. "foo bar").
        • TSV - Tab-separated values (e.g. "foo\tbar").
        • PIPES - Pipe-separated values (e.g. "foo|bar").
        • MULTI - Corresponds to multiple parameter instances instead of multiple values for a single instance (e.g. "foo=bar&foo=baz").
        • UONC - UON collection notation (e.g. "@(foo,bar)").
      Parameters:
      value - The new value for this property.
      Returns:
      This object.
    • copy

      Description copied from class: Context.Builder
      Copy creator.
      Specified by:
      copy in class UonParser.Builder<OpenApiParser.Builder>
      Returns:
      A new mutable copy of this builder.
    • format

      OpenApiCommon configuration property:  Default format for HTTP parts.

      Specifies the format to use for HTTP parts when not otherwise specified via Schema.format().

      Example:

      // Create a plain-text parser. OpenApiParser parser1 = OpenApiParser .create() .build(); // Create a UON parser. OpenApiParser parser2 = OpenApiParser .create() .format(UON) .build(); // Parse a plain-text string. String value1 = parser1.read("foo bar"); // Parse a UON string. String value2 = parser1.read("'foo bar'");

      Parameters:
      value - The new value for this property.
      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 UonParser.Builder<OpenApiParser.Builder>
      Returns:
      The hashkey of this builder.