Package com.jayway.jsonpath
Enum Option
- All Implemented Interfaces:
Serializable
,Comparable<Option>
,java.lang.constant.Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionMakes this implementation more compliant to the Goessner spec.Returns a list of path strings representing the path of the evaluation hitsreturnsnull
for missing leaf.Configures JsonPath to require properties defined in path when anindefinite path is evaluated.Suppress all exceptions when evaluating path. -
Constructor Summary
Constructors -
Method Summary
-
Enum Constant Details
-
DEFAULT_PATH_LEAF_TO_NULL
returnsnull
for missing leaf.[ { "foo" : "foo1", "bar" : "bar1" } { "foo" : "foo2" } ]
the path : "$[*].bar" Without flag ["bar1"] is returned With flag ["bar1", null] is returned -
ALWAYS_RETURN_LIST
Makes this implementation more compliant to the Goessner spec. All results are returned as Lists. -
AS_PATH_LIST
Returns a list of path strings representing the path of the evaluation hits -
SUPPRESS_EXCEPTIONS
Suppress all exceptions when evaluating path.
If an exception is thrown and the optionALWAYS_RETURN_LIST
an empty list is returned. If an exception is thrown and the optionALWAYS_RETURN_LIST
is not present null is returned. -
REQUIRE_PROPERTIES
Configures JsonPath to require properties defined in path when anindefinite path is evaluated. Given:[ { "a" : "a-val", "b" : "b-val" }, { "a" : "a-val", } ]
evaluating the path "$[*].b" If REQUIRE_PROPERTIES option is present PathNotFoundException is thrown. If REQUIRE_PROPERTIES option is not present ["b-val"] is returned.
-
-
Constructor Details
-
Option
private Option()
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-