Class InstancePath
Class Representing an path. A Path can be either a schema path or an instance path. A schema path points to an element in the model while an instance path points to an element in the instantiated model.
The difference is that in the instance tree both elements and data values are needed to point out a instance element.
There are several ways to represent a path which are supported by
this class. The two most important being as a String or as a array of
ConfTag/ConfKey values.
Instance of
ConfEList- Applications usually does not have to deal with paths that are instances ofConfEList.
Constructors that have this type is usually for internal use:InstancePath(ConfEBinary),InstancePath(ConfEList),InstancePath(ConfObject[])Reverted array of
ConfObjectConfObject[]where each element is either of the typeConfTagorConfKey. To determine which type ainstanceoftest is required. Usually the application need to deal with this representations in different callback implementations and it is always reverted. The library invokes the user defined callbacks with this type of representation as one of the parameters.Application is seldom required to construct such arrays.
-
Constructor Summary
ConstructorsConstructorDescriptionInstancePath(ConfObject[] kp) Initializes a new instance of this class from a given reverted ConfObject[] keypath where elements is eitherConfTagorConfKey.InstancePath(MountIdInterface mountGetter, ConfObject[] kp) Initialize a InstancePath.Initialize a InstancePath. -
Method Summary
Modifier and TypeMethodDescriptionencode()Returns the path encoded as an ConfEList.Returns the path as ConfEList in IKP format.booleanReturns MaapiSchemas node corresponding to the path.getKP()Returns an array ofConfTagandConfKeyobjects which represents the path in reverted order.static final ConfObject[]getKP(List<com.tailf.conf.gen.PathParser.PathElement> pl, boolean isRel, boolean hasSchema, MountIdInterface mountGetter) inthashCode()Returns a hash code value for the path.booleanisKey()booleanbooleanisRel()Check if this is a relative path.voidsetMountIdGetter(MountIdInterface mountGetter) toString()Returns this path object as an XPath string.
-
Constructor Details
-
InstancePath
Initialize a InstancePath. (This constructor is rarely used for applications; usually for internal use)- Parameters:
o- element constitute aInstancePath- Throws:
ConfException
-
InstancePath
Initialize a InstancePath. (This constructor is rarely used for applications; usually for internal uses)- Parameters:
o- element (reversed) constitute aInstancePath
-
InstancePath
Initializes a new instance of this class from a given reverted ConfObject[] keypath where elements is eitherConfTagorConfKey.- Parameters:
kp- reverted keypath
-
InstancePath
-
-
Method Details
-
encode
Returns the path encoded as an ConfEList. This method is used internally.- Returns:
- ConfEList representation of this path
-
encodeIKP
Returns the path as ConfEList in IKP format. This method is used internally.- Returns:
- ConfEList representation of this path
-
getKP
Returns an array of
ConfTagandConfKeyobjects which represents the path in reverted order.This method requires that the path is absolute and that the schema prefix for the root element is defined, if not a
ConfExceptionis thrown.The
ConfKeyis composed of the properConfValuetypes which are determined by the loaded schema. However, if this the schema information is not available, and the type therefore cannot be determined the key elements are defaulted toConfBinary.- Returns:
- reverted array representation of this
InstancePath - Throws:
ConfException- If schema information is not loaded, the path is not valid or the parsed path has no namespace information.
-
getKP
public static final ConfObject[] getKP(List<com.tailf.conf.gen.PathParser.PathElement> pl, boolean isRel, boolean hasSchema, MountIdInterface mountGetter) throws ConfException - Throws:
ConfException
-
isKey
public boolean isKey() -
toString
-
isRel
public boolean isRel()Check if this is a relative path.- Returns:
- true if this is a relative path
-
toXPathString
Returns this path object as an XPath string.- Returns:
- XPath String representation
-
equals
-
hashCode
public int hashCode()Returns a hash code value for the path. This method is supported for the benefit of hash tables such as those provided byjava.util.Hashtable. The hash code is calculated from its component ofConfTagandConfKey. -
getCSNode
Returns MaapiSchemas node corresponding to the path. The path needs to be absolute and MaapiSchemas need to be loaded.- Returns:
- CSNode if the node exists in the schema, null otherwise
-
getMountIdGetter
-
setMountIdGetter
- Throws:
ConfException
-
isParsingDeferred
public boolean isParsingDeferred() -
getLatestMountId
-