Annotation Interface ParserConfig


Annotation for specifying config properties defined in Parser, InputStreamParser, and ReaderParser.

Used primarily for specifying bean configuration properties on REST classes and methods.

See Also:
  • Element Details

    • autoCloseStreams

      Auto-close streams.

      If "true", InputStreams and Readers passed into parsers will be closed after parsing is complete.

      • "true"
      • "false" (default)
      Notes:
      See Also:
      Returns:
      The annotation value.
      Default:
      ""
    • binaryFormat

      Binary input format.

      When using the Parser.read(Object,Class) method on stream-based parsers and the input is a string, this defines the format to use when converting the string into a byte array.

      • "SPACED_HEX"
      • "HEX" (default)
      • "BASE64"
      Notes:
      See Also:
      Returns:
      The annotation value.
      Default:
      ""
    • debugOutputLines

      Debug output lines.

      When parse errors occur, this specifies the number of lines of input before and after the error location to be printed as part of the exception message.

      Notes:
      See Also:
      Returns:
      The annotation value.
      Default:
      ""
    • listener

      Parser listener.

      Class used to listen for errors and warnings that occur during parsing.

      See Also:
      Returns:
      The annotation value.
      Default:
      org.apache.juneau.marshall.parser.ParserListener.Void.class
    • rank

      int rank
      Optional rank for this config.

      Can be used to override default ordering and application of config annotations.

      Returns:
      The annotation value.
      Default:
      0
    • streamCharset

      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).

      Notes:
      • "DEFAULT" can be used to indicate the JVM default file system charset.
      • Supports VarResolver.DEFAULT (e.g. "$C{myConfigVar}").
      See Also:
      Returns:
      The annotation value.
      Default:
      ""
    • trimStrings

      Trim parsed strings.

      If "true", string values will be trimmed of whitespace using String.trim() before being added to the POJO.

      • "true"
      • "false" (default)
      Notes:
      See Also:
      Returns:
      The annotation value.
      Default:
      ""
    • nulls

      Default per-property null-coercion policy applied during parsing.

      Juneau's analog of Jackson's JsonSetter.Value.forValueNulls(...) at the ObjectMapper level. Applied as the fallback when no per-property @MarshalledProp(nulls=…) is configured.

      • "LEAVE" (default) — pass null through unchanged.
      • "EMPTY" — substitute the type's empty value (empty String/Collection/ Map, primitive default for primitives, Optional.empty() for Optional).
      • "DEFAULT" — substitute the bean-constructed default for the property.
      • "SKIP" — do not call the setter at all.
      Notes:
      See Also:
      Returns:
      The annotation value.
      Since:
      10.0.0
      Default:
      ""
    • unbuffered

      Unbuffered.

      If "true", don't use internal buffering during parsing.

      This is useful in cases when you want to parse the same input stream or reader multiple times because it may contain multiple independent POJOs to parse.
      Buffering would cause the parser to read past the current POJO in the stream.

      • "true"
      • "false" (default)
      Notes:
      • This only allows for multi-input streams for the following parsers: It has no effect on the following parsers:
        • MsgPackParser - It already doesn't use buffering.
        • XmlParser, HtmlParser - These use StAX which doesn't allow for more than one root element anyway.
        • RDF parsers - These read everything into an internal model before any parsing begins.
      • Supports VarResolver.DEFAULT (e.g. "$C{myConfigVar}").
      See Also:
      Returns:
      The annotation value.
      Default:
      ""