Package com.fasterxml.jackson.core
Class ErrorReportConfiguration
- java.lang.Object
-
- com.fasterxml.jackson.core.ErrorReportConfiguration
-
- All Implemented Interfaces:
java.io.Serializable
public class ErrorReportConfiguration extends java.lang.Object implements java.io.SerializableContainer for configuration values used when handling errorneous token inputs. For example, unquoted text segments.Currently default settings are
- Maximum length of token to include in error messages (see
_maxErrorTokenLength) - Maximum length of raw content to include in error messages (see
_maxRawContentLength)
- Since:
- 2.16
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classErrorReportConfiguration.Builder
-
Field Summary
Fields Modifier and Type Field Description protected int_maxErrorTokenLengthMaximum length of token to include in error messagesprotected int_maxRawContentLengthMaximum length of raw content to include in error messagesprivate static ErrorReportConfigurationDEFAULTstatic intDEFAULT_MAX_ERROR_TOKEN_LENGTHDefault value for_maxErrorTokenLength.static intDEFAULT_MAX_RAW_CONTENT_LENGTHPreviously wascom.fasterxml.jackson.core.io.ContentReference#DEFAULT_MAX_CONTENT_SNIPPET.private static longserialVersionUID
-
Constructor Summary
Constructors Modifier Constructor Description protectedErrorReportConfiguration(int maxErrorTokenLength, int maxRawContentLength)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ErrorReportConfiguration.Builderbuilder()static ErrorReportConfigurationdefaults()intgetMaxErrorTokenLength()Accessor for_maxErrorTokenLengthintgetMaxRawContentLength()Accessor for_maxRawContentLengthstatic voidoverrideDefaultErrorReportConfiguration(ErrorReportConfiguration errorReportConfiguration)Override the default ErrorReportConfiguration.ErrorReportConfiguration.Builderrebuild()(package private) static voidvalidateMaxErrorTokenLength(int maxErrorTokenLength)Convenience method that can be used verify valid_maxErrorTokenLength.(package private) static voidvalidateMaxRawContentLength(int maxRawContentLength)
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
DEFAULT_MAX_ERROR_TOKEN_LENGTH
public static final int DEFAULT_MAX_ERROR_TOKEN_LENGTH
Default value for_maxErrorTokenLength.- See Also:
- Constant Field Values
-
DEFAULT_MAX_RAW_CONTENT_LENGTH
public static final int DEFAULT_MAX_RAW_CONTENT_LENGTH
Previously wascom.fasterxml.jackson.core.io.ContentReference#DEFAULT_MAX_CONTENT_SNIPPET. Default value for_maxRawContentLength.- See Also:
- Constant Field Values
-
_maxErrorTokenLength
protected final int _maxErrorTokenLength
Maximum length of token to include in error messages
-
_maxRawContentLength
protected final int _maxRawContentLength
Maximum length of raw content to include in error messages
-
DEFAULT
private static ErrorReportConfiguration DEFAULT
-
-
Method Detail
-
overrideDefaultErrorReportConfiguration
public static void overrideDefaultErrorReportConfiguration(ErrorReportConfiguration errorReportConfiguration)
Override the default ErrorReportConfiguration. These defaults are only used whenJsonFactoryinstances 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
ObjectMapperinstances that have aJsonFactoryinstance 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- new default for ErrorReportConfiguration (a null value will reset to built-in default)- See Also:
defaults(),builder()
-
builder
public static ErrorReportConfiguration.Builder builder()
-
defaults
public static ErrorReportConfiguration defaults()
- Returns:
- the default
ErrorReportConfiguration(when none is set on theJsonFactoryexplicitly) - See Also:
overrideDefaultErrorReportConfiguration(ErrorReportConfiguration)
-
rebuild
public ErrorReportConfiguration.Builder rebuild()
- Returns:
- New
ErrorReportConfiguration.Builderinitialized with settings of configuration instance
-
getMaxErrorTokenLength
public int getMaxErrorTokenLength()
Accessor for_maxErrorTokenLength- Returns:
- Maximum length of token to include in error messages
- See Also:
ErrorReportConfiguration.Builder.maxErrorTokenLength(int)
-
getMaxRawContentLength
public int getMaxRawContentLength()
Accessor for_maxRawContentLength- Returns:
- Maximum length of token to include in error messages
- See Also:
ErrorReportConfiguration.Builder.maxRawContentLength(int)
-
validateMaxErrorTokenLength
static void validateMaxErrorTokenLength(int maxErrorTokenLength) throws java.lang.IllegalArgumentExceptionConvenience method that can be used verify valid_maxErrorTokenLength. If invalid value is passed in,IllegalArgumentExceptionis thrown.- Parameters:
maxErrorTokenLength- Maximum length of token to include in error messages- Throws:
java.lang.IllegalArgumentException
-
validateMaxRawContentLength
static void validateMaxRawContentLength(int maxRawContentLength)
-
-