Class Path

java.lang.Object
jodd.json.Path
All Implemented Interfaces:
Cloneable

public final class Path extends Object implements Cloneable
Path to a property from JSON root.
  • Field Details

    • paths

      private CharSequence[] paths
    • index

      private int index
    • altPath

      Path altPath
  • Constructor Details

    • Path

      public Path()
    • Path

      public Path(CharSequence... fields)
      Creates path from given path elements.
    • Path

      private Path(CharSequence[] paths, int index, Path altPath)
  • Method Details

    • parse

      public static Path parse(String path)
      Parses input dot-separated string that represents a path.
    • getAltPath

      public Path getAltPath()
      Returns alternative path.
    • push

      public Path push(CharSequence field)
      Push element to the path.
    • push

      public Path push(CharSequence field, CharSequence altField)
    • _push

      private void _push(CharSequence field)
    • pop

      public CharSequence pop()
      Pop last element from the path.
    • length

      public int length()
      Returns path length.
    • get

      public CharSequence get(int i)
      Returns path chunk at given index.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • clone

      public Path clone()
      Overrides:
      clone in class Object