Class ReplaceInterceptor
java.lang.Object
com.predic8.membrane.core.interceptor.AbstractInterceptor
com.predic8.membrane.core.interceptor.json.ReplaceInterceptor
- All Implemented Interfaces:
Interceptor
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.predic8.membrane.core.interceptor.Interceptor
Interceptor.Flow -
Field Summary
Fields inherited from class com.predic8.membrane.core.interceptor.AbstractInterceptor
name, router -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetWith()handleRequest(Exchange exc) handleResponse(Exchange exc) voidsetJsonPath(String jsonPath) Sets the JSONPath expression to identify the target node in the JSON structure.voidSets the replacement value for the node specified by the JSONPath.Methods inherited from class com.predic8.membrane.core.interceptor.AbstractInterceptor
getDisplayName, getFlow, getHelpId, getLongDescription, getMessage, getRouter, getRule, getShortDescription, handleAbort, init, init, setDisplayName, setFlow
-
Constructor Details
-
ReplaceInterceptor
public ReplaceInterceptor()
-
-
Method Details
-
handleRequest
- Specified by:
handleRequestin interfaceInterceptor- Overrides:
handleRequestin classAbstractInterceptor- Throws:
Exception
-
handleResponse
- Specified by:
handleResponsein interfaceInterceptor- Overrides:
handleResponsein classAbstractInterceptor- Throws:
Exception
-
setJsonPath
Sets the JSONPath expression to identify the target node in the JSON structure.- Parameters:
jsonPath- the JSONPath expression (e.g., "$.person.name").
-
setWith
Sets the replacement value for the node specified by the JSONPath.- Parameters:
with- the new value to replace the existing one.
-
getJsonPath
-
getWith
-