Package org.kiwiproject.json
Class KiwiJacksonSerializers
- java.lang.Object
-
- org.kiwiproject.json.KiwiJacksonSerializers
-
public class KiwiJacksonSerializers extends Object
Custom Jackson serializers.Jackson databind must be available at runtime.
-
-
Constructor Summary
Constructors Constructor Description KiwiJacksonSerializers()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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.SimpleModulebuildPropertyMaskingSafeSerializerModule(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.
-
-
-
Method Detail
-
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.
-
-