title: How to get in Java all output paths of a JSONpath in order to replace existing values by a function of themseleves
body: <p>Let's say I have this .json on witch I want to apply a function that round up the price of the book:</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
          },
          {
              "category": "fiction",
              "author": "Herman Melville",
              "title": "Moby Dick",
              "isbn": "0-553-21311-3",
              "price": 8.99
          },
          {
              "category": "fiction",
              "author": "J. R. R. Tolkien",
              "title": "The Lord of the Rings",
              "isbn": "0-395-19395-8",
              "price": 22.99
          }
      ],
      "bicycle": {
          "color": "red",
          "price": 19.95
      }
  },
  "expensive": 10
  }
  </code></pre>
  
  <p>The idea I had for doing that was to specify the jsonpath</p>
  
  <pre><code>$.store.book[*].price
  </code></pre>
  
  <p>and get in return the list of ouput path (like on this website: <a href="https://jsonpath.com/" rel="nofollow noreferrer">https://jsonpath.com/</a> )</p>
  
  <pre><code>[ "$.store.book[0].price", "$.store.book[1].price", "$.store.book[2].price", "$.store.book[3].price" ]
  </code></pre>
  
  <p>or even better a direct mapping between the path and the value</p>
  
  <pre><code>[ {"$.store.book[0].price":8.95}, {"$.store.book[1].price":12.99}, {"$.store.book[2].price":8.99}, {"$.store.book[3].price":22.99} ]
  </code></pre>
  
  <p>and then making a loop over the list to apply the function on each value and setting the json with the new value</p>
  
  <p>But i can't find how to get that list of path, how can i do that ? (or if you have something to directly replace the value by a function of themselves, i would take it too :) )</p>
  
  <p>PS: the .json I give is just an example, I need it for .json way more nested than that</p>