Package sk.antons.json.match
Class SimplePathMatcher
- java.lang.Object
-
- sk.antons.json.match.SimplePathMatcher
-
- All Implemented Interfaces:
PathMatcher
public class SimplePathMatcher extends Object implements PathMatcher
Check path with provided sequence of string values. Asterix character can be used for any name in path. ["items", "*", "name"] can match paths in length 3 starting with items and ending with name.- Author:
- antons
-
-
Constructor Summary
Constructors Constructor Description SimplePathMatcher(String... path)SimplePathMatcher(List<String> path)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SimplePathMatcherinstance(String... path)static SimplePathMatcherinstance(List<String> path)Matchmatch(List<String> currentpath, JsonValue currentvalue)Returns result of match
-
-
-
Method Detail
-
instance
public static SimplePathMatcher instance(List<String> path)
-
instance
public static SimplePathMatcher instance(String... path)
-
match
public Match match(List<String> currentpath, JsonValue currentvalue)
Description copied from interface:PathMatcherReturns result of match- Specified by:
matchin interfacePathMatcher- Parameters:
currentpath- path to be checkedcurrentvalue- value to be checked (be prepare for null values for traversal parsers)- Returns:
- result of match operation.
-
-