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 Details

    • SimplePathMatcher

      public SimplePathMatcher(List<String> path)
    • SimplePathMatcher

      public SimplePathMatcher(String... path)
  • Method Details

    • 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: PathMatcher
      Returns result of match
      Specified by:
      match in interface PathMatcher
      Parameters:
      currentpath - path to be checked
      currentvalue - value to be checked (be prepare for null values for traversal parsers)
      Returns:
      result of match operation.