Uses of Class
jsonvalues.JsPath
Packages that use JsPath
Package
Description
The `jsonvalues` package provides a set of classes and interfaces for working with JSON (JavaScript Object Notation)
data in a type-safe and structured manner.
The `jsonvalues.spec` package provides classes and interfaces for defining and working with JSON specifications
(specs) and parsers.
-
Uses of JsPath in jsonvalues
Methods in jsonvalues that return JsPathModifier and TypeMethodDescriptionCreates a new JsPath appending the given path to this path.JsPath.dec()
Returns a new path decrementing the last index by one, throwing an UserError if the last Position is not an indexstatic JsPath
JsPath.empty()
Returns the singleton empty path.static JsPath
JsPath.fromIndex
(int i) Creates a new path from an index.static JsPath
Creates a new path from a key.JsPath.inc()
Returns a new path incrementing the last index by one, throwing an UserError if the last Position is not an indexJsPath.index
(int i) Returns a new path appending an index with the given value to the back of this path.JsPath.init()
Returns a new path without the last Position of this path.Appends a key to the path.JsPath.mapKeys
(UnaryOperator<String> map) Creates a new JsPath applying the given map function to every key of this path.JsPair.path()
Returns the value of thepath
record component.static JsPath
Parses a path from a string following RFC 6901.Creates a new JsPath prepending the given path to this path.JsPath.tail()
Returns a JsPath without the head of this JsPathMethods in jsonvalues with parameters of type JsPathModifier and TypeMethodDescriptionCreates a new JsPath appending the given path to this path.lens that focus on the json array located at a path in an arrayoptional that focus on the array located at a path in an arraylens that focus on a json object located at a path in an object.optional that focus on the array located at a path in an objectfun.optic.Lens
<JsArray, byte[]> lens that focus on an array of bytes located at a path in an arrayfun.optic.Lens
<JsObj, byte[]> lens that focus on an array of bytes located at a path in an object.fun.optic.Option
<JsObj, byte[]> optional that focus on the array of bytes located at a path in an objectlens that focus on the boolean located at a path in an arrayoptional that focus on the boolean located at a path in an arraylens that focus on a boolean located at a path in an object.optional that focus on the boolean located at a path in an objectint
Compares this path with another given as a parameter by comparing in order each of their positions, one by one, until a result different from zero is returned or all the positions of any path are consumed.boolean
returns true if this path contains the given pathdefault boolean
Json.containsPath
(JsPath path) Checks if an element exists in this JSON at the given path.fun.optic.Lens
<JsArray, BigDecimal> JsOptics.JsArrayLenses.decimalNum
(JsPath path) lens that focus on the decimal number located at a path in an arrayfun.optic.Option
<JsArray, BigDecimal> JsOptics.JsArrayOptionals.decimalNum
(JsPath path) optional that focus on the decimal number located at a path in an arrayfun.optic.Lens
<JsObj, BigDecimal> JsOptics.JsObjLenses.decimalNum
(JsPath path) lens that focus on a decimal number located at a path in an object.fun.optic.Option
<JsObj, BigDecimal> JsOptics.JsObjOptional.decimalNum
(JsPath path) optional that focus on the decimal number located at a path in an objectRemoves the element at the specified path within this immutable JSON object, if it exists.lens that focus on the double number located at a path in an arrayoptional that focus on the double number located at a path in an arraylens that focus on a double number located at a path in an object.optional that focus on the double number located at a path in an objectboolean
returns true if this path ends with the given path.Gets the value located at the given path orJsNothing
if it doesn't exist.default JsArray
Returns the array located at the given path or null if it doesn't exist, or it's not an array.default JsArray
Returns the array located at the given path or the default value provided if it doesn't exist, or it's not an array.default BigDecimal
Returns the number located at the given path as a big decimal or null if it doesn't exist, or it's not a decimal number.default BigDecimal
Json.getBigDec
(JsPath path, Supplier<BigDecimal> orElse) Returns the number located at the given path as a big decimal or the default value provided if it doesn't exist, or it's not a decimal number.default BigInteger
Returns the number located at the given path as a big integer or null if it doesn't exist, or it's not an integral number.default BigInteger
Json.getBigInt
(JsPath path, Supplier<BigInteger> orElse) Returns the number located at the given path as a big integer or the default value provided if it doesn't exist, or it's not an integral number.default byte[]
Returns the bytes located at the given path or null if it doesn't exist.default byte[]
Returns the bytes located at the given path or the default value provided if it doesn't exist.default Boolean
Returns the boolean located at the given path or null if it doesn't exist.default boolean
Returns the boolean located at the given path or the default value provided if it doesn't exist.default Double
Returns the decimal number located at the given path as a double or null if it doesn't exist, or it's not a decimal number.default double
Returns the decimal number located at the given path as a double or the default value provided if it doesn't exist, or it's not a decimal number.default Instant
Json.getInstant
(JsPath path) Returns the instant located at the given path or null if it doesn't exist.default Instant
Json.getInstant
(JsPath path, Supplier<Instant> orElse) Returns the instant located at the given path or the default value provided if it doesn't exist.default Integer
Returns the integral number located at the given path as an integer or null if it doesn't exist, or it's not an integral number.default int
Returns the integral number located at the given path as an integer or the default value provided if it doesn't exist, or it's not an integral number.default Long
Returns the integral number located at the given path as a long or null if it doesn't exist, or it's not an integral number.default long
Returns the integral number located at the given path as a long or the default value provided if it doesn't exist, or it's not an integral number.default JsObj
Returns the object located at the given path or null if it doesn't exist, or it's not an object.default JsObj
Returns the object located at the given path or the default value provided if it doesn't exist, or it's not an object.default String
Returns the string located at the given path or null if it doesn't exist, or it's not a string.default String
Returns the string located at the given path or the default value provided if it doesn't exist, or it's not a string.lens that focus on the array of bytes located at a path in an arrayoptional that focus on the instant located at a path in an arraylens that focus on an instant located at a path in an object.optional that focus on the instant located at a path in an objectfun.optic.Lens
<JsArray, BigInteger> JsOptics.JsArrayLenses.integralNum
(JsPath path) lens that focus on the integral number located at a path in an arrayfun.optic.Option
<JsArray, BigInteger> JsOptics.JsArrayOptionals.integralNum
(JsPath path) optional that focus on the integral number located at a path in an arrayfun.optic.Lens
<JsObj, BigInteger> JsOptics.JsObjLenses.integralNum
(JsPath path) lens that focus on an integral number located at a path in an object.fun.optic.Option
<JsObj, BigInteger> JsOptics.JsObjOptional.integralNum
(JsPath path) optional that focus on the integral number located at a path in an objectlens that focus on the integer number located at a path in an arrayoptional that focus on the integer number located at a path in an arraylens that focus on an integer number located at a path in an object.optional that focus on the integer number located at a path in an objectlens that focus on the long number located at a path in an arrayoptional that focus on the long number located at a path in an arraylens that focus on a long number located at a path in an object.optional that focus on the long number located at a path in an objectlens that focus on the JSON object located at a path in an arrayoptional that focus on the object located at a path in an arraylens that focus on a json object located at a path in an object.optional that focus on the object located at a path in an objectstatic JsObj
Static factory method to create one-element JSON objectstatic JsObj
Static factory method to create two-element JSON objectstatic JsObj
Static factory method to create three-element JSON objectstatic JsObj
JsObj.of
(JsPath path1, JsValue el1, JsPath path2, JsValue el2, JsPath path3, JsValue el3, JsPath path4, JsValue el4) Static factory method to create four-element JSON objectstatic JsObj
JsObj.of
(JsPath path1, JsValue el1, JsPath path2, JsValue el2, JsPath path3, JsValue el3, JsPath path4, JsValue el4, JsPath path5, JsValue el5) Static factory method to create five-element JSON objectstatic JsObj
JsObj.of
(JsPath path1, JsValue el1, JsPath path2, JsValue el2, JsPath path3, JsValue el3, JsPath path4, JsValue el4, JsPath path5, JsValue el5, JsPath path6, JsValue el6) Static factory method to create six-element JSON objectstatic JsObj
JsObj.of
(JsPath path1, JsValue el1, JsPath path2, JsValue el2, JsPath path3, JsValue el3, JsPath path4, JsValue el4, JsPath path5, JsValue el5, JsPath path6, JsValue el6, JsPath path7, JsValue el7) Static factory method to create seven-element JSON objectstatic JsObj
JsObj.of
(JsPath path1, JsValue el1, JsPath path2, JsValue el2, JsPath path3, JsValue el3, JsPath path4, JsValue el4, JsPath path5, JsValue el5, JsPath path6, JsValue el6, JsPath path7, JsValue el7, JsPath path8, JsValue el8) Static factory method to create eight-element JSON objectstatic JsObj
JsObj.of
(JsPath path1, JsValue el1, JsPath path2, JsValue el2, JsPath path3, JsValue el3, JsPath path4, JsValue el4, JsPath path5, JsValue el5, JsPath path6, JsValue el6, JsPath path7, JsValue el7, JsPath path8, JsValue el8, JsPath path9, JsValue el9) Static factory method to create nine-element JSON objectstatic JsObj
JsObj.of
(JsPath path1, JsValue el1, JsPath path2, JsValue el2, JsPath path3, JsValue el3, JsPath path4, JsValue el4, JsPath path5, JsValue el5, JsPath path6, JsValue el6, JsPath path7, JsValue el7, JsPath path8, JsValue el8, JsPath path9, JsValue el9, JsPath path10, JsValue el10) Static factory method to create ten-element JSON objectstatic JsObj
JsObj.of
(JsPath path1, JsValue el1, JsPath path2, JsValue el2, JsPath path3, JsValue el3, JsPath path4, JsValue el4, JsPath path5, JsValue el5, JsPath path6, JsValue el6, JsPath path7, JsValue el7, JsPath path8, JsValue el8, JsPath path9, JsValue el9, JsPath path10, JsValue el10, JsPath path11, JsValue el11) Static factory method to create eleven-element JSON objectstatic JsObj
JsObj.of
(JsPath path1, JsValue el1, JsPath path2, JsValue el2, JsPath path3, JsValue el3, JsPath path4, JsValue el4, JsPath path5, JsValue el5, JsPath path6, JsValue el6, JsPath path7, JsValue el7, JsPath path8, JsValue el8, JsPath path9, JsValue el9, JsPath path10, JsValue el10, JsPath path11, JsValue el11, JsPath path12, JsValue el12) Static factory method to create twelve-element JSON objectstatic JsObj
JsObj.of
(JsPath path1, JsValue el1, JsPath path2, JsValue el2, JsPath path3, JsValue el3, JsPath path4, JsValue el4, JsPath path5, JsValue el5, JsPath path6, JsValue el6, JsPath path7, JsValue el7, JsPath path8, JsValue el8, JsPath path9, JsValue el9, JsPath path10, JsValue el10, JsPath path11, JsValue el11, JsPath path12, JsValue el12, JsPath path13, JsValue el13) Static factory method to create thirteen-element JSON objectstatic JsObj
JsObj.of
(JsPath path1, JsValue el1, JsPath path2, JsValue el2, JsPath path3, JsValue el3, JsPath path4, JsValue el4, JsPath path5, JsValue el5, JsPath path6, JsValue el6, JsPath path7, JsValue el7, JsPath path8, JsValue el8, JsPath path9, JsValue el9, JsPath path10, JsValue el10, JsPath path11, JsValue el11, JsPath path12, JsValue el12, JsPath path13, JsValue el13, JsPath path14, JsValue el14) Static factory method to create fourteen-element JSON objectstatic JsObj
JsObj.of
(JsPath path1, JsValue el1, JsPath path2, JsValue el2, JsPath path3, JsValue el3, JsPath path4, JsValue el4, JsPath path5, JsValue el5, JsPath path6, JsValue el6, JsPath path7, JsValue el7, JsPath path8, JsValue el8, JsPath path9, JsValue el9, JsPath path10, JsValue el10, JsPath path11, JsValue el11, JsPath path12, JsValue el12, JsPath path13, JsValue el13, JsPath path14, JsValue el14, JsPath path15, JsValue el15) Static factory method to create fifteen-element JSON objectstatic JsObj
JsObj.of
(JsPath path1, JsValue el1, JsPath path2, JsValue el2, JsPath path3, JsValue el3, JsPath path4, JsValue el4, JsPath path5, JsValue el5, JsPath path6, JsValue el6, JsPath path7, JsValue el7, JsPath path8, JsValue el8, JsPath path9, JsValue el9, JsPath path10, JsValue el10, JsPath path11, JsValue el11, JsPath path12, JsValue el12, JsPath path13, JsValue el13, JsPath path14, JsValue el14, JsPath path15, JsValue el15, JsPath path16, JsValue el16) Static factory method to create sixteen-element JSON objectstatic JsObj
JsObj.of
(JsPath path1, JsValue el1, JsPath path2, JsValue el2, JsPath path3, JsValue el3, JsPath path4, JsValue el4, JsPath path5, JsValue el5, JsPath path6, JsValue el6, JsPath path7, JsValue el7, JsPath path8, JsValue el8, JsPath path9, JsValue el9, JsPath path10, JsValue el10, JsPath path11, JsValue el11, JsPath path12, JsValue el12, JsPath path13, JsValue el13, JsPath path14, JsValue el14, JsPath path15, JsValue el15, JsPath path16, JsValue el16, JsPath path17, JsValue el17) Static factory method to create seventeen-element JSON objectstatic JsObj
JsObj.of
(JsPath path1, JsValue el1, JsPath path2, JsValue el2, JsPath path3, JsValue el3, JsPath path4, JsValue el4, JsPath path5, JsValue el5, JsPath path6, JsValue el6, JsPath path7, JsValue el7, JsPath path8, JsValue el8, JsPath path9, JsValue el9, JsPath path10, JsValue el10, JsPath path11, JsValue el11, JsPath path12, JsValue el12, JsPath path13, JsValue el13, JsPath path14, JsValue el14, JsPath path15, JsValue el15, JsPath path16, JsValue el16, JsPath path17, JsValue el17, JsPath path18, JsValue el18) Static factory method to create eighteen-element JSON objectstatic JsObj
JsObj.of
(JsPath path1, JsValue el1, JsPath path2, JsValue el2, JsPath path3, JsValue el3, JsPath path4, JsValue el4, JsPath path5, JsValue el5, JsPath path6, JsValue el6, JsPath path7, JsValue el7, JsPath path8, JsValue el8, JsPath path9, JsValue el9, JsPath path10, JsValue el10, JsPath path11, JsValue el11, JsPath path12, JsValue el12, JsPath path13, JsValue el13, JsPath path14, JsValue el14, JsPath path15, JsValue el15, JsPath path16, JsValue el16, JsPath path17, JsValue el17, JsPath path18, JsValue el18, JsPath path19, JsValue el19) Static factory method to create nineteen-element JSON objectstatic JsObj
JsObj.of
(JsPath path1, JsValue el1, JsPath path2, JsValue el2, JsPath path3, JsValue el3, JsPath path4, JsValue el4, JsPath path5, JsValue el5, JsPath path6, JsValue el6, JsPath path7, JsValue el7, JsPath path8, JsValue el8, JsPath path9, JsValue el9, JsPath path10, JsValue el10, JsPath path11, JsValue el11, JsPath path12, JsValue el12, JsPath path13, JsValue el13, JsPath path14, JsValue el14, JsPath path15, JsValue el15, JsPath path16, JsValue el16, JsPath path17, JsValue el17, JsPath path18, JsValue el18, JsPath path19, JsValue el19, JsPath path20, JsValue el20) Static factory method to create twenty-element JSON objectstatic UserError
UserError.pathHeadIsNotAKey
(JsPath path) static UserError
UserError.pathHeadIsNotAnIndex
(JsPath path) Creates a new JsPath prepending the given path to this path.Sets the value of the specified path in this JSON object to a boolean value.Sets the value of the specified path in this JSON object to an integer value.Sets the value of the specified path in this JSON object to a long value.Sets the value of the specified path in this JSON object to a Double value.Sets the value of the specified path in this JSON object to a string value.JsObj.set
(JsPath path, BigDecimal value) Sets the value of the specified path in this JSON object to a BigDecimal value.Sets the value of the specified path in this JSON object to an Instant value.default T
Inserts the given element at the specified path in this JSON, replacing any existing element.Inserts an element at the specified path in this JSON, replacing any existing element.boolean
JsPath.startsWith
(JsPath path) returns true if this path starts with the given path.lens that focus on the string located at a path in an arrayoptional that focus on the string located at a path in an arraylens that focus on a string located at a path in an object.optional that focus on the string located at a path in an objectlens that focus on the value located at a path in an arraylens that focus on a value located at a path in an object.Method parameters in jsonvalues with type arguments of type JsPathModifier and TypeMethodDescriptionJsArray.filterKeys
(BiPredicate<? super JsPath, ? super JsValue> filter) JsObj.filterKeys
(BiPredicate<? super JsPath, ? super JsValue> filter) Json.filterKeys
(BiPredicate<? super JsPath, ? super JsValue> filter) Filters all the keys of this json, removing those that don't satisfy the given predicate.JsArray.filterObjs
(BiPredicate<? super JsPath, ? super JsObj> filter) JsObj.filterObjs
(BiPredicate<? super JsPath, ? super JsObj> filter) Json.filterObjs
(BiPredicate<? super JsPath, ? super JsObj> filter) Filters all the pair of jsons of this json, removing those that don't satisfy the given predicate.JsArray.filterValues
(BiPredicate<? super JsPath, ? super JsPrimitive> filter) JsObj.filterValues
(BiPredicate<? super JsPath, ? super JsPrimitive> filter) Json.filterValues
(BiPredicate<? super JsPath, ? super JsPrimitive> filter) Filters all the pairs of elements of this json, removing those that don't satisfy the given predicate.JsArray.mapKeys
(BiFunction<? super JsPath, ? super JsValue, String> fn) JsObj.mapKeys
(BiFunction<? super JsPath, ? super JsValue, String> fn) Json.mapKeys
(BiFunction<? super JsPath, ? super JsValue, String> fn) Maps all the keys of this JSON object, recursively traversing the entire JSON structure.JsArray.mapObjs
(BiFunction<? super JsPath, ? super JsObj, ? extends JsValue> fn) JsObj.mapObjs
(BiFunction<? super JsPath, ? super JsObj, ? extends JsValue> fn) Json.mapObjs
(BiFunction<? super JsPath, ? super JsObj, ? extends JsValue> fn) Maps all the JSON objects of this JSON, traversing the entire JSON if necessary.JsArray.mapValues
(BiFunction<? super JsPath, ? super JsPrimitive, ? extends JsValue> fn) JsObj.mapValues
(BiFunction<? super JsPath, ? super JsPrimitive, ? extends JsValue> fn) Json.mapValues
(BiFunction<? super JsPath, ? super JsPrimitive, ? extends JsValue> fn) Recursively maps all the values of this JSON, replacing each value with the result of applying the given mapping function.<R> R
JsArray.reduce
(BinaryOperator<R> op, BiFunction<? super JsPath, ? super JsPrimitive, R> map, BiPredicate<? super JsPath, ? super JsPrimitive> predicate) <R> R
JsArray.reduce
(BinaryOperator<R> op, BiFunction<? super JsPath, ? super JsPrimitive, R> map, BiPredicate<? super JsPath, ? super JsPrimitive> predicate) <R> R
JsObj.reduce
(BinaryOperator<R> op, BiFunction<? super JsPath, ? super JsPrimitive, R> map, BiPredicate<? super JsPath, ? super JsPrimitive> predicate) <R> R
JsObj.reduce
(BinaryOperator<R> op, BiFunction<? super JsPath, ? super JsPrimitive, R> map, BiPredicate<? super JsPath, ? super JsPrimitive> predicate) <R> R
Json.reduce
(BinaryOperator<R> op, BiFunction<? super JsPath, ? super JsPrimitive, R> map, BiPredicate<? super JsPath, ? super JsPrimitive> predicate) Reduces the values of this JSON object that satisfy the given predicate, allowing access to the element's path.<R> R
Json.reduce
(BinaryOperator<R> op, BiFunction<? super JsPath, ? super JsPrimitive, R> map, BiPredicate<? super JsPath, ? super JsPrimitive> predicate) Reduces the values of this JSON object that satisfy the given predicate, allowing access to the element's path.Constructors in jsonvalues with parameters of type JsPath -
Uses of JsPath in jsonvalues.spec
Fields in jsonvalues.spec declared as JsPathModifier and TypeFieldDescriptionfinal JsPath
SpecError.path
The path where the code occurred within the JSON structure.Methods in jsonvalues.spec with parameters of type JsPathModifier and TypeMethodDescriptionValidates a given JSON object against this JsObjSpec and returns a set of validation errors, if any.Verify if the given JSON value satisfies this spec.Method parameters in jsonvalues.spec with type arguments of type JsPathModifier and TypeMethodDescriptionConverts a JsObjSpec to a JSON object generator with the specified overrides.fun.gen.Gen
<? extends JsValue> Converts a JsSpec to a JSON generator.