Interface NodeKeyResolver<T>

    • Method Detail

      • resolveKey

        java.util.List<QueryResult<T>> resolveKey​(T root,
                                                  java.lang.String key,
                                                  NodeHandler<T> handler)
        Performs a query for the specified key on the given root node. This is a thin wrapper over the query() method of an ExpressionEngine.
        Parameters:
        root - the root node
        key - the key to be resolved
        handler - the NodeHandler
        Returns:
        a list with query results
      • resolveNodeKey

        java.util.List<T> resolveNodeKey​(T root,
                                         java.lang.String key,
                                         NodeHandler<T> handler)
        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 like resolveKey(), but filters only for results of type node.
        Parameters:
        root - the root node
        key - the key to be resolved
        handler - the NodeHandler
        Returns:
        a list with the resolved nodes
      • resolveAddKey

        NodeAddData<T> resolveAddKey​(T root,
                                     java.lang.String key,
                                     NodeHandler<T> handler)
        Resolves a key of an add operation. Result is a NodeAddData object containing all information for actually performing the add operation at the specified key.
        Parameters:
        root - the root node
        key - the key to be resolved
        handler - the NodeHandler
        Returns:
        a NodeAddData object to be used for the add operation
      • resolveUpdateKey

        NodeUpdateData<T> resolveUpdateKey​(T root,
                                           java.lang.String key,
                                           java.lang.Object newValue,
                                           NodeHandler<T> handler)
        Resolves a key for an update operation. Result is a NodeUpdateData object containing all information for actually performing the update operation at the specified key using the provided new value object.
        Parameters:
        root - the root node
        key - the key to be resolved
        newValue - the new value for the key to be updated; this can be a single value or a container for multiple values
        handler - the NodeHandler
        Returns:
        a NodeUpdateData object to be used for this update operation
      • nodeKey

        java.lang.String nodeKey​(T node,
                                 java.util.Map<T,​java.lang.String> cache,
                                 NodeHandler<T> handler)
        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 question
        cache - a map serving as cache
        handler - the NodeHandler
        Returns:
        a key for the specified node