Top Description Inners Fields Constructors Methods
com.fasterxml.jackson.core

public Class ErrorReportConfiguration

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.io.Serializable

Container for configuration values used when handling errorneous token inputs. For example, unquoted text segments.

Currently default settings are

Since
2.16

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
protected final int
_maxErrorTokenLength

Maximum length of token to include in error messages

protected final int
_maxRawContentLength

Maximum length of raw content to include in error messages

private static ErrorReportConfiguration
public static final int
public static final int
DEFAULT_MAX_RAW_CONTENT_LENGTH

Previously was com.fasterxml.jackson.core.io.ContentReference#DEFAULT_MAX_CONTENT_SNIPPET.

private static final long

Constructor Summary

AccessConstructor and Description
protected
ErrorReportConfiguration(final int maxErrorTokenLength, final int maxRawContentLength)

Method Summary

Modifier and TypeMethod and Description
public static ErrorReportConfiguration.Builder
public static ErrorReportConfiguration

Returns:

the default ErrorReportConfiguration (when none is set on the JsonFactory explicitly)
defaults
()

public int

Returns:

Maximum length of token to include in error messages
getMaxErrorTokenLength
()

Accessor for _maxErrorTokenLength

public int

Returns:

Maximum length of token to include in error messages
getMaxRawContentLength
()

Accessor for _maxRawContentLength

public static void
overrideDefaultErrorReportConfiguration(final ErrorReportConfiguration
new default for ErrorReportConfiguration (a null value will reset to built-in default)
errorReportConfiguration
)

Override the default ErrorReportConfiguration.

public ErrorReportConfiguration.Builder

Returns:

New Builder initialized with settings of configuration instance
rebuild
()

pack-priv static void
validateMaxErrorTokenLength(int
Maximum length of token to include in error messages
maxErrorTokenLength
)

Convenience method that can be used verify valid _maxErrorTokenLength.

pack-priv static void
validateMaxRawContentLength(int maxRawContentLength)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_maxErrorTokenLengthback to summary
protected final int _maxErrorTokenLength

Maximum length of token to include in error messages

See Also
Builder#maxErrorTokenLength(int)
_maxRawContentLengthback to summary
protected final int _maxRawContentLength

Maximum length of raw content to include in error messages

See Also
Builder#maxRawContentLength(int)
DEFAULTback to summary
private static ErrorReportConfiguration DEFAULT
DEFAULT_MAX_ERROR_TOKEN_LENGTHback to summary
public static final int DEFAULT_MAX_ERROR_TOKEN_LENGTH

Default value for _maxErrorTokenLength.

DEFAULT_MAX_RAW_CONTENT_LENGTHback to summary
public static final int DEFAULT_MAX_RAW_CONTENT_LENGTH

Previously was com.fasterxml.jackson.core.io.ContentReference#DEFAULT_MAX_CONTENT_SNIPPET. Default value for _maxRawContentLength.

serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

ErrorReportConfigurationback to summary
protected ErrorReportConfiguration(final int maxErrorTokenLength, final int maxRawContentLength)

Method Detail

builderback to summary
public static ErrorReportConfiguration.Builder builder()
defaultsback to summary
public static ErrorReportConfiguration defaults()
Returns:ErrorReportConfiguration

the default ErrorReportConfiguration (when none is set on the JsonFactory explicitly)

See Also
overrideDefaultErrorReportConfiguration(ErrorReportConfiguration)
getMaxErrorTokenLengthback to summary
public int getMaxErrorTokenLength()

Accessor for _maxErrorTokenLength

Returns:int

Maximum length of token to include in error messages

See Also
Builder#maxErrorTokenLength(int)
getMaxRawContentLengthback to summary
public int getMaxRawContentLength()

Accessor for _maxRawContentLength

Returns:int

Maximum length of token to include in error messages

See Also
Builder#maxRawContentLength(int)
overrideDefaultErrorReportConfigurationback to summary
public static void overrideDefaultErrorReportConfiguration(final ErrorReportConfiguration errorReportConfiguration)

Override the default ErrorReportConfiguration. These defaults are only used when JsonFactory instances are not configured with their own ErrorReportConfiguration.

Library maintainers should not set this as it will affect other code that uses Jackson. Library maintainers who want to configure ErrorReportConfiguration for the Jackson usage within their lib should create ObjectMapper instances that have a JsonFactory instance with the required ErrorReportConfiguration.

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.

Parameters
errorReportConfiguration:ErrorReportConfiguration

new default for ErrorReportConfiguration (a null value will reset to built-in default)

See Also
defaults(), builder()
rebuildback to summary
public ErrorReportConfiguration.Builder rebuild()
Returns:ErrorReportConfiguration.Builder

New Builder initialized with settings of configuration instance

validateMaxErrorTokenLengthback to summary
pack-priv static void validateMaxErrorTokenLength(int maxErrorTokenLength) throws IllegalArgumentException

Convenience method that can be used verify valid _maxErrorTokenLength. If invalid value is passed in, IllegalArgumentException is thrown.

Parameters
maxErrorTokenLength:int

Maximum length of token to include in error messages

validateMaxRawContentLengthback to summary
pack-priv static void validateMaxRawContentLength(int maxRawContentLength)
com.fasterxml.jackson.core back to summary

public final Class ErrorReportConfiguration.Builder

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private int
private int

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv
Builder(final int maxErrorTokenLength, final int maxRawContentLength)

pack-priv

Method Summary

Modifier and TypeMethod and Description
public ErrorReportConfiguration
public ErrorReportConfiguration.Builder

Returns:

This factory instance (to allow call chaining)
maxErrorTokenLength
(final int
Maximum error token length setting to use
maxErrorTokenLength
)

public ErrorReportConfiguration.Builder

Returns:

This builder instance (to allow call chaining)
maxRawContentLength
(final int
Maximum raw content setting to use
maxRawContentLength
)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

maxErrorTokenLengthback to summary
private int maxErrorTokenLength
maxRawContentLengthback to summary
private int maxRawContentLength

Constructor Detail

Builderback to summary
pack-priv Builder()
Builderback to summary
pack-priv Builder(final int maxErrorTokenLength, final int maxRawContentLength)
Builderback to summary
pack-priv Builder(ErrorReportConfiguration src)

Method Detail

buildback to summary
public ErrorReportConfiguration build()
maxErrorTokenLengthback to summary
public ErrorReportConfiguration.Builder maxErrorTokenLength(final int maxErrorTokenLength)
Parameters
maxErrorTokenLength:int

Maximum error token length setting to use

Returns:ErrorReportConfiguration.Builder

This factory instance (to allow call chaining)

Exceptions
IllegalArgumentException:
if maxErrorTokenLength is less than 0
maxRawContentLengthback to summary
public ErrorReportConfiguration.Builder maxRawContentLength(final int maxRawContentLength)
Parameters
maxRawContentLength:int

Maximum raw content setting to use

Returns:ErrorReportConfiguration.Builder

This builder instance (to allow call chaining)

See Also
ErrorReportConfiguration#_maxRawContentLength