Package jodd.json

Class Path

  • All Implemented Interfaces:
    java.lang.Cloneable

    public final class Path
    extends java.lang.Object
    implements java.lang.Cloneable
    Path to a property from JSON root.
    • Constructor Summary

      Constructors 
      Constructor Description
      Path()  
      Path​(java.lang.CharSequence... fields)
      Creates path from given path elements.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Path clone()  
      boolean equals​(java.lang.Object o)  
      java.lang.CharSequence get​(int i)
      Returns path chunk at given index.
      Path getAltPath()
      Returns alternative path.
      int hashCode()  
      int length()
      Returns path length.
      static Path parse​(java.lang.String path)
      Parses input dot-separated string that represents a path.
      java.lang.CharSequence pop()
      Pop last element from the path.
      Path push​(java.lang.CharSequence field)
      Push element to the path.
      Path push​(java.lang.CharSequence field, java.lang.CharSequence altField)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Path

        public Path()
      • Path

        public Path​(java.lang.CharSequence... fields)
        Creates path from given path elements.
    • Method Detail

      • parse

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

        public Path getAltPath()
        Returns alternative path.
      • push

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

        public Path push​(java.lang.CharSequence field,
                         java.lang.CharSequence altField)
      • pop

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

        public int length()
        Returns path length.
      • get

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

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

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

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

        public Path clone()
        Overrides:
        clone in class java.lang.Object