public static class DefaultJsonDeserializationContext.Builder extends Object
JsonDeserializationContext. To override default settings globally, you can extend this class, modify the
default settings inside the constructor and tell the compiler to use your builder instead in your gwt.xml file :
<replace-with class="your.package.YourBuilder">
<when-type-assignable class="org.dominokit.jacksonapt.JsonDeserializationContext.Builder" />
</replace-with>
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
acceptSingleValueAsArray |
protected boolean |
failOnUnknownProperties |
protected boolean |
readUnknownEnumValuesAsNull |
protected boolean |
unwrapRootValue |
protected boolean |
useBrowserTimezone |
protected boolean |
useSafeEval |
protected boolean |
wrapExceptions |
| Constructor and Description |
|---|
Builder()
Deprecated.
Use
DefaultJsonDeserializationContext.builder() instead. This constructor will be made protected in v1.0. |
| Modifier and Type | Method and Description |
|---|---|
DefaultJsonDeserializationContext.Builder |
acceptSingleValueAsArray(boolean acceptSingleValueAsArray)
Feature that determines whether it is acceptable to coerce non-array
(in JSON) values to work with Java collection (arrays, java.util.Collection)
types.
|
JsonDeserializationContext |
build() |
DefaultJsonDeserializationContext.Builder |
failOnUnknownProperties(boolean failOnUnknownProperties)
Determines whether encountering of unknown
properties (ones that do not map to a property, and there is
no "any setter" or handler that can handle it)
should result in a failure (by throwing a
JsonDeserializationException) or not. |
DefaultJsonDeserializationContext.Builder |
readUnknownEnumValuesAsNull(boolean readUnknownEnumValuesAsNull)
Feature that determines whether gwt-jackson should return null for unknown enum values.
|
DefaultJsonDeserializationContext.Builder |
unwrapRootValue(boolean unwrapRootValue)
Feature to allow "unwrapping" root-level JSON value, to match setting of
DefaultJsonSerializationContext.Builder.wrapRootValue(boolean) used for serialization. |
DefaultJsonDeserializationContext.Builder |
useBrowserTimezone(boolean useBrowserTimezone)
Feature that specifies whether dates that doesn't contain timezone information
are interpreted using the browser timezone or being relative to UTC (the default).
|
DefaultJsonDeserializationContext.Builder |
useSafeEval(boolean useSafeEval)
to deserialize JsType
|
DefaultJsonDeserializationContext.Builder |
wrapExceptions(boolean wrapExceptions)
Feature that determines whether gwt-jackson code should catch
and wrap
RuntimeExceptions (but never Errors!)
to add additional information about
location (within input) of problem or not. |
protected boolean failOnUnknownProperties
protected boolean unwrapRootValue
protected boolean acceptSingleValueAsArray
protected boolean wrapExceptions
protected boolean useSafeEval
protected boolean readUnknownEnumValuesAsNull
protected boolean useBrowserTimezone
@Deprecated public Builder()
DefaultJsonDeserializationContext.builder() instead. This constructor will be made protected in v1.0.public DefaultJsonDeserializationContext.Builder failOnUnknownProperties(boolean failOnUnknownProperties)
JsonDeserializationException) or not.
This setting only takes effect after all other handling
methods for unknown properties have been tried, and
property remains unhandled.
Feature is enabled by default (meaning that a
JsonDeserializationException will be thrown if an unknown property
is encountered).
failOnUnknownProperties - true if should fail on unknown propertiespublic DefaultJsonDeserializationContext.Builder unwrapRootValue(boolean unwrapRootValue)
DefaultJsonSerializationContext.Builder.wrapRootValue(boolean) used for serialization.
Will verify that the root JSON value is a JSON Object, and that it has
a single property with expected root name. If not, a
JsonDeserializationException is thrown; otherwise value of the wrapped property
will be deserialized as if it was the root value.
Feature is disabled by default.
unwrapRootValue - true if should unwrapRootValuepublic DefaultJsonDeserializationContext.Builder acceptSingleValueAsArray(boolean acceptSingleValueAsArray)
Feature is disabled by default.
acceptSingleValueAsArray - true if should acceptSingleValueAsArraypublic DefaultJsonDeserializationContext.Builder wrapExceptions(boolean wrapExceptions)
RuntimeExceptions (but never Errors!)
to add additional information about
location (within input) of problem or not. If enabled,
exceptions will be caught and re-thrown; this can be
convenient both in that all exceptions will be checked and
declared, and so there is more contextual information.
However, sometimes calling application may just want "raw"
unchecked exceptions passed as is.
wrapExceptions - true if should wrapExceptionspublic DefaultJsonDeserializationContext.Builder useSafeEval(boolean useSafeEval)
useSafeEval - true if should useSafeEvalpublic DefaultJsonDeserializationContext.Builder readUnknownEnumValuesAsNull(boolean readUnknownEnumValuesAsNull)
IllegalArgumentException when unknown enum value is found.readUnknownEnumValuesAsNull - true if should readUnknownEnumValuesAsNullpublic DefaultJsonDeserializationContext.Builder useBrowserTimezone(boolean useBrowserTimezone)
useBrowserTimezone - true if should use browser timezonepublic final JsonDeserializationContext build()
Copyright © 2019. All rights reserved.