Class ReaderParser.Builder<SELF extends ReaderParser.Builder<SELF>>

Direct Known Subclasses:
CsvParser.Builder, HjsonParser.Builder, HoconParser.Builder, IniParser.Builder, JsonParser.Builder, MarkdownParser.Builder, PlainTextParser.Builder, RdfParser.Builder, ReaderParser.DefaultBuilder, SseParser.Builder, TomlParser.Builder, UonParser.Builder, XmlParser.Builder, YamlParser.Builder
Enclosing class:
ReaderParser

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

    • Builder

      protected Builder()
      Constructor, default settings.
    • Builder

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

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

    • build

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

      public abstract SELF copy()
      Description copied from class: Context.Builder
      Copy creator.
      Specified by:
      copy in class Parser.Builder<SELF extends ReaderParser.Builder<SELF>>
      Returns:
      A new mutable copy of this builder.
    • 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 Parser.Builder<SELF extends ReaderParser.Builder<SELF>>
      Returns:
      The hashkey of this builder.
    • streamCharset

      public SELF streamCharset(Charset value)
      Input stream charset.

      The character set to use for converting InputStreams and byte arrays to readers.

      Used when passing in input streams and byte arrays to Parser.read(Object, Class).

      Example:

      // Create a parser that reads UTF-8 files. ReaderParser parser = JsonParser .create() .streamCharset(Charset.forName("UTF-8")) .build(); // Use it to read a UTF-8 encoded input stream. MyBean myBean = parser.read(new FileInputStream("MyBean.txt"), MyBean.class);

      Parameters:
      value - The new value for this property.
      The default value is "UTF-8".
      Can be null (defaults to UTF-8).
      Returns:
      This object.