1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.rendering.macro.toc; |
21 |
|
|
22 |
|
import javax.validation.constraints.Min; |
23 |
|
|
24 |
|
import org.xwiki.properties.annotation.PropertyDescription; |
25 |
|
|
26 |
|
|
27 |
|
@link |
28 |
|
|
29 |
|
@version |
30 |
|
@since |
31 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (19) |
Complexity: 9 |
Complexity Density: 0.9 |
|
32 |
|
public class TocMacroParameters |
33 |
|
{ |
34 |
|
|
35 |
|
@version |
36 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 0 |
Complexity Density: - |
|
37 |
|
public enum Scope |
38 |
|
{ |
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
LOCAL, |
43 |
|
|
44 |
|
|
45 |
|
|
46 |
|
|
47 |
|
PAGE |
48 |
|
} |
49 |
|
|
50 |
|
|
51 |
|
|
52 |
|
|
53 |
|
@Min(1) |
54 |
|
private int start = 1; |
55 |
|
|
56 |
|
|
57 |
|
|
58 |
|
|
59 |
|
private boolean customStart; |
60 |
|
|
61 |
|
|
62 |
|
|
63 |
|
|
64 |
|
@Min(1) |
65 |
|
private int depth = 6; |
66 |
|
|
67 |
|
|
68 |
|
|
69 |
|
|
70 |
|
|
71 |
|
private Scope scope = Scope.PAGE; |
72 |
|
|
73 |
|
|
74 |
|
|
75 |
|
|
76 |
|
private boolean numbered; |
77 |
|
|
78 |
|
|
79 |
|
@param |
80 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
81 |
9 |
@PropertyDescription("the minimum section level. For example if 2 then level 1 sections will not be listed")... |
82 |
|
public void setStart(int start) |
83 |
|
{ |
84 |
9 |
this.start = start; |
85 |
9 |
this.customStart = true; |
86 |
|
} |
87 |
|
|
88 |
|
|
89 |
|
@return |
90 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
91 |
46 |
public int getStart()... |
92 |
|
{ |
93 |
46 |
return this.start; |
94 |
|
} |
95 |
|
|
96 |
|
|
97 |
|
@return |
98 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
99 |
4 |
public boolean isCustomStart()... |
100 |
|
{ |
101 |
4 |
return this.customStart; |
102 |
|
} |
103 |
|
|
104 |
|
|
105 |
|
@param |
106 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
107 |
8 |
@PropertyDescription("the maximum section level. "... |
108 |
|
+ "For example if 3 then all section levels from 4 will not be listed") |
109 |
|
public void setDepth(int depth) |
110 |
|
{ |
111 |
8 |
this.depth = depth; |
112 |
|
} |
113 |
|
|
114 |
|
|
115 |
|
@return |
116 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
117 |
46 |
public int getDepth()... |
118 |
|
{ |
119 |
46 |
return this.depth; |
120 |
|
} |
121 |
|
|
122 |
|
|
123 |
|
@param |
124 |
|
|
125 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
126 |
9 |
@PropertyDescription("if local only section in the current scope will be listed. "... |
127 |
|
+ "For example if the macro is written in a section, only subsections of this section will be listed") |
128 |
|
public void setScope(Scope scope) |
129 |
|
{ |
130 |
9 |
this.scope = scope; |
131 |
|
} |
132 |
|
|
133 |
|
|
134 |
|
@return@link |
135 |
|
|
136 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
137 |
46 |
public Scope getScope()... |
138 |
|
{ |
139 |
46 |
return this.scope; |
140 |
|
} |
141 |
|
|
142 |
|
|
143 |
|
@param |
144 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
145 |
7 |
@PropertyDescription("if true the section title number is printed")... |
146 |
|
public void setNumbered(boolean numbered) |
147 |
|
{ |
148 |
7 |
this.numbered = numbered; |
149 |
|
} |
150 |
|
|
151 |
|
|
152 |
|
@return |
153 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
154 |
46 |
public boolean isNumbered()... |
155 |
|
{ |
156 |
46 |
return this.numbered; |
157 |
|
} |
158 |
|
} |