public static final class StreamReadConstraints.Builder extends Object
| Modifier and Type | Method and Description |
|---|---|
StreamReadConstraints |
build() |
StreamReadConstraints.Builder |
maxDocumentLength(long maxDocLen)
Sets the maximum allowed document length (for positive values over 0) or
indicate that any length is acceptable (
0 or negative number). |
StreamReadConstraints.Builder |
maxNameLength(int maxNameLen)
Sets the maximum name length (in chars or bytes, depending on input context).
|
StreamReadConstraints.Builder |
maxNestingDepth(int maxNestingDepth)
Sets the maximum nesting depth.
|
StreamReadConstraints.Builder |
maxNumberLength(int maxNumLen)
Sets the maximum number length (in chars or bytes, depending on input context).
|
StreamReadConstraints.Builder |
maxStringLength(int maxStringLen)
Sets the maximum string length (in chars or bytes, depending on input context).
|
public StreamReadConstraints.Builder maxNestingDepth(int maxNestingDepth)
maxNestingDepth - the maximum depthIllegalArgumentException - if the maxNestingDepth is set to a negative valuepublic StreamReadConstraints.Builder maxDocumentLength(long maxDocLen)
0 or negative number).
The length is in input units of the input source, that is, in
bytes or chars.maxDocLen - the maximum allowed document if positive number above 0; otherwise
(0 or negative number) means "unlimited".public StreamReadConstraints.Builder maxNumberLength(int maxNumLen)
maxNumLen - the maximum number length (in chars or bytes, depending on input context)IllegalArgumentException - if the maxNumLen is set to a negative valuepublic StreamReadConstraints.Builder maxStringLength(int maxStringLen)
Setting this value to lower than the maxNumberLength(int) is not recommended.
NOTE: Jackson 2.15.0 initially used a lower setting (5_000_000).
maxStringLen - the maximum string length (in chars or bytes, depending on input context)IllegalArgumentException - if the maxStringLen is set to a negative valuepublic StreamReadConstraints.Builder maxNameLength(int maxNameLen)
maxNameLen - the maximum string length (in chars or bytes, depending on input context)IllegalArgumentException - if the maxStringLen is set to a negative valuepublic StreamReadConstraints build()
Copyright © 2008–2024 FasterXML. All rights reserved.