Package com.jayway.jsonpath
Enum Option
- java.lang.Object
-
- java.lang.Enum<Option>
-
- com.jayway.jsonpath.Option
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ALWAYS_RETURN_LIST
Makes this implementation more compliant to the Goessner spec.AS_PATH_LIST
Returns a list of path strings representing the path of the evaluation hitsDEFAULT_PATH_LEAF_TO_NULL
returnsnull
for missing leaf.REQUIRE_PROPERTIES
Configures JsonPath to require properties defined in path when anindefinite path is evaluated.SUPPRESS_EXCEPTIONS
Suppress all exceptions when evaluating path.
-
Constructor Summary
Constructors Modifier Constructor Description private
Option()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Option
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static Option[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
DEFAULT_PATH_LEAF_TO_NULL
public static final Option 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
public static final Option ALWAYS_RETURN_LIST
Makes this implementation more compliant to the Goessner spec. All results are returned as Lists.
-
AS_PATH_LIST
public static final Option AS_PATH_LIST
Returns a list of path strings representing the path of the evaluation hits
-
SUPPRESS_EXCEPTIONS
public static final Option 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
public static final Option 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.
-
-
Method Detail
-
values
public static Option[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Option c : Option.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Option valueOf(java.lang.String name)
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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
-