public static class CapturingPointers.Builder extends Object
CapturingPointers
.Modifier and Type | Method and Description |
---|---|
CapturingPointers.Builder |
addDirectMemberName(String directMemberName)
Adds a direct member name as a pointer to capture.
|
CapturingPointers.Builder |
addJsonPointer(JsonPointer jsonPointer)
Adds a JSON Pointer to capture.
|
CapturingPointers.Builder |
addJsonPointer(String jsonPointer)
Adds a JSON Pointer to capture.
|
CapturingPointers |
build()
Builds "capturing pointers".
|
public CapturingPointers.Builder addDirectMemberName(String directMemberName)
It works only for a JSON object. It captures a JSON value that is directly under the root JSON object with the member name.
For example for the following JSON object {"foo": 12, "bar": 34, "baz": 56}
, "foo"
as
a direct member name would capture 12
, and "bar"
would capture 34
.
directMemberName
- the direct member name to capturepublic CapturingPointers.Builder addJsonPointer(String jsonPointer)
It captures a JSON value that is pointed by the JSON Pointer.
For example for the following JSON object {"foo": {"bar": 12}, "baz": 56}
, "/foo/bar"
as a JSON Pointer would capture 12
, and "/foo"
would capture {"bar": 12}
.
jsonPointer
- the JSON Pointer to captureIllegalArgumentException
- if the input does not present a valid JSON Pointer expressionpublic CapturingPointers.Builder addJsonPointer(JsonPointer jsonPointer)
It captures a JSON value that is pointed by the JSON Pointer.
For example for the following JSON object {"foo": {"bar": 12}, "baz": 56}
, "/foo/bar"
as a JSON Pointer would capture 12
, and "/foo"
would capture {"bar": 12}
.
jsonPointer
- the JSON Pointer to capturepublic CapturingPointers build()