Class ConfPath

Object
com.tailf.conf.InstancePath
com.tailf.conf.ConfPath
Direct Known Subclasses:
ConfCdbUpgradePath

public class ConfPath extends InstancePath

Class Representing an KeyPath path.

String representations e.g "/n:rootA/nodeB/listC{key1}/leafD" User applications usually needs to construct string representations of paths in this way. To construct a ConfPath from this representation use ConfPath(String, Object...)

  • Constructor Details

    • ConfPath

      public ConfPath(MountIdInterface mountGetter, List<com.tailf.conf.gen.PathParser.PathElement> pl)
    • ConfPath

      public ConfPath(ConfEBinary o) throws ConfException
      Initialize a ConfPath. (This constructor is rarely used for applications; usually for internal use)
      Parameters:
      o - element constitute a ConfPath
      Throws:
      ConfException
    • ConfPath

      public ConfPath(ConfEList o)
      Initialize a ConfPath. (This constructor is rarely used for applications; usually for internal uses)
      Parameters:
      o - element (reversed) constitute a ConfPath
    • ConfPath

      public ConfPath(String fmt, Object... arguments) throws ConfException

      Construct a ConfPath from a string path representation and of optional arguments.

      The path is expressed as a format string that could contain fixed text with zero to many embedded format specifiers.

      For each specifier one argument in the variable argument list is expected.

      format specifiers in the Java API is:
      • %d - requiring an integer parameter (type int) to be substituted.

      • %s - requiring a java.lang.String parameter to be substituted.

      • %x - requiring subclasses of type com.tailf.conf.ConfValue to be substituted.

      Parameters:
      fmt - path string representation
      arguments - optional parameters for substitution in fmt
      Throws:
      ConfException
    • ConfPath

      public ConfPath(Cdb cdb, String fmt, Object... arguments) throws ConfException
      Throws:
      ConfException
    • ConfPath

      public ConfPath(Maapi maapi, int tid, String fmt, Object... arguments) throws ConfException
      Throws:
      ConfException
    • ConfPath

      public ConfPath(MountIdInterface mountIdCb, String fmt, Object... arguments) throws ConfException
      Throws:
      ConfException
    • ConfPath

      public ConfPath(ConfObject[] kp)
      Initializes a new instance of this class from a given reverted ConfObject[] keypath where elements is either ConfTag or ConfKey.
      Parameters:
      kp - reverted keypath
    • ConfPath

      public ConfPath(Cdb cdb, ConfObject[] kp)
    • ConfPath

      public ConfPath(Maapi maapi, int tid, ConfObject[] kp) throws ConfException
      Throws:
      ConfException
    • ConfPath

      public ConfPath(MountIdInterface mountIdCb, ConfObject[] kp)
    • ConfPath

      public ConfPath(ConfPath confPath)
  • Method Details

    • toString

      public String toString()
      Default String representation of this path, which is the keypath string representation
      Overrides:
      toString in class InstancePath
      Returns:
      Default string representation
    • clone

      public Object clone()
      Clones the ConfPath
    • append

      public ConfPath append(String s) throws ConfException
      Appends suffix path to existing keypath
      Parameters:
      s - path to append
      Throws:
      ConfException
    • append

      public ConfPath append(String s, List<MaapiSchemas.CSNode> pathNodes) throws ConfException
      Appends suffix path to existing keypath
      Parameters:
      s - path to append
      pathNodes - sorted list of all CSNode objects contained in the resulting ConfPath object after appending s. This list is used as a cache to speedup ConfPath construction.
      Throws:
      ConfException
    • copyAppend

      public ConfPath copyAppend(String s) throws ConfException
      CopyAppends to the keypath
      Throws:
      ConfException
    • pop

      public void pop() throws ConfException
      Pops the last element from the path including list keys.
      Throws:
      ConfException
    • copyPop

      public ConfPath copyPop() throws ConfException
      Creates a new ConfPath with the current path minus the last element including list keys.
      Throws:
      ConfException
    • toXPathString

      public String toXPathString()
      Returns this path as an XPath string
      Overrides:
      toXPathString in class InstancePath
      Returns:
      XPath string representation