Package sk.antons.json.match.wild
Class WildPathMatcher
- java.lang.Object
-
- sk.antons.json.match.wild.WildPathMatcher
-
- All Implemented Interfaces:
PathMatcher
public class WildPathMatcher extends Object implements PathMatcher
Check path with provided sequence of string values. Double asterix character can be used for any subpath in path. Single asterix and question mark can be used for substrings in path element. ["items-*", "**", "name"] can match paths in length >=2 starting with items-and ending with name. ( /items-12/foo/bar/name) - Author:
- antons
-
-
Constructor Summary
Constructors Constructor Description WildPathMatcher(String... path)WildPathMatcher(List<String> path)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static WildPathMatcherfromPath(String path)static WildPathMatcherinstance(String... path)static WildPathMatcherinstance(List<String> path)Matchmatch(List<String> currentpath, JsonValue currentvalue)Returns result of matchMatchtryMatch(List<String> currentpath, int element, int path)
-
-
-
Method Detail
-
instance
public static WildPathMatcher instance(List<String> path)
-
instance
public static WildPathMatcher instance(String... path)
-
fromPath
public static WildPathMatcher fromPath(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.
-
-