Class AbstractTreeNode

  • All Implemented Interfaces:
    TreeNode
    Direct Known Subclasses:
    AbstractTree

    public abstract class AbstractTreeNode
    extends Object
    implements TreeNode
    Base class for representing a node in a tree structure.
    Since:
    8.3M2, 7.4.5
    Version:
    $Id: 3396ca81049fd6b1c6a8012ae8448c090e77e2cb $
    • Field Detail

      • logger

        @Inject
        protected org.slf4j.Logger logger
      • contextComponentManagerProvider

        @Inject
        @Named("context")
        protected javax.inject.Provider<org.xwiki.component.manager.ComponentManager> contextComponentManagerProvider
    • Constructor Detail

      • AbstractTreeNode

        public AbstractTreeNode()
    • Method Detail

      • getChildren

        public List<String> getChildren​(String nodeId,
                                        int offset,
                                        int limit)
        Description copied from interface: TreeNode
        Retrieve the children of the specified node.
        Specified by:
        getChildren in interface TreeNode
        Parameters:
        nodeId - the node id
        offset - the offset within the list of child nodes
        limit - the number of child nodes to return
        Returns:
        a part of the child nodes of the specified node
      • getChildCount

        public int getChildCount​(String nodeId)
        Description copied from interface: TreeNode
        Retrieve the number of children of the specified node.
        Specified by:
        getChildCount in interface TreeNode
        Parameters:
        nodeId - the node id
        Returns:
        the number of child nodes
      • getParent

        public String getParent​(String nodeId)
        Description copied from interface: TreeNode
        Retrieve the parent of the specified node.
        Specified by:
        getParent in interface TreeNode
        Parameters:
        nodeId - the node id
        Returns:
        the parent node id
      • getProperties

        public Map<String,​Object> getProperties()
        Description copied from interface: TreeNode
        Retrieve the properties that can be used to configure the tree node. For instance you may want to sort or filter the child nodes.
        Specified by:
        getProperties in interface TreeNode
        Returns:
        the map of tree node properties
      • getOrderBy

        protected String getOrderBy()
      • getExclusions

        protected Set<String> getExclusions()
      • getExclusions

        protected Set<String> getExclusions​(String parentNodeId)
      • subList

        protected <E> List<E> subList​(List<E> list,
                                      int offset,
                                      int limit)