From 3538f958ab9fb1648e959adb754a4ab3df934457 Mon Sep 17 00:00:00 2001 From: atbest Date: Sat, 25 May 2019 06:25:49 -0400 Subject: [PATCH] Remove slf4j from jsonpath --- .../com/jayway/jsonpath/Configuration.java | 257 +++++++ .../java/com/jayway/jsonpath/Criteria.java | 513 +++++++++++++ .../com/jayway/jsonpath/DocumentContext.java | 18 + .../jayway/jsonpath/EvaluationListener.java | 63 ++ .../main/java/com/jayway/jsonpath/Filter.java | 184 +++++ .../jsonpath/InvalidCriteriaException.java | 33 + .../jayway/jsonpath/InvalidJsonException.java | 58 ++ .../InvalidModificationException.java | 21 + .../jayway/jsonpath/InvalidPathException.java | 34 + .../java/com/jayway/jsonpath/JsonPath.java | 695 ++++++++++++++++++ .../jayway/jsonpath/JsonPathException.java | 33 + .../java/com/jayway/jsonpath/MapFunction.java | 23 + .../main/java/com/jayway/jsonpath/Option.java | 88 +++ .../com/jayway/jsonpath/ParseContext.java | 39 + .../jsonpath/PathNotFoundException.java | 33 + .../java/com/jayway/jsonpath/Predicate.java | 53 ++ .../java/com/jayway/jsonpath/ReadContext.java | 124 ++++ .../java/com/jayway/jsonpath/TypeRef.java | 54 ++ .../jsonpath/ValueCompareException.java | 40 + .../com/jayway/jsonpath/WriteContext.java | 168 +++++ .../jsonpath/internal/CharacterIndex.java | 318 ++++++++ .../jsonpath/internal/DefaultsImpl.java | 37 + .../internal/EvaluationAbortException.java | 13 + .../jsonpath/internal/EvaluationContext.java | 73 ++ .../jayway/jsonpath/internal/JsonContext.java | 216 ++++++ .../jsonpath/internal/JsonFormatter.java | 116 +++ .../jsonpath/internal/ParseContextImpl.java | 83 +++ .../com/jayway/jsonpath/internal/Path.java | 64 ++ .../com/jayway/jsonpath/internal/PathRef.java | 333 +++++++++ .../com/jayway/jsonpath/internal/Utils.java | 406 ++++++++++ .../jsonpath/internal/filter/Evaluator.java | 7 + .../internal/filter/EvaluatorFactory.java | 376 ++++++++++ .../internal/filter/ExpressionNode.java | 24 + .../internal/filter/FilterCompiler.java | 417 +++++++++++ .../filter/LogicalExpressionNode.java | 88 +++ .../internal/filter/LogicalOperator.java | 32 + .../jsonpath/internal/filter/PatternFlag.java | 48 ++ .../filter/RelationalExpressionNode.java | 42 ++ .../internal/filter/RelationalOperator.java | 56 ++ .../jsonpath/internal/filter/ValueNode.java | 216 ++++++ .../jsonpath/internal/filter/ValueNodes.java | 656 +++++++++++++++++ .../jsonpath/internal/function/ParamType.java | 9 + .../jsonpath/internal/function/Parameter.java | 131 ++++ .../function/PassthruPathFunction.java | 19 + .../internal/function/PathFunction.java | 36 + .../function/PathFunctionFactory.java | 78 ++ .../internal/function/json/Append.java | 31 + .../latebinding/ILateBindingValue.java | 31 + .../latebinding/JsonLateBindingValue.java | 43 ++ .../latebinding/PathLateBindingValue.java | 46 ++ .../function/numeric/AbstractAggregation.java | 61 ++ .../internal/function/numeric/Average.java | 26 + .../internal/function/numeric/Max.java | 22 + .../internal/function/numeric/Min.java | 22 + .../function/numeric/StandardDeviation.java | 24 + .../internal/function/numeric/Sum.java | 20 + .../internal/function/text/Concatenate.java | 34 + .../internal/function/text/Length.java | 26 + .../internal/path/ArrayIndexOperation.java | 66 ++ .../internal/path/ArrayIndexToken.java | 52 ++ .../internal/path/ArrayPathToken.java | 50 ++ .../internal/path/ArraySliceOperation.java | 86 +++ .../internal/path/ArraySliceToken.java | 104 +++ .../jsonpath/internal/path/CompiledPath.java | 116 +++ .../internal/path/EvaluationContextImpl.java | 194 +++++ .../internal/path/FunctionPathToken.java | 87 +++ .../jsonpath/internal/path/PathCompiler.java | 623 ++++++++++++++++ .../jsonpath/internal/path/PathToken.java | 221 ++++++ .../internal/path/PathTokenAppender.java | 5 + .../internal/path/PathTokenFactory.java | 52 ++ .../internal/path/PredicateContextImpl.java | 77 ++ .../internal/path/PredicatePathToken.java | 108 +++ .../internal/path/PropertyPathToken.java | 105 +++ .../jsonpath/internal/path/RootPathToken.java | 83 +++ .../jsonpath/internal/path/ScanPathToken.java | 206 ++++++ .../internal/path/WildcardPathToken.java | 62 ++ .../com/jayway/jsonpath/spi/cache/Cache.java | 22 + .../jsonpath/spi/cache/CacheProvider.java | 37 + .../jayway/jsonpath/spi/cache/LRUCache.java | 112 +++ .../jayway/jsonpath/spi/cache/NOOPCache.java | 15 + .../spi/json/AbstractJsonProvider.java | 178 +++++ .../jsonpath/spi/json/GsonJsonProvider.java | 280 +++++++ .../jsonpath/spi/json/JsonProvider.java | 166 +++++ .../spi/json/JsonSmartJsonProvider.java | 94 +++ .../spi/mapper/GsonMappingProvider.java | 82 +++ .../spi/mapper/JsonSmartMappingProvider.java | 263 +++++++ .../jsonpath/spi/mapper/MappingException.java | 28 + .../jsonpath/spi/mapper/MappingProvider.java | 45 ++ 88 files changed, 10430 insertions(+) create mode 100644 app/src/main/java/com/jayway/jsonpath/Configuration.java create mode 100644 app/src/main/java/com/jayway/jsonpath/Criteria.java create mode 100644 app/src/main/java/com/jayway/jsonpath/DocumentContext.java create mode 100644 app/src/main/java/com/jayway/jsonpath/EvaluationListener.java create mode 100644 app/src/main/java/com/jayway/jsonpath/Filter.java create mode 100644 app/src/main/java/com/jayway/jsonpath/InvalidCriteriaException.java create mode 100644 app/src/main/java/com/jayway/jsonpath/InvalidJsonException.java create mode 100644 app/src/main/java/com/jayway/jsonpath/InvalidModificationException.java create mode 100644 app/src/main/java/com/jayway/jsonpath/InvalidPathException.java create mode 100644 app/src/main/java/com/jayway/jsonpath/JsonPath.java create mode 100644 app/src/main/java/com/jayway/jsonpath/JsonPathException.java create mode 100644 app/src/main/java/com/jayway/jsonpath/MapFunction.java create mode 100644 app/src/main/java/com/jayway/jsonpath/Option.java create mode 100644 app/src/main/java/com/jayway/jsonpath/ParseContext.java create mode 100644 app/src/main/java/com/jayway/jsonpath/PathNotFoundException.java create mode 100644 app/src/main/java/com/jayway/jsonpath/Predicate.java create mode 100644 app/src/main/java/com/jayway/jsonpath/ReadContext.java create mode 100644 app/src/main/java/com/jayway/jsonpath/TypeRef.java create mode 100644 app/src/main/java/com/jayway/jsonpath/ValueCompareException.java create mode 100644 app/src/main/java/com/jayway/jsonpath/WriteContext.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/CharacterIndex.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/DefaultsImpl.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/EvaluationAbortException.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/EvaluationContext.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/JsonContext.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/JsonFormatter.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/ParseContextImpl.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/Path.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/PathRef.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/Utils.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/filter/Evaluator.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/filter/EvaluatorFactory.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/filter/ExpressionNode.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/filter/FilterCompiler.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/filter/LogicalExpressionNode.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/filter/LogicalOperator.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/filter/PatternFlag.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/filter/RelationalExpressionNode.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/filter/RelationalOperator.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/filter/ValueNode.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/filter/ValueNodes.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/function/ParamType.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/function/Parameter.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/function/PassthruPathFunction.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/function/PathFunction.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/function/PathFunctionFactory.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/function/json/Append.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/function/latebinding/ILateBindingValue.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/function/latebinding/JsonLateBindingValue.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/function/latebinding/PathLateBindingValue.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/function/numeric/AbstractAggregation.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/function/numeric/Average.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/function/numeric/Max.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/function/numeric/Min.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/function/numeric/StandardDeviation.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/function/numeric/Sum.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/function/text/Concatenate.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/function/text/Length.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/path/ArrayIndexOperation.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/path/ArrayIndexToken.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/path/ArrayPathToken.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/path/ArraySliceOperation.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/path/ArraySliceToken.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/path/CompiledPath.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/path/EvaluationContextImpl.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/path/FunctionPathToken.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/path/PathCompiler.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/path/PathToken.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/path/PathTokenAppender.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/path/PathTokenFactory.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/path/PredicateContextImpl.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/path/PredicatePathToken.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/path/PropertyPathToken.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/path/RootPathToken.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/path/ScanPathToken.java create mode 100644 app/src/main/java/com/jayway/jsonpath/internal/path/WildcardPathToken.java create mode 100644 app/src/main/java/com/jayway/jsonpath/spi/cache/Cache.java create mode 100644 app/src/main/java/com/jayway/jsonpath/spi/cache/CacheProvider.java create mode 100644 app/src/main/java/com/jayway/jsonpath/spi/cache/LRUCache.java create mode 100644 app/src/main/java/com/jayway/jsonpath/spi/cache/NOOPCache.java create mode 100644 app/src/main/java/com/jayway/jsonpath/spi/json/AbstractJsonProvider.java create mode 100644 app/src/main/java/com/jayway/jsonpath/spi/json/GsonJsonProvider.java create mode 100644 app/src/main/java/com/jayway/jsonpath/spi/json/JsonProvider.java create mode 100644 app/src/main/java/com/jayway/jsonpath/spi/json/JsonSmartJsonProvider.java create mode 100644 app/src/main/java/com/jayway/jsonpath/spi/mapper/GsonMappingProvider.java create mode 100644 app/src/main/java/com/jayway/jsonpath/spi/mapper/JsonSmartMappingProvider.java create mode 100644 app/src/main/java/com/jayway/jsonpath/spi/mapper/MappingException.java create mode 100644 app/src/main/java/com/jayway/jsonpath/spi/mapper/MappingProvider.java diff --git a/app/src/main/java/com/jayway/jsonpath/Configuration.java b/app/src/main/java/com/jayway/jsonpath/Configuration.java new file mode 100644 index 000000000..dd59fd708 --- /dev/null +++ b/app/src/main/java/com/jayway/jsonpath/Configuration.java @@ -0,0 +1,257 @@ +/* + * Copyright 2011 the original author or authors. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.jayway.jsonpath; + +import com.jayway.jsonpath.internal.DefaultsImpl; +import com.jayway.jsonpath.spi.json.JsonProvider; +import com.jayway.jsonpath.spi.mapper.MappingProvider; + +import java.util.*; + +import static com.jayway.jsonpath.internal.Utils.notNull; +import static java.util.Arrays.asList; + +/** + * Immutable configuration object + */ +public class Configuration { + + private static Defaults DEFAULTS = null; + + /** + * Set Default configuration + * @param defaults default configuration settings + */ + public static synchronized void setDefaults(Defaults defaults){ + DEFAULTS = defaults; + } + + private static Defaults getEffectiveDefaults(){ + if (DEFAULTS == null) { + return DefaultsImpl.INSTANCE; + } else { + return DEFAULTS; + } + } + + private final JsonProvider jsonProvider; + private final MappingProvider mappingProvider; + private final Set