Package com.adobe.xfa

Class NodeListFilter

    • Constructor Detail

      • NodeListFilter

        public NodeListFilter()
    • Method Detail

      • accept

        public boolean accept​(Node node)
        Determines whether node is to be included in the filtered list of nodes. Derived classes will want to override this behaviour.
        Parameters:
        node - the node to test for inclusion
        Returns:
        true if the node is to be included. The default implementation always returns true.
      • checkChildren

        public boolean checkChildren​(Node node)
        Determines whether the filter should search the children of this node.
        Parameters:
        node - the node to check
        Returns:
        true if the filter should search children of node.
      • checkFinished

        public boolean checkFinished()
        Determines whether a search should continue or not. We may want to abort the search in cases such as where we're searching for a specific node or the first occurrence of a node and wish to stop searching when we've found it.
        Returns:
        true if we're done, false if we're to keep searching.
      • init

        public void init()
        This method is called when a search is started.
      • filterNodes

        public List<Node> filterNodes​(Node startNode)
        Searches the startNode all descendants of startNode.
        Only nodes that are accepted by the filter will be added to the list.
        Parameters:
        startNode - the node to start searching from.
        Returns:
        a list of nodes
      • filterNodes

        public List<Node> filterNodes​(Node startNode,
                                      int level,
                                      List<Node> nodeList)
        Searches the startNode all descendants of startNode down to the level specified.
        Only nodes that are accepted by the filter will be added to nodeList.
        Parameters:
        startNode - the node to start searching from.
        level -

        0 = Exhaustively search all descendants of startNode
        1 = Search immediate children.
        2 = Search immediate children and grandchildren
        n = Search descendants down to the nth level.
        Returns:
        a list of nodes
      • filterNodes

        public List<Node> filterNodes​(Node startNode,
                                      int level)
        Searches the startNode all descendants of startNode down to the level specified.
        Only nodes that are accepted by the filter will be added to the result list.
        Parameters:
        startNode - the node to start searching from.
        level -

        0 = Exhaustively search all descendants of startNode
        1 = Search immediate children.
        2 = Search immediate children and grandchildren
        n = Search descendants down to the nth level.
        Returns:
        a list of nodes