Interface ReferenceNodeHandler
-
- All Superinterfaces:
NodeHandler<ImmutableNode>
- All Known Implementing Classes:
TreeData
public interface ReferenceNodeHandler extends NodeHandler<ImmutableNode>
An extension of the
NodeHandler
interface which allows access to so-called references stored for a node.Some specialized configuration implementations needs to store additional data for the nodes representing configuration properties. This interface provides methods for querying this data. For instance, it is possible to query a reference object stored for a specific node.
InMemoryNodeModel
supports references. It can be queried for aReferenceNodeHandler
which can then be used for dealing with references.- Since:
- 2.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Object
getReference(ImmutableNode node)
Gets the reference object associated with the specified node.java.util.List<java.lang.Object>
removedReferences()
Returns a list with the reference objects for nodes which have been removed.-
Methods inherited from interface org.apache.commons.configuration2.tree.NodeHandler
getAttributes, getAttributeValue, getChild, getChildren, getChildren, getChildrenCount, getMatchingChildren, getMatchingChildrenCount, getParent, getRootNode, getValue, hasAttributes, indexOfChild, isDefined, nodeName
-
-
-
-
Method Detail
-
getReference
java.lang.Object getReference(ImmutableNode node)
Gets the reference object associated with the specified node. If no reference data is associated with this node, result is null.- Parameters:
node
- the node in question- Returns:
- the reference object for this node or null
-
removedReferences
java.util.List<java.lang.Object> removedReferences()
Returns a list with the reference objects for nodes which have been removed. Whenever a node associated with a reference object is removed from the nodes structure managed by the owning model, the reference object is recorded. This is necessary for instance to free some resources. With this method all recorded reference objects can be queried. They are typically returned in the order in which they have been removed.- Returns:
- a list with reference objects for nodes removed from the model
-
-