接口 JsonWriter.ValueProcessor<T>
- 类型参数:
T
- the value type
- 封闭接口:
JsonWriter<T>
- 函数接口:
- 这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。
Callback interface that can be
applied
to JsonWriter.Members
to process values before they are written. Typically used to filter values, for
example to reduce superfluous information or sanitize sensitive data.-
方法概要
修饰符和类型方法说明static <T> JsonWriter.ValueProcessor
<T> of
(Class<? extends T> type, UnaryOperator<T> action) Factory method to crate a newJsonWriter.ValueProcessor
that applies the given action.static <T> JsonWriter.ValueProcessor
<T> of
(UnaryOperator<T> action) Factory method to crate a newJsonWriter.ValueProcessor
that applies the given action.processValue
(JsonWriter.MemberPath path, T value) Process the value at the given path.default JsonWriter.ValueProcessor
<T> Return a new processor from this one that only applies to member with values that match the given predicate.default JsonWriter.ValueProcessor
<T> whenHasPath
(String path) Return a new processor from this one that only applied to members with the given path.default JsonWriter.ValueProcessor
<T> whenHasPath
(Predicate<JsonWriter.MemberPath> predicate) Return a new processor from this one that only applied to members that match the given path predicate.default JsonWriter.ValueProcessor
<T> whenHasUnescapedPath
(String path) Return a new processor from this one that only applied to members with the given path (ignoring escape characters).default JsonWriter.ValueProcessor
<T> whenInstanceOf
(Class<?> type) Return a new processor from this one that only applies to member with values of the given type.
-
方法详细资料
-
processValue
Process the value at the given path.- 参数:
path
- the path of the member containing the valuevalue
- the value being written (may benull
)- 返回:
- the processed value
-
whenHasUnescapedPath
Return a new processor from this one that only applied to members with the given path (ignoring escape characters).- 参数:
path
- the patch to match- 返回:
- a new
JsonWriter.ValueProcessor
that only applies when the path matches
-
whenHasPath
Return a new processor from this one that only applied to members with the given path.- 参数:
path
- the patch to match- 返回:
- a new
JsonWriter.ValueProcessor
that only applies when the path matches
-
whenHasPath
Return a new processor from this one that only applied to members that match the given path predicate.- 参数:
predicate
- the predicate that must match- 返回:
- a new
JsonWriter.ValueProcessor
that only applies when the predicate matches
-
whenInstanceOf
Return a new processor from this one that only applies to member with values of the given type.- 参数:
type
- the type that must match- 返回:
- a new
JsonWriter.ValueProcessor
that only applies when value is the given type.
-
when
Return a new processor from this one that only applies to member with values that match the given predicate.- 参数:
predicate
- the predicate that must match- 返回:
- a new
JsonWriter.ValueProcessor
that only applies when the predicate matches
-
of
Factory method to crate a newJsonWriter.ValueProcessor
that applies the given action.- 类型参数:
T
- the value type- 参数:
type
- the value typeaction
- the action to apply- 返回:
- a new
JsonWriter.ValueProcessor
instance
-
of
Factory method to crate a newJsonWriter.ValueProcessor
that applies the given action.- 类型参数:
T
- the value type- 参数:
action
- the action to apply- 返回:
- a new
JsonWriter.ValueProcessor
instance
-