Package org.kiwiproject.json
Class KiwiJacksonSerializers
java.lang.Object
org.kiwiproject.json.KiwiJacksonSerializers
Custom Jackson serializers.
Jackson databind must be available at runtime.
-
Method Summary
Modifier and TypeMethodDescriptionstatic com.fasterxml.jackson.databind.module.SimpleModulebuildPropertyMaskingSafeSerializerModule(List<String> maskedFieldRegexps) Build a newSimpleModulethat will replace the values of specific fields with a "masked" value and will replace any exceptions with a message indicating the field could not be serialized.static com.fasterxml.jackson.databind.module.SimpleModuleBuild a newSimpleModulethat will replace the values of specific fields with a "masked" value and will replace any exceptions with a message indicating the field could not be serialized.
-
Method Details
-
buildPropertyMaskingSafeSerializerModule
public static com.fasterxml.jackson.databind.module.SimpleModule buildPropertyMaskingSafeSerializerModule(List<String> maskedFieldRegexps) Build a newSimpleModulethat will replace the values of specific fields with a "masked" value and will replace any exceptions with a message indicating the field could not be serialized.Uses the default replacement text provided by
PropertyMaskingOptions.- Parameters:
maskedFieldRegexps- list containing regular expressions that define the properties to mask- Returns:
- a new
SimpleModule
-
buildPropertyMaskingSafeSerializerModule
public static com.fasterxml.jackson.databind.module.SimpleModule buildPropertyMaskingSafeSerializerModule(PropertyMaskingOptions options) Build a newSimpleModulethat will replace the values of specific fields with a "masked" value and will replace any exceptions with a message indicating the field could not be serialized.- Parameters:
options- the specific masking and serialization error options to use- Returns:
- a new
SimpleModule - Implementation Note:
- Per the docs for
BeanSerializerModifier.changeProperties(SerializationConfig, BeanDescription, List)the returned list is mutable.
-