Annotation Interface ParserConfig
Parser, InputStreamParser, and ReaderParser.
Used primarily for specifying bean configuration properties on REST classes and methods.
See Also:
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionAuto-close streams.Binary input format.Debug output lines.Class<? extends ParserListener>Parser listener.Default per-property null-coercion policy applied during parsing.intOptional rank for this config.Input stream charset.Trim parsed strings.Unbuffered.
-
Element Details
-
autoCloseStreams
Auto-close streams.If
"true" ,InputStreams andReaders passed into parsers will be closed after parsing is complete."true" "false" (default)
Notes:
-
Supports VarResolver.DEFAULT (e.g.
"$C{myConfigVar}" ).
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:
-
Supports VarResolver.DEFAULT (e.g.
"$C{myConfigVar}" ).
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:
- Format: integer
- Default: 5
-
Supports VarResolver.DEFAULT (e.g.
"$C{myConfigVar}" ).
See Also:
- Returns:
- The annotation value.
- Default:
- ""
-
listener
Class<? extends ParserListener> listenerParser 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 rankOptional 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 usingString.trim()before being added to the POJO."true" "false" (default)
Notes:
-
Supports VarResolver.DEFAULT (e.g.
"$C{myConfigVar}" ).
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 theObjectMapper level. Applied as the fallback when no per-property@MarshalledProp(nulls=…)is configured."LEAVE" (default) — passnullthrough unchanged."EMPTY" — substitute the type's empty value (emptyString/Collection/Map, primitive default for primitives,Optional.empty()forOptional)."DEFAULT" — substitute the bean-constructed default for the property."SKIP" — do not call the setter at all.
Notes:
-
Supports VarResolver.DEFAULT (e.g.
"$C{myConfigVar}" ).
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:
- ""
-