public class JacksonFeature extends JaxrsFeatureBag<JacksonFeature> implements Feature
JAXRS_FEATURE
Constructor and Description |
---|
JacksonFeature()
Default constructor enables registering Jackson's exception mappers
|
Modifier and Type | Method and Description |
---|---|
boolean |
configure(FeatureContext context) |
JacksonFeature |
jaxrsFeature(JaxRSFeature feature,
boolean state)
Register
JaxRSFeature with the Jackson providers. |
JacksonFeature |
maxStringLength(int maxStringLength)
Sets the
MessageProperties.JSON_MAX_STRING_LENGTH property to a provided value. |
static JacksonFeature |
withExceptionMappers()
Create JacksonFeature with working Jackson's exception mappers
|
static JacksonFeature |
withoutExceptionMappers()
Create JacksonFeature without registered Jackson's exception mappers
|
hasJaxrsFeature
public JacksonFeature()
public static JacksonFeature withExceptionMappers()
public static JacksonFeature withoutExceptionMappers()
public JacksonFeature maxStringLength(int maxStringLength)
Sets the MessageProperties.JSON_MAX_STRING_LENGTH
property to a provided value. The property value already
configured
takes priority.
Both uses of maxStringLength(int)
and MessageProperties.JSON_MAX_STRING_LENGTH
override
StreamReadConstraints defined on Jackson's ObjectMapper's JsonFactory
provided via
ContextResolver<ObjectMapper>
.
maxStringLength
- the integer value to override the default Jackson's
StreamReadConstraints.DEFAULT_MAX_STRING_LEN
.StreamReadConstraints.DEFAULT_MAX_STRING_LEN
set.public JacksonFeature jaxrsFeature(JaxRSFeature feature, boolean state)
JaxRSFeature
with the Jackson providers.jaxrsFeature
in class JaxrsFeatureBag<JacksonFeature>
feature
- the JaxRSFeature
to be enabled or disabled.state
- true
for enabling the feature, false
for disabling.JaxRSFeature
registered to be set on a created Jackson provider.public boolean configure(FeatureContext context)
Copyright © 2007-2024, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.