Class PathLocator


  • public class PathLocator
    extends java.lang.Object
    Searches for paths in a JSONObject and returns those found.

    Traverses the specified JSONObject searching for nodes whose paths (from the root down) match any of the user-specified paths. The paths that match are returned.

    A path to locate must be specified in the n-gram format - a list of keys from the root down separated by dots: K0[[[[.K1].K2].K3]...]
    A key to the right of a dot is a direct child of a key to the left of a dot. Keys with a dot in their name are not supported.

    • Field Detail

      • pathsToFind

        protected java.util.List<java.lang.String> pathsToFind
    • Constructor Detail

      • PathLocator

        public PathLocator​(JSONArray pathsToFind)
      • PathLocator

        public PathLocator​(java.util.List<java.lang.String> pathsToFind)
      • PathLocator

        public PathLocator​(java.lang.String... pathsToFind)