Annotation Type 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

    • 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
    • binaryFormat

      Binary input format.

      When using the Parser.parse(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:
      ""
    • 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:
      ""
    • 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.parser.ParserListener.Void.class
    • strict

      Strict mode.

      If "true", strict mode for the parser is enabled.

      Strict mode can mean different things for different parsers.

      Parser classStrict behavior
      All reader-based parsers When enabled, throws ParseExceptions on malformed charset input. Otherwise, malformed input is ignored.
      JsonParser When enabled, throws exceptions on the following invalid JSON syntax:
      • Unquoted attributes.
      • Missing attribute values.
      • Concatenated strings.
      • Javascript comments.
      • Numbers and booleans when Strings are expected.
      • Numbers valid in Java but not JSON (e.g. octal notation, etc...)
      • "true"
      • "false" (default)
      Notes:
      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:
      ""
    • 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:
      ""
    • fileCharset

      File charset.

      The character set to use for reading Files from the file system.

      Used when passing in files to Parser.parse(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:
      ""
    • 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.parse(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:
      ""