title: How to print jsonpath for json object
body: <p>I am looking for java API which prints jsonpath for all fields in json object. My 1st part of requirement is like, for given json object (or string) - </p>
  
  <pre><code>{
  "store": {
      "book": [
          {
              "category": "reference",
              "author": "Nigel Rees",
              "title": "Sayings of the Century",
              "price": 8.95
          },
          {
              "category": "fiction",
              "author": "Evelyn Waugh",
              "title": "Sword of Honour",
              "price": 12.99
          }
  }
  </code></pre>
  
  <p>it should print all properties in key-value manner where key is jsonpath of the field.</p>
  
  <p>the output should look something like below - </p>
  
  <pre><code>$.store.book[0].category=reference
  $.store.book[0].author=Nigel Rees
  $.store.book[0].title=Sayings of the Century
  $.store.book[0].price=8.95
  $.store.book[1].category=fiction
  $.store.book[1].author=Evelyn Waugh
  $.store.book[1].title=Sword of Honour
  $.store.book[1].price=12.99
  </code></pre>
  
  <p>and so on. this will be used to match values from another json object (my 2nd requirement). </p>
  
  <p>I found an API <a href="https://github.com/json-path/JsonPath" rel="nofollow noreferrer">https://github.com/json-path/JsonPath</a> which is somewhat fits to 2nd part of my requirement but is does not have any utility method or a method to get JsonPath for a object or field.</p>
  
  <p>Is there any java api or method in jsonpath where I can get jsonpath for given field in json object?</p>