TokenStreamFactory (such as
JsonFactory); if nothing explicitly specified, default
constraints are used.
Currently constrained aspects, with default settings, are:
DEFAULT_MAX_NUM_LEN)
DEFAULT_MAX_STRING_LEN)
DEFAULT_MAX_NAME_LEN)
DEFAULT_MAX_DEPTH)
unlimited (coded as -1,
(see DEFAULT_MAX_DOC_LEN)
unlimited (coded as -1,
(see DEFAULT_MAX_TOKEN_COUNT)
| Modifier and Type | Class and Description |
|---|---|
| public static class |
| Modifier and Type | Field and Description |
|---|---|
| protected final long | |
| protected final int | |
| protected final int | |
| protected final int | |
| protected final int | |
| protected final long | |
| private static StreamReadConstraints | |
| public static final int | DEFAULT_MAX_DEPTH
Default setting for maximum depth: see |
| public static final long | DEFAULT_MAX_DOC_LEN
Default setting for maximum document length:
see |
| public static final int | DEFAULT_MAX_NAME_LEN
Default setting for maximum name length: see |
| public static final int | |
| public static final int | DEFAULT_MAX_STRING_LEN
Default setting for maximum string length: see |
| public static final long | DEFAULT_MAX_TOKEN_COUNT
Default setting for maximum token count:
see |
| private static final int | MAX_BIGINT_SCALE_MAGNITUDE
Limit for the maximum magnitude of Scale of |
| private static final long |
| Access | Constructor and Description |
|---|---|
| protected | StreamReadConstraints(final int maxNestingDepth, final long maxDocLen, final int maxNumLen, final int maxStringLen)
Deprecated
|
| protected | StreamReadConstraints(final int
Maximum input document nesting to allow maxNestingDepth, final long Maximum input document length to allow maxDocLen, final int Maximum number representation length to allow maxNumLen, final int Maximum String value length to allow maxStringLen, final int Maximum Object property name length to allow maxNameLen)
Deprecated
|
| protected | StreamReadConstraints(final int
Maximum input document nesting to allow maxNestingDepth, final long Maximum input document length to allow maxDocLen, final int Maximum number representation length to allow maxNumLen, final int Maximum String value length to allow maxStringLen, final int Maximum Object property name length to allow maxNameLen, final long Maximum number of tokens to allow maxTokenCount)
|
| Modifier and Type | Method and Description |
|---|---|
| protected String | |
| protected StreamConstraintsException | |
| public static StreamReadConstraints. | |
| public static StreamReadConstraints | |
| public long | |
| public int | Returns: Maximum allowed name lengthAccessor for maximum length of names to decode. |
| public int | |
| public int | Returns: Maximum allowed number lengthAccessor for maximum length of numbers to decode. |
| public int | Returns: Maximum allowed string lengthAccessor for maximum length of strings to decode. |
| public long | |
| public boolean | Returns: True if this constraints instance has a limit for maximum
document length to enforce; false otherwise.Convenience method, basically same as: getMaxDocumentLength() > 0L |
| public boolean | Returns: True if this constraints instance has a limit for maximum
token count to enforce; false otherwise.Convenience method, basically same as: getMaxTokenCount() > 0L |
| public static void | overrideDefaultStreamReadConstraints(final StreamReadConstraints
new default for StreamReadConstraints (a null value will reset to built-in default) streamReadConstraints)Override the default StreamReadConstraints. |
| public StreamReadConstraints. | |
| public void | validateBigIntegerScale(int
Scale (possibly negative) of scale)java. to convertConvenience method that can be used to verify that a conversion to
|
| public void | validateDocumentLength(long
Current length of processed document content len)Convenience method that can be used to verify that the
document length does not exceed the maximum specified by this
constraints object (if any): if it does, a
|
| public void | validateFPLength(int
Length of number in input units length)Convenience method that can be used to verify that a floating-point
number of specified length does not exceed maximum specified by this
constraints object: if it does, a
|
| public void | validateIntegerLength(int
Length of number in input units length)Convenience method that can be used to verify that an integer
number of specified length does not exceed maximum specific by this
constraints object: if it does, a
|
| public void | validateNameLength(int
Length of name in input units length)Convenience method that can be used to verify that a name
of specified length does not exceed maximum specific by this
constraints object: if it does, a
|
| public void | validateNestingDepth(int
count of unclosed objects and arrays depth)Convenience method that can be used to verify that the
nesting depth does not exceed the maximum specified by this
constraints object: if it does, a
|
| public void | validateStringLength(int
Length of string in input units length)Convenience method that can be used to verify that a String
of specified length does not exceed maximum specific by this
constraints object: if it does, a
|
| public void | validateTokenCount(long
Current token count for processed document content count)Convenience method that can be used to verify that the
token count does not exceed the maximum specified by this
constraints object (if any): if it does, a
|
| _maxDocLen | back to summary |
|---|---|
| protected final long _maxDocLen | |
| _maxNameLen | back to summary |
|---|---|
| protected final int _maxNameLen | |
| _maxNestingDepth | back to summary |
|---|---|
| protected final int _maxNestingDepth | |
| _maxNumLen | back to summary |
|---|---|
| protected final int _maxNumLen | |
| _maxStringLen | back to summary |
|---|---|
| protected final int _maxStringLen | |
| _maxTokenCount | back to summary |
|---|---|
| protected final long _maxTokenCount | |
| DEFAULT | back to summary |
|---|---|
| private static StreamReadConstraints DEFAULT | |
| DEFAULT_MAX_DEPTH | back to summary |
|---|---|
| public static final int DEFAULT_MAX_DEPTH Default setting for maximum depth: see | |
| DEFAULT_MAX_DOC_LEN | back to summary |
|---|---|
| public static final long DEFAULT_MAX_DOC_LEN Default setting for maximum document length:
see | |
| DEFAULT_MAX_NAME_LEN | back to summary |
|---|---|
| public static final int DEFAULT_MAX_NAME_LEN Default setting for maximum name length: see
| |
| DEFAULT_MAX_NUM_LEN | back to summary |
|---|---|
public static final int DEFAULT_MAX_NUM_LEN
| |
| DEFAULT_MAX_STRING_LEN | back to summary |
|---|---|
| public static final int DEFAULT_MAX_STRING_LEN Default setting for maximum string length: see Note Jackson 2.15.0 initially used a lower setting (5_000_000). | |
| DEFAULT_MAX_TOKEN_COUNT | back to summary |
|---|---|
| public static final long DEFAULT_MAX_TOKEN_COUNT Default setting for maximum token count:
see | |
| MAX_BIGINT_SCALE_MAGNITUDE | back to summary |
|---|---|
| private static final int MAX_BIGINT_SCALE_MAGNITUDE Limit for the maximum magnitude of Scale of "100k digits ought to be enough for anybody!" | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| StreamReadConstraints | back to summary |
|---|---|
| protected StreamReadConstraints(final int maxNestingDepth, final long maxDocLen, final int maxNumLen, final int maxStringLen)
Deprecated
| |
| StreamReadConstraints | back to summary |
|---|---|
| protected StreamReadConstraints(final int maxNestingDepth, final long maxDocLen, final int maxNumLen, final int maxStringLen, final int maxNameLen)
Deprecated
| |
| StreamReadConstraints | back to summary |
|---|---|
protected StreamReadConstraints(final int maxNestingDepth, final long maxDocLen, final int maxNumLen, final int maxStringLen, final int maxNameLen, final long maxTokenCount)
| |
| _constrainRef | back to summary |
|---|---|
| protected String _constrainRef(String method) | |
| _constructException | back to summary |
|---|---|
| protected StreamConstraintsException _constructException(String msgTemplate, Object... args) throws StreamConstraintsException | |
| builder | back to summary |
|---|---|
| public static StreamReadConstraints. | |
| defaults | back to summary |
|---|---|
public static StreamReadConstraints defaults()
| |
| getMaxDocumentLength | back to summary |
|---|---|
| public long getMaxDocumentLength() Accessor for maximum document length.
see
| |
| getMaxNameLength | back to summary |
|---|---|
| public int getMaxNameLength() Accessor for maximum length of names to decode.
see
| |
| getMaxNestingDepth | back to summary |
|---|---|
| public int getMaxNestingDepth() Accessor for maximum depth.
see
| |
| getMaxNumberLength | back to summary |
|---|---|
| public int getMaxNumberLength() Accessor for maximum length of numbers to decode.
see
| |
| getMaxStringLength | back to summary |
|---|---|
| public int getMaxStringLength() Accessor for maximum length of strings to decode.
see
| |
| getMaxTokenCount | back to summary |
|---|---|
| public long getMaxTokenCount() Accessor for maximum token count.
see
| |
| hasMaxDocumentLength | back to summary |
|---|---|
| public boolean hasMaxDocumentLength() Convenience method, basically same as: getMaxDocumentLength() > 0L
| |
| hasMaxTokenCount | back to summary |
|---|---|
| public boolean hasMaxTokenCount() Convenience method, basically same as: getMaxTokenCount() > 0L
| |
| overrideDefaultStreamReadConstraints | back to summary |
|---|---|
| public static void overrideDefaultStreamReadConstraints(final StreamReadConstraints streamReadConstraints) Override the default StreamReadConstraints. These defaults are only used when
Library maintainers should not set this as it will affect other code that uses Jackson.
Library maintainers who want to configure StreamReadConstraints for the Jackson usage within their
lib should create This method is meant for users delivering applications. If they use this, they set it when they start their application to avoid having other code initialize their mappers before the defaults are overridden.
| |
| rebuild | back to summary |
|---|---|
public StreamReadConstraints.
| |
| validateBigIntegerScale | back to summary |
|---|---|
| public void validateBigIntegerScale(int scale) throws StreamConstraintsException Convenience method that can be used to verify that a conversion to
| |
| validateDocumentLength | back to summary |
|---|---|
| public void validateDocumentLength(long len) throws StreamConstraintsException Convenience method that can be used to verify that the
document length does not exceed the maximum specified by this
constraints object (if any): if it does, a
| |
| validateFPLength | back to summary |
|---|---|
| public void validateFPLength(int length) throws StreamConstraintsException Convenience method that can be used to verify that a floating-point
number of specified length does not exceed maximum specified by this
constraints object: if it does, a
| |
| validateIntegerLength | back to summary |
|---|---|
| public void validateIntegerLength(int length) throws StreamConstraintsException Convenience method that can be used to verify that an integer
number of specified length does not exceed maximum specific by this
constraints object: if it does, a
| |
| validateNameLength | back to summary |
|---|---|
| public void validateNameLength(int length) throws StreamConstraintsException Convenience method that can be used to verify that a name
of specified length does not exceed maximum specific by this
constraints object: if it does, a
| |
| validateNestingDepth | back to summary |
|---|---|
| public void validateNestingDepth(int depth) throws StreamConstraintsException Convenience method that can be used to verify that the
nesting depth does not exceed the maximum specified by this
constraints object: if it does, a
| |
| validateStringLength | back to summary |
|---|---|
| public void validateStringLength(int length) throws StreamConstraintsException Convenience method that can be used to verify that a String
of specified length does not exceed maximum specific by this
constraints object: if it does, a
| |
| validateTokenCount | back to summary |
|---|---|
| public void validateTokenCount(long count) throws StreamConstraintsException Convenience method that can be used to verify that the
token count does not exceed the maximum specified by this
constraints object (if any): if it does, a
| |
| Modifier and Type | Field and Description |
|---|---|
| private long | |
| private int | |
| private int | |
| private int | |
| private int | |
| private long |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv | Builder(final int maxNestingDepth, final long maxDocLen, final long maxTokenCount, final int maxNumLen, final int maxStringLen, final int maxNameLen)
|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public StreamReadConstraints | |
| public StreamReadConstraints. | Returns: this builderthe maximum allowed document length if positive number above 0; otherwise
( maxDocLen)0 or negative number) means "unlimited".Sets the maximum allowed document length (for positive values over 0) or
indicate that any length is acceptable ( |
| public StreamReadConstraints. | Returns: this builderthe maximum string length (in chars or bytes, depending on input context) maxNameLen)Sets the maximum name length (in chars or bytes, depending on input context). |
| public StreamReadConstraints. | Returns: this builderthe maximum depth maxNestingDepth)Sets the maximum nesting depth. |
| public StreamReadConstraints. | Returns: this builderthe maximum number length (in chars or bytes, depending on input context) maxNumLen)Sets the maximum number length (in chars or bytes, depending on input context). |
| public StreamReadConstraints. | Returns: this builderthe maximum string length (in chars or bytes, depending on input context) maxStringLen)Sets the maximum string length (in chars or bytes, depending on input context). |
| public StreamReadConstraints. | Returns: this builderthe maximum allowed token count if positive number above 0; otherwise
( maxTokenCount)0 or negative number) means "unlimited".Sets the maximum allowed token count (for positive values over 0) or
indicate that any count is acceptable ( |
| maxDocLen | back to summary |
|---|---|
| private long maxDocLen | |
| maxNameLen | back to summary |
|---|---|
| private int maxNameLen | |
| maxNestingDepth | back to summary |
|---|---|
| private int maxNestingDepth | |
| maxNumLen | back to summary |
|---|---|
| private int maxNumLen | |
| maxStringLen | back to summary |
|---|---|
| private int maxStringLen | |
| maxTokenCount | back to summary |
|---|---|
| private long maxTokenCount | |
| Builder | back to summary |
|---|---|
| pack-priv Builder() | |
| Builder | back to summary |
|---|---|
| pack-priv Builder(final int maxNestingDepth, final long maxDocLen, final long maxTokenCount, final int maxNumLen, final int maxStringLen, final int maxNameLen) | |
| Builder | back to summary |
|---|---|
| pack-priv Builder(StreamReadConstraints src) | |
| build | back to summary |
|---|---|
| public StreamReadConstraints build() | |
| maxDocumentLength | back to summary |
|---|---|
| public StreamReadConstraints. Sets the maximum allowed document length (for positive values over 0) or
indicate that any length is acceptable (
| |
| maxNameLength | back to summary |
|---|---|
| public StreamReadConstraints. Sets the maximum name length (in chars or bytes, depending on input context). The default is 50,000. This limit is not exact, the limit is applied when we increase internal buffer sizes and an exception will happen at sizes greater than this limit. Some text values that are a little bigger than the limit may be treated as valid but no text values with sizes less than or equal to this limit will be treated as invalid.
| |
| maxNestingDepth | back to summary |
|---|---|
| public StreamReadConstraints. Sets the maximum nesting depth. The depth is a count of objects and arrays that have not been closed, `{` and `[` respectively.
| |
| maxNumberLength | back to summary |
|---|---|
| public StreamReadConstraints. Sets the maximum number length (in chars or bytes, depending on input context). The default is 1000.
| |
| maxStringLength | back to summary |
|---|---|
| public StreamReadConstraints. Sets the maximum string length (in chars or bytes, depending on input context). The default is 20,000,000. This limit is not exact, the limit is applied when we increase internal buffer sizes and an exception will happen at sizes greater than this limit. Some text values that are a little bigger than the limit may be treated as valid but no text values with sizes less than or equal to this limit will be treated as invalid.
Setting this value to lower than the Note Jackson 2.15.0 initially used a lower setting (5_000_000).
| |
| maxTokenCount | back to summary |
|---|---|
| public StreamReadConstraints. Sets the maximum allowed token count (for positive values over 0) or
indicate that any count is acceptable ( A token is a single unit of input, such as a number, a string, an object start or end, or an array start or end.
| |