@FunctionalInterface public interface FieldMasker
Invoked by MaskingJsonGenerator after a field name is written
(but before the field's value is known)
to determine if the field's value should be masked.
ValueMaskerFieldMaskers are more efficient than ValueMaskers, since FieldMaskers do not inspect values.FieldMaskers can mask any type of JSON field (string, number, boolean, array, object), whereas a ValueMasker can only mask string and number values.ValueMaskers can mask element values within an array. FieldMaskers can only mask field values.
| Modifier and Type | Method and Description |
|---|---|
Object |
mask(JsonStreamContext context)
If the field at the JSON stream context's current path should be masked,
then returns the masked value to write as the field's value.
|
Object mask(JsonStreamContext context)
MaskingJsonGenerator will write the returned masked value
as the field's value (instead of the original field's value).
If the JSON stream context's current path should NOT be masked, returns null.
context - the current JSON stream context, which can be used to determine the path within the JSON output.NullNode.instance.
To write , the return MaskingJsonGenerator.MASKCopyright © 2019. All rights reserved.