Package org.springframework.boot.json
Interface JsonWriter.ValueProcessor<T>
- Type Parameters:
- T- the value type
- Enclosing interface:
- JsonWriter<T>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
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.- 
Method SummaryModifier and TypeMethodDescriptionstatic <T> JsonWriter.ValueProcessor<T>of(Class<? extends T> type, UnaryOperator<T> action) Factory method to crate a newJsonWriter.ValueProcessorthat applies the given action.static <T> JsonWriter.ValueProcessor<T>of(UnaryOperator<T> action) Factory method to crate a newJsonWriter.ValueProcessorthat 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.
- 
Method Details- 
processValueProcess the value at the given path.- Parameters:
- path- the path of the member containing the value
- value- the value being written (may be- null)
- Returns:
- the processed value
 
- 
whenHasUnescapedPathReturn a new processor from this one that only applied to members with the given path (ignoring escape characters).- Parameters:
- path- the patch to match
- Returns:
- a new JsonWriter.ValueProcessorthat only applies when the path matches
 
- 
whenHasPathReturn a new processor from this one that only applied to members with the given path.- Parameters:
- path- the patch to match
- Returns:
- a new JsonWriter.ValueProcessorthat only applies when the path matches
 
- 
whenHasPathReturn a new processor from this one that only applied to members that match the given path predicate.- Parameters:
- predicate- the predicate that must match
- Returns:
- a new JsonWriter.ValueProcessorthat only applies when the predicate matches
 
- 
whenInstanceOfReturn a new processor from this one that only applies to member with values of the given type.- Parameters:
- type- the type that must match
- Returns:
- a new JsonWriter.ValueProcessorthat only applies when value is the given type.
 
- 
whenReturn a new processor from this one that only applies to member with values that match the given predicate.- Parameters:
- predicate- the predicate that must match
- Returns:
- a new JsonWriter.ValueProcessorthat only applies when the predicate matches
 
- 
ofFactory method to crate a newJsonWriter.ValueProcessorthat applies the given action.- Type Parameters:
- T- the value type
- Parameters:
- type- the value type
- action- the action to apply
- Returns:
- a new JsonWriter.ValueProcessorinstance
 
- 
ofFactory method to crate a newJsonWriter.ValueProcessorthat applies the given action.- Type Parameters:
- T- the value type
- Parameters:
- action- the action to apply
- Returns:
- a new JsonWriter.ValueProcessorinstance
 
 
-