Interface NodeKeyResolver<T>
- Type Parameters:
T
- the type of the nodes supported by this resolver
- All Known Implementing Classes:
AbstractHierarchicalConfiguration
,AbstractYAMLBasedConfiguration
,BaseHierarchicalConfiguration
,CombinedConfiguration
,DynamicCombinedConfiguration
,INIConfiguration
,JSONConfiguration
,PatternSubtreeConfigurationWrapper
,PropertyListConfiguration
,SubnodeConfiguration
,XMLConfiguration
,XMLPropertyListConfiguration
,YAMLConfiguration
public interface NodeKeyResolver<T>
Definition of an interface which allows resolving a (property) key for different manipulating operations.
This interface is used when interacting with a node model. It is an abstraction over a concrete
ExpressionEngine
instance. It also implements some functionality for creating special helper objects for the
processing of complex update operations.
- Since:
- 2.0
-
Method Summary
Modifier and TypeMethodDescriptionGenerates a unique key for the specified node.resolveAddKey
(T root, String key, NodeHandler<T> handler) Resolves a key of an add operation.List<QueryResult<T>>
resolveKey
(T root, String key, NodeHandler<T> handler) Performs a query for the specified key on the given root node.resolveNodeKey
(T root, String key, NodeHandler<T> handler) Performs a query for the specified key on the given root node returning only node results.resolveUpdateKey
(T root, String key, Object newValue, NodeHandler<T> handler) Resolves a key for an update operation.
-
Method Details
-
nodeKey
Generates a unique key for the specified node. This method is used if keys have to be generated for nodes received as query results. An implementation must generate a canonical key which is compatible with the current expression engine. The passed in map can be used by an implementation as cache. It is created initially by the caller and then passed in subsequent calls. An implementation may use this to avoid that keys for nodes already encountered have to be generated again.- Parameters:
node
- the node in questioncache
- a map serving as cachehandler
- theNodeHandler
- Returns:
- a key for the specified node
-
resolveAddKey
Resolves a key of an add operation. Result is aNodeAddData
object containing all information for actually performing the add operation at the specified key.- Parameters:
root
- the root nodekey
- the key to be resolvedhandler
- theNodeHandler
- Returns:
- a
NodeAddData
object to be used for the add operation
-
resolveKey
Performs a query for the specified key on the given root node. This is a thin wrapper over thequery()
method of anExpressionEngine
.- Parameters:
root
- the root nodekey
- the key to be resolvedhandler
- theNodeHandler
- Returns:
- a list with query results
-
resolveNodeKey
Performs a query for the specified key on the given root node returning only node results. Some operations require results of type node and do not support attributes (e.g. for tracking nodes). This operation can be used in such cases. It works likeresolveKey()
, but filters only for results of type node.- Parameters:
root
- the root nodekey
- the key to be resolvedhandler
- theNodeHandler
- Returns:
- a list with the resolved nodes
-
resolveUpdateKey
Resolves a key for an update operation. Result is aNodeUpdateData
object containing all information for actually performing the update operation at the specified key using the provided new value object.- Parameters:
root
- the root nodekey
- the key to be resolvednewValue
- the new value for the key to be updated; this can be a single value or a container for multiple valueshandler
- theNodeHandler
- Returns:
- a
NodeUpdateData
object to be used for this update operation
-