Package org.apache.johnzon.jsonlogic
Class JohnzonJsonLogic
- java.lang.Object
-
- org.apache.johnzon.jsonlogic.JohnzonJsonLogic
-
public class JohnzonJsonLogic extends Object
-
-
Field Summary
Fields Modifier and Type Field Description private jakarta.json.JsonBuilderFactory
builderFactory
private boolean
cacheJsonMergePatches
private boolean
cacheJsonPatches
private boolean
cachePointers
private Map<jakarta.json.JsonValue,jakarta.json.JsonMergePatch>
jsonMergePatches
private Map<jakarta.json.JsonArray,jakarta.json.JsonPatch>
jsonPatches
private Map<String,Operator>
operators
private Map<String,jakarta.json.JsonPointer>
pointers
private jakarta.json.spi.JsonProvider
provider
-
Constructor Summary
Constructors Constructor Description JohnzonJsonLogic()
JohnzonJsonLogic(jakarta.json.spi.JsonProvider provider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private jakarta.json.JsonValue
andImpl(JohnzonJsonLogic logic, jakarta.json.JsonValue config, jakarta.json.JsonValue params)
jakarta.json.JsonValue
apply(jakarta.json.JsonValue logic, jakarta.json.JsonValue args)
CompletionStage<jakarta.json.JsonValue>
applyStage(jakarta.json.JsonValue logic, jakarta.json.JsonValue args)
boolean
areEqualsWithCoercion(jakarta.json.JsonValue a, jakarta.json.JsonValue b)
private jakarta.json.JsonValue
arrayTest(JohnzonJsonLogic self, jakarta.json.JsonValue config, jakarta.json.JsonValue params, BiPredicate<jakarta.json.JsonValue,Stream<jakarta.json.JsonValue>> tester)
JohnzonJsonLogic
cacheJsonMergePatches()
JohnzonJsonLogic
cacheJsonPatches()
JohnzonJsonLogic
cachePointers()
private jakarta.json.JsonValue
castToNumber(jakarta.json.JsonValue value)
private jakarta.json.JsonValue
catImpl(JohnzonJsonLogic logic, jakarta.json.JsonValue config, jakarta.json.JsonValue params)
private jakarta.json.JsonValue
comparison(BiPredicate<jakarta.json.JsonValue,jakarta.json.JsonValue> comparator, jakarta.json.JsonValue config, JohnzonJsonLogic self, jakarta.json.JsonValue params)
private jakarta.json.JsonValue
divideImpl(JohnzonJsonLogic logic, jakarta.json.JsonValue config, jakarta.json.JsonValue params)
private jakarta.json.JsonPointer
doToPointer(String string)
private jakarta.json.JsonValue
extractValue(jakarta.json.JsonValue params, String string)
private jakarta.json.JsonValue
filterImpl(JohnzonJsonLogic logic, jakarta.json.JsonValue config, jakarta.json.JsonValue params)
private jakarta.json.JsonMergePatch
getJsonMergePatch(jakarta.json.JsonValue config)
private jakarta.json.JsonPatch
getJsonPatch(jakarta.json.JsonValue config)
private jakarta.json.JsonValue
ifImpl(JohnzonJsonLogic logic, jakarta.json.JsonValue config, jakarta.json.JsonValue params)
private jakarta.json.JsonValue
inImpl(JohnzonJsonLogic logic, jakarta.json.JsonValue config, jakarta.json.JsonValue params)
private IllegalArgumentException
invalidArgument(Set<String> keys)
boolean
isFalsy(jakarta.json.JsonValue value)
boolean
isTruthy(jakarta.json.JsonValue value)
private jakarta.json.JsonValue
mapImpl(JohnzonJsonLogic logic, jakarta.json.JsonValue config, jakarta.json.JsonValue params)
private DoubleStream
mapToDouble(JohnzonJsonLogic logic, jakarta.json.JsonValue config, jakarta.json.JsonValue params)
private jakarta.json.JsonValue
maxImpl(JohnzonJsonLogic logic, jakarta.json.JsonValue config, jakarta.json.JsonValue params)
private jakarta.json.JsonValue
mergeImpl(jakarta.json.JsonValue config)
private jakarta.json.JsonValue
minImpl(JohnzonJsonLogic logic, jakarta.json.JsonValue config, jakarta.json.JsonValue params)
private jakarta.json.JsonValue
minusImpl(JohnzonJsonLogic logic, jakarta.json.JsonValue config, jakarta.json.JsonValue params)
private jakarta.json.JsonValue
missingImpl(JohnzonJsonLogic logic, jakarta.json.JsonValue config, jakarta.json.JsonValue params)
private IllegalArgumentException
missingOperator(String operator)
private jakarta.json.JsonValue
missingSomeImpl(JohnzonJsonLogic logic, jakarta.json.JsonValue config, jakarta.json.JsonValue params)
private jakarta.json.JsonValue
moduloImpl(JohnzonJsonLogic logic, jakarta.json.JsonValue config, jakarta.json.JsonValue params)
private jakarta.json.JsonValue
multiplyImpl(JohnzonJsonLogic logic, jakarta.json.JsonValue config, jakarta.json.JsonValue params)
private jakarta.json.JsonValue
notImpl(JohnzonJsonLogic logic, jakarta.json.JsonValue config, jakarta.json.JsonValue params)
private jakarta.json.JsonValue
numericComparison(BiPredicate<Double,Double> comparator, jakarta.json.JsonValue config, JohnzonJsonLogic self, jakarta.json.JsonValue params)
private jakarta.json.JsonValue
orImpl(JohnzonJsonLogic logic, jakarta.json.JsonValue config, jakarta.json.JsonValue params)
private jakarta.json.JsonValue
plusImpl(JohnzonJsonLogic logic, jakarta.json.JsonValue config, jakarta.json.JsonValue params)
private jakarta.json.JsonValue
reduceImpl(JohnzonJsonLogic logic, jakarta.json.JsonValue config, jakarta.json.JsonValue params)
JohnzonJsonLogic
registerDefaultOperators()
JohnzonJsonLogic
registerExtensionsOperators()
JohnzonJsonLogic
registerOperator(String name, Operator impl)
private jakarta.json.JsonValue
substrImpl(JohnzonJsonLogic logic, jakarta.json.JsonValue config, jakarta.json.JsonValue params)
private Collector<jakarta.json.JsonValue,jakarta.json.JsonArrayBuilder,jakarta.json.JsonArray>
toArray()
private jakarta.json.JsonValue
toBooleanImpl(JohnzonJsonLogic logic, jakarta.json.JsonValue config, jakarta.json.JsonValue params)
private jakarta.json.JsonPointer
toPointer(String string)
private jakarta.json.JsonValue
varImpl(jakarta.json.JsonValue config, jakarta.json.JsonValue params)
-
-
-
Field Detail
-
provider
private final jakarta.json.spi.JsonProvider provider
-
jsonPatches
private final Map<jakarta.json.JsonArray,jakarta.json.JsonPatch> jsonPatches
-
jsonMergePatches
private final Map<jakarta.json.JsonValue,jakarta.json.JsonMergePatch> jsonMergePatches
-
builderFactory
private final jakarta.json.JsonBuilderFactory builderFactory
-
cachePointers
private boolean cachePointers
-
cacheJsonPatches
private boolean cacheJsonPatches
-
cacheJsonMergePatches
private boolean cacheJsonMergePatches
-
-
Method Detail
-
cachePointers
public JohnzonJsonLogic cachePointers()
-
cacheJsonPatches
public JohnzonJsonLogic cacheJsonPatches()
-
cacheJsonMergePatches
public JohnzonJsonLogic cacheJsonMergePatches()
-
registerOperator
public JohnzonJsonLogic registerOperator(String name, Operator impl)
-
apply
public jakarta.json.JsonValue apply(jakarta.json.JsonValue logic, jakarta.json.JsonValue args)
-
applyStage
public CompletionStage<jakarta.json.JsonValue> applyStage(jakarta.json.JsonValue logic, jakarta.json.JsonValue args)
-
isTruthy
public boolean isTruthy(jakarta.json.JsonValue value)
-
isFalsy
public boolean isFalsy(jakarta.json.JsonValue value)
-
areEqualsWithCoercion
public boolean areEqualsWithCoercion(jakarta.json.JsonValue a, jakarta.json.JsonValue b)
-
registerExtensionsOperators
public JohnzonJsonLogic registerExtensionsOperators()
-
getJsonPatch
private jakarta.json.JsonPatch getJsonPatch(jakarta.json.JsonValue config)
-
getJsonMergePatch
private jakarta.json.JsonMergePatch getJsonMergePatch(jakarta.json.JsonValue config)
-
registerDefaultOperators
public JohnzonJsonLogic registerDefaultOperators()
-
invalidArgument
private IllegalArgumentException invalidArgument(Set<String> keys)
-
missingOperator
private IllegalArgumentException missingOperator(String operator)
-
minImpl
private jakarta.json.JsonValue minImpl(JohnzonJsonLogic logic, jakarta.json.JsonValue config, jakarta.json.JsonValue params)
-
maxImpl
private jakarta.json.JsonValue maxImpl(JohnzonJsonLogic logic, jakarta.json.JsonValue config, jakarta.json.JsonValue params)
-
plusImpl
private jakarta.json.JsonValue plusImpl(JohnzonJsonLogic logic, jakarta.json.JsonValue config, jakarta.json.JsonValue params)
-
multiplyImpl
private jakarta.json.JsonValue multiplyImpl(JohnzonJsonLogic logic, jakarta.json.JsonValue config, jakarta.json.JsonValue params)
-
minusImpl
private jakarta.json.JsonValue minusImpl(JohnzonJsonLogic logic, jakarta.json.JsonValue config, jakarta.json.JsonValue params)
-
divideImpl
private jakarta.json.JsonValue divideImpl(JohnzonJsonLogic logic, jakarta.json.JsonValue config, jakarta.json.JsonValue params)
-
moduloImpl
private jakarta.json.JsonValue moduloImpl(JohnzonJsonLogic logic, jakarta.json.JsonValue config, jakarta.json.JsonValue params)
-
mapImpl
private jakarta.json.JsonValue mapImpl(JohnzonJsonLogic logic, jakarta.json.JsonValue config, jakarta.json.JsonValue params)
-
filterImpl
private jakarta.json.JsonValue filterImpl(JohnzonJsonLogic logic, jakarta.json.JsonValue config, jakarta.json.JsonValue params)
-
mergeImpl
private jakarta.json.JsonValue mergeImpl(jakarta.json.JsonValue config)
-
substrImpl
private jakarta.json.JsonValue substrImpl(JohnzonJsonLogic logic, jakarta.json.JsonValue config, jakarta.json.JsonValue params)
-
catImpl
private jakarta.json.JsonValue catImpl(JohnzonJsonLogic logic, jakarta.json.JsonValue config, jakarta.json.JsonValue params)
-
inImpl
private jakarta.json.JsonValue inImpl(JohnzonJsonLogic logic, jakarta.json.JsonValue config, jakarta.json.JsonValue params)
-
reduceImpl
private jakarta.json.JsonValue reduceImpl(JohnzonJsonLogic logic, jakarta.json.JsonValue config, jakarta.json.JsonValue params)
-
andImpl
private jakarta.json.JsonValue andImpl(JohnzonJsonLogic logic, jakarta.json.JsonValue config, jakarta.json.JsonValue params)
-
orImpl
private jakarta.json.JsonValue orImpl(JohnzonJsonLogic logic, jakarta.json.JsonValue config, jakarta.json.JsonValue params)
-
toBooleanImpl
private jakarta.json.JsonValue toBooleanImpl(JohnzonJsonLogic logic, jakarta.json.JsonValue config, jakarta.json.JsonValue params)
-
notImpl
private jakarta.json.JsonValue notImpl(JohnzonJsonLogic logic, jakarta.json.JsonValue config, jakarta.json.JsonValue params)
-
ifImpl
private jakarta.json.JsonValue ifImpl(JohnzonJsonLogic logic, jakarta.json.JsonValue config, jakarta.json.JsonValue params)
-
missingSomeImpl
private jakarta.json.JsonValue missingSomeImpl(JohnzonJsonLogic logic, jakarta.json.JsonValue config, jakarta.json.JsonValue params)
-
missingImpl
private jakarta.json.JsonValue missingImpl(JohnzonJsonLogic logic, jakarta.json.JsonValue config, jakarta.json.JsonValue params)
-
arrayTest
private jakarta.json.JsonValue arrayTest(JohnzonJsonLogic self, jakarta.json.JsonValue config, jakarta.json.JsonValue params, BiPredicate<jakarta.json.JsonValue,Stream<jakarta.json.JsonValue>> tester)
-
castToNumber
private jakarta.json.JsonValue castToNumber(jakarta.json.JsonValue value)
-
mapToDouble
private DoubleStream mapToDouble(JohnzonJsonLogic logic, jakarta.json.JsonValue config, jakarta.json.JsonValue params)
-
comparison
private jakarta.json.JsonValue comparison(BiPredicate<jakarta.json.JsonValue,jakarta.json.JsonValue> comparator, jakarta.json.JsonValue config, JohnzonJsonLogic self, jakarta.json.JsonValue params)
-
numericComparison
private jakarta.json.JsonValue numericComparison(BiPredicate<Double,Double> comparator, jakarta.json.JsonValue config, JohnzonJsonLogic self, jakarta.json.JsonValue params)
-
varImpl
private jakarta.json.JsonValue varImpl(jakarta.json.JsonValue config, jakarta.json.JsonValue params)
-
extractValue
private jakarta.json.JsonValue extractValue(jakarta.json.JsonValue params, String string)
-
toPointer
private jakarta.json.JsonPointer toPointer(String string)
-
doToPointer
private jakarta.json.JsonPointer doToPointer(String string)
-
toArray
private Collector<jakarta.json.JsonValue,jakarta.json.JsonArrayBuilder,jakarta.json.JsonArray> toArray()
-
-