public class CensorshipSerializer extends com.fasterxml.jackson.databind.JsonSerializer<String> implements com.fasterxml.jackson.databind.ser.ContextualSerializer
@Sensitive(mask="some pattern") annotation
will be masked accordingly.| Constructor and Description |
|---|
CensorshipSerializer()
The default constructor creates a serializer with no mask.
|
CensorshipSerializer(String mask,
char maskingCharacter)
This constructor creates a serializer with the specified mask and masking character.
|
| Modifier and Type | Method and Description |
|---|---|
com.fasterxml.jackson.databind.JsonSerializer<?> |
createContextual(com.fasterxml.jackson.databind.SerializerProvider provider,
com.fasterxml.jackson.databind.BeanProperty property) |
void |
serialize(String value,
com.fasterxml.jackson.core.JsonGenerator generator,
com.fasterxml.jackson.databind.SerializerProvider provider) |
public CensorshipSerializer()
public CensorshipSerializer(String mask, char maskingCharacter)
mask - The pattern to be used to mask the sensitive attribute.maskingCharacter - The character to be used for masking.public com.fasterxml.jackson.databind.JsonSerializer<?> createContextual(com.fasterxml.jackson.databind.SerializerProvider provider,
com.fasterxml.jackson.databind.BeanProperty property)
throws com.fasterxml.jackson.databind.JsonMappingException
createContextual in interface com.fasterxml.jackson.databind.ser.ContextualSerializercom.fasterxml.jackson.databind.JsonMappingExceptionpublic void serialize(String value, com.fasterxml.jackson.core.JsonGenerator generator, com.fasterxml.jackson.databind.SerializerProvider provider) throws IOException, com.fasterxml.jackson.core.JsonProcessingException
serialize in class com.fasterxml.jackson.databind.JsonSerializer<String>IOExceptioncom.fasterxml.jackson.core.JsonProcessingExceptionCopyright © 2015 Crater Dog Technologies(TM). All rights reserved.