|
|
|
@ -101,6 +101,8 @@ import static org.apache.commons.lang3.Validate.*;
|
|
|
|
|
*/ |
|
|
|
|
public class JsonPath { |
|
|
|
|
|
|
|
|
|
private static final Logger LOG = LoggerFactory.getLogger(JsonPath.class.getName()); |
|
|
|
|
|
|
|
|
|
private static Pattern DEFINITE_PATH_PATTERN = Pattern.compile(".*(\\.\\.|\\*|\\[[\\\\/]|\\?|,|:\\s?]|\\[\\s?:|>|\\(|<|=|\\+).*"); |
|
|
|
|
private static Pattern INVALID_PATH_PATTERN = Pattern.compile("[^\\?\\+=\\-\\*/!]\\("); |
|
|
|
|
|
|
|
|
@ -108,8 +110,6 @@ public class JsonPath {
|
|
|
|
|
private PathTokenizer tokenizer; |
|
|
|
|
private LinkedList<Filter> filters; |
|
|
|
|
|
|
|
|
|
private final Logger logger = LoggerFactory.getLogger(JsonPath.class); |
|
|
|
|
|
|
|
|
|
private JsonPath(String jsonPath, Filter[] filters) { |
|
|
|
|
|
|
|
|
|
notNull(jsonPath, "path can not be null"); |
|
|
|
@ -126,7 +126,9 @@ public class JsonPath {
|
|
|
|
|
|
|
|
|
|
this.tokenizer = new PathTokenizer(jsonPath); |
|
|
|
|
|
|
|
|
|
logger.debug("New JsonPath:\n{}", this.tokenizer); |
|
|
|
|
if(LOG.isDebugEnabled()){ |
|
|
|
|
LOG.debug("New JsonPath:\n{}", this.tokenizer.toString()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this.filters = new LinkedList<Filter>(); |
|
|
|
|
this.filters.addAll(asList(filters)); |
|
|
|
|