Class JsonLineNumberResolver


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

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int getLineNumber​(java.io.File jsonFile, java.lang.String jsonPath)
      Gets the line number from the json file of the given json path.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getLineNumber

        public static int getLineNumber​(java.io.File jsonFile,
                                        java.lang.String jsonPath)
                                 throws java.io.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:
        java.io.IOException - Signals that an I/O exception has occurred