Package org.sdase.commons.server.jackson
Class JacksonConfigurationBundle.Builder
java.lang.Object
org.sdase.commons.server.jackson.JacksonConfigurationBundle.Builder
- Enclosing class:
- JacksonConfigurationBundle
-
Method Summary
Modifier and TypeMethodDescriptionRegisters a default serializer forZonedDateTime
that renders 3 digits of milliseconds.Registers a default serializer forZonedDateTime
that renders no milliseconds.build()
withCustomization
(Consumer<com.fasterxml.jackson.databind.ObjectMapper> customizer) Allows customization of the usedObjectMapper
.Disables the field filter entirely.Skips registration of the HAL module.
-
Method Details
-
withoutHalSupport
Skips registration of the HAL module. This may be used when links and embedded resources are not required or are achieved with other tooling.- Returns:
- the builder
-
withoutFieldFilter
Disables the field filter entirely. The field filter may be used by clients to request only a subset of the properties of a resource and has to be activated withEnableFieldFilter
for each resource.- Returns:
- the builder
-
withCustomization
public JacksonConfigurationBundle.Builder withCustomization(Consumer<com.fasterxml.jackson.databind.ObjectMapper> customizer) Allows customization of the usedObjectMapper
. More customizers may be added by calling this method multiple times.- Parameters:
customizer
- receives the usedObjectMapper
for customization, e.g. to enable or disable specific features or configure formatting.- Returns:
- the builder
-
alwaysWriteZonedDateTimeWithMillis
Registers a default serializer forZonedDateTime
that renders 3 digits of milliseconds. The same serializer may be configured per field as documented inIso8601Serializer.WithMillis
.This setting overwrites the default behaviour of Jackson which omits milliseconds if they are zero or adds nanoseconds if they are set.
- Returns:
- the builder
-
alwaysWriteZonedDateTimeWithoutMillis
Registers a default serializer forZonedDateTime
that renders no milliseconds. The same serializer may be configured per field as documented inIso8601Serializer
.This setting overwrites the default behaviour of Jackson which omits milliseconds if they are zero or adds nanoseconds if they are set.
- Returns:
- the builder
-
build
-