@Documented @Target(value={TYPE,METHOD}) @Retention(value=RUNTIME) @Inherited @PropertyStoreApply(value=ParserConfigApply.class) public @interface ParserConfig
Parser
, InputStreamParser
, and ReaderParser
.
Used primarily for specifying bean configuration properties on REST classes and methods.
Modifier and Type | Optional Element and Description |
---|---|
String |
autoCloseStreams
Configuration property: Auto-close streams.
|
String |
binaryFormat
Configuration property: Binary input format.
|
String |
debugOutputLines
Configuration property: Debug output lines.
|
String |
fileCharset
Configuration property: File charset.
|
Class<? extends ParserListener> |
listener
Configuration property: Parser listener.
|
int |
rank
Optional rank for this config.
|
String |
streamCharset
Configuration property: Input stream charset.
|
String |
strict
Configuration property: Strict mode.
|
String |
trimStrings
Configuration property: Trim parsed strings.
|
String |
unbuffered
Configuration property: Unbuffered.
|
public abstract int rank
Can be used to override default ordering and application of config annotations.
public abstract String binaryFormat
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.
public abstract String autoCloseStreams
If
public abstract String debugOutputLines
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.
public abstract Class<? extends ParserListener> listener
Class used to listen for errors and warnings that occur during parsing.
public abstract String strict
If
Strict mode can mean different things for different parsers.
Parser class | Strict 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:
|
public abstract String trimStrings
If String.trim()
before being added to
the POJO.
public abstract String unbuffered
If
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.
MsgPackParser
- It already doesn't use buffering.
XmlParser
, HtmlParser
- These use StAX which doesn't allow for more than one root element anyway.
public abstract String fileCharset
The character set to use for reading
Used when passing in files to Parser.parse(Object, Class)
.
public abstract String streamCharset
The character set to use for converting
Used when passing in input streams and byte arrays to Parser.parse(Object, Class)
.
Copyright © 2016–2019 The Apache Software Foundation. All rights reserved.