Class | Line # | Actions | |||||
---|---|---|---|---|---|---|---|
TreeNode | 37 | 0 | - | 0 | 0 |
1 | /* | |
2 | * See the NOTICE file distributed with this work for additional | |
3 | * information regarding copyright ownership. | |
4 | * | |
5 | * This is free software; you can redistribute it and/or modify it | |
6 | * under the terms of the GNU Lesser General Public License as | |
7 | * published by the Free Software Foundation; either version 2.1 of | |
8 | * the License, or (at your option) any later version. | |
9 | * | |
10 | * This software is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | * Lesser General Public License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public | |
16 | * License along with this software; if not, write to the Free | |
17 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |
18 | * 02110-1301 USA, or see the FSF site: http://www.fsf.org. | |
19 | */ | |
20 | package org.xwiki.tree; | |
21 | ||
22 | import java.util.List; | |
23 | import java.util.Map; | |
24 | ||
25 | import org.xwiki.component.annotation.Role; | |
26 | import org.xwiki.stability.Unstable; | |
27 | ||
28 | /** | |
29 | * The interface used to represent a node in a tree structure. | |
30 | * | |
31 | * @version $Id: 0d5539c083150ed9ee2299bf4be62d3de71807f8 $ | |
32 | * @since 8.3M2 | |
33 | * @since 7.4.5 | |
34 | */ | |
35 | @Role | |
36 | @Unstable | |
37 | public interface TreeNode | |
38 | { | |
39 | /** | |
40 | * The property that specifies how the child nodes are sorted. | |
41 | */ | |
42 | String PROPERTY_ORDER_BY = "orderBy"; | |
43 | ||
44 | /** | |
45 | * Retrieve the children of the specified node. | |
46 | * | |
47 | * @param nodeId the node id | |
48 | * @param offset the offset within the list of child nodes | |
49 | * @param limit the number of child nodes to return | |
50 | * @return a part of the child nodes of the specified node | |
51 | */ | |
52 | List<String> getChildren(String nodeId, int offset, int limit); | |
53 | ||
54 | /** | |
55 | * Retrieve the number of children of the specified node. | |
56 | * | |
57 | * @param nodeId the node id | |
58 | * @return the number of child nodes | |
59 | */ | |
60 | int getChildCount(String nodeId); | |
61 | ||
62 | /** | |
63 | * Retrieve the parent of the specified node. | |
64 | * | |
65 | * @param nodeId the node id | |
66 | * @return the parent node id | |
67 | */ | |
68 | String getParent(String nodeId); | |
69 | ||
70 | /** | |
71 | * Retrieve the properties that can be used to configure the tree node. For instance you may want to sort or filter | |
72 | * the child nodes. | |
73 | * | |
74 | * @return the map of tree node properties | |
75 | */ | |
76 | Map<String, Object> getProperties(); | |
77 | } |