Class PathElement

  • All Implemented Interfaces:
    Serializable

    public class PathElement
    extends Object
    implements Serializable
    Describes an element from an aggregate/array member access path For example, the third element from this path :
    a/c[2]/d[0][5]/x
    is:
    name = "d"
    index = [0, 5] both name and index can be null
    See Also:
    Serialized Form
    • Constructor Detail

      • PathElement

        public PathElement​(String name,
                           int[] index)
    • Method Detail

      • toString

        public String toString()
        Encodes the path element into a string like
         name[idx_1][idx_2]..[idx_n]
         
        Overrides:
        toString in class Object
      • fromString

        public static PathElement fromString​(String s)
        Creates a path element from a string like
         name[idx_1][idx_2]..[idx_n]
         
      • getName

        public String getName()
      • getIndex

        public int[] getIndex()
      • pathToString

        public static String pathToString​(PathElement[] path)
        Transforms the path into a string like
        a/c[2]/d[0][5]/x
        Parameters:
        path -
        Returns: