Package com.adaptris.core.json.path
Class JsonPathBuilder
java.lang.Object
com.adaptris.core.json.path.JsonPathBuilder
- All Implemented Interfaces:
PathBuilder
@ComponentProfile(summary="json builder to extract and insert",
tag="service,security,path",
since="5.0.0")
public class JsonPathBuilder
extends Object
implements PathBuilder
Extracts and inserts values from message payload using defined Json Paths
String
.
This component simple extracts and inserts values from a JSON file using JSON paths. While not coupled with
PayloadPathEncryptionService
and PayloadPathDecryptionService
this component was built to be used with those two
services.
It's important to note that to keep the JSON valid you can only configure a path to a single JSON object. for example in the
simple example below:
You could define the following JSON path: "$.name".
{"name":"James", "age":30, "car":"Vauxhall"}
In the adapter configuration file this class is aliased as json-path-builder which is the preferred alternative to the fully qualified classname when building your configuration.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionextract
(AdaptrisMessage msg) void
insert
(AdaptrisMessage msg, Map<String, String> pathKeyValuePairs) void
setJsonPaths
(List<String> jsonPaths)
-
Constructor Details
-
JsonPathBuilder
public JsonPathBuilder()
-
-
Method Details
-
extract
- Specified by:
extract
in interfacePathBuilder
- Throws:
ServiceException
-
insert
public void insert(AdaptrisMessage msg, Map<String, String> pathKeyValuePairs) throws ServiceException- Specified by:
insert
in interfacePathBuilder
- Throws:
ServiceException
-
getJsonPaths
-
setJsonPaths
-