Class JsonLineNumberResolver

java.lang.Object
io.github.astrapi69.jsonpath.JsonLineNumberResolver

public final class JsonLineNumberResolver extends Object
The class JsonLineNumberResolver provides algorithms for resolve the line number in a json File with a json path
  • Method Details

    • getLineNumber

      public static int getLineNumber(File jsonFile, String jsonPath) throws IOException
      Gets the line number from the json file of the given json path.
      Parameters:
      jsonFile - the json file
      jsonPath - the json path
      Returns:
      the line number or -1 if not found or if the given json path matches more than once
      Throws:
      IOException - Signals that an I/O exception has occurred