Class JsonPathBuilder
java.lang.Object
de.xima.fc.helper.JsonPathBuilder
- All Implemented Interfaces:
org.apache.commons.lang3.builder.Builder<String>
-
Constructor Summary
ConstructorsConstructorDescriptionJsonPathBuilder(String root) Creates a new JSON path builder with the given root. -
Method Summary
Modifier and TypeMethodDescriptionbuild()enterArray(int index) Adds an array element to the JSON path.enterObject(String fieldName) Adds an object property to the JSON path.leave()Leaves the most recently added array item or object property, i.e. drops it from the path.
-
Constructor Details
-
JsonPathBuilder
Creates a new JSON path builder with the given root.- Parameters:
root- Root of the JSON path expression, usually$.
-
-
Method Details
-
build
-
enterArray
Adds an array element to the JSON path.- Parameters:
index- Index of the array element- Returns:
- This builder for chaining method calls.
-
enterObject
Adds an object property to the JSON path.- Parameters:
fieldName- Key of the object property.- Returns:
- This builder for chaining method calls.
-
leave
Leaves the most recently added array item or object property, i.e. drops it from the path.- Returns:
- This builder for chaining method calls.
-