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
ConfObject
ConfObject[]
where each element is either of the typeConfTag
orConfKey
. To determine which type ainstanceof
test 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
ConstructorDescriptionInstancePath
(ConfObject[] kp) Initializes a new instance of this class from a given reverted ConfObject[] keypath where elements is eitherConfTag
orConfKey
.InstancePath
(MountIdInterface mountGetter, ConfObject[] kp) Initialize a InstancePath.Initialize a InstancePath. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.encode()
Returns the path encoded as an ConfEList.Returns the path as ConfEList in IKP format.boolean
Returns MaapiSchemas node corresponding to the path.getKP()
Returns an array ofConfTag
andConfKey
objects which represents the path in reverted order.int
hashCode()
Returns a hash code value for the path.boolean
isKey()
boolean
boolean
isRel()
Check if this is a relative path.void
setMountIdGetter
(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 eitherConfTag
orConfKey
.- 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
ConfTag
andConfKey
objects 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
ConfException
is thrown.The
ConfKey
is composed of the properConfValue
types 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.
-
atoString
Deprecated.This is a deprecated method. It returns the string representation of the erlang type encoded path.- Returns:
- Erlang encoded path string
-
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 ofConfTag
andConfKey
. -
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
-