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.wikibridge; |
21 |
|
|
22 |
|
import java.util.LinkedHashMap; |
23 |
|
import java.util.List; |
24 |
|
import java.util.Map; |
25 |
|
|
26 |
|
import org.xwiki.rendering.macro.MacroId; |
27 |
|
import org.xwiki.rendering.macro.descriptor.ContentDescriptor; |
28 |
|
import org.xwiki.rendering.macro.descriptor.MacroDescriptor; |
29 |
|
import org.xwiki.rendering.macro.descriptor.ParameterDescriptor; |
30 |
|
|
31 |
|
|
32 |
|
@link |
33 |
|
|
34 |
|
@version |
35 |
|
@since |
36 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (34) |
Complexity: 10 |
Complexity Density: 0.42 |
|
37 |
|
public class WikiMacroDescriptor implements MacroDescriptor |
38 |
|
{ |
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
private MacroId id; |
43 |
|
|
44 |
|
|
45 |
|
|
46 |
|
|
47 |
|
private String name; |
48 |
|
|
49 |
|
|
50 |
|
|
51 |
|
|
52 |
|
private String description; |
53 |
|
|
54 |
|
|
55 |
|
|
56 |
|
|
57 |
|
private String defaultCategory; |
58 |
|
|
59 |
|
|
60 |
|
|
61 |
|
|
62 |
|
private WikiMacroVisibility visibility; |
63 |
|
|
64 |
|
|
65 |
|
|
66 |
|
|
67 |
|
private ContentDescriptor contentDescriptor; |
68 |
|
|
69 |
|
|
70 |
|
|
71 |
|
|
72 |
|
private List<WikiMacroParameterDescriptor> parameterDescriptors; |
73 |
|
|
74 |
|
|
75 |
|
@link |
76 |
|
|
77 |
|
@param |
78 |
|
@param |
79 |
|
@param |
80 |
|
@param |
81 |
|
@param |
82 |
|
@param |
83 |
|
@param |
84 |
|
@since |
85 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 1 |
Complexity Density: 0.14 |
|
86 |
248 |
public WikiMacroDescriptor(MacroId id, String name, String description, String defaultCategory,... |
87 |
|
WikiMacroVisibility visibility, ContentDescriptor contentDescriptor, |
88 |
|
List<WikiMacroParameterDescriptor> parameterDescriptors) |
89 |
|
{ |
90 |
248 |
this.id = id; |
91 |
248 |
this.name = name; |
92 |
248 |
this.description = description; |
93 |
248 |
this.contentDescriptor = contentDescriptor; |
94 |
248 |
this.parameterDescriptors = parameterDescriptors; |
95 |
248 |
this.defaultCategory = defaultCategory; |
96 |
248 |
this.visibility = visibility; |
97 |
|
} |
98 |
|
|
99 |
|
|
100 |
|
@link |
101 |
|
|
102 |
|
@param |
103 |
|
@param |
104 |
|
@param |
105 |
|
@param |
106 |
|
@param |
107 |
|
@param |
108 |
|
@since |
109 |
|
@deprecated@link |
110 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 1 |
Complexity Density: 0.17 |
|
111 |
1 |
@Deprecated... |
112 |
|
public WikiMacroDescriptor(String name, String description, String defaultCategory, WikiMacroVisibility visibility, |
113 |
|
ContentDescriptor contentDescriptor, List<WikiMacroParameterDescriptor> parameterDescriptors) |
114 |
|
{ |
115 |
1 |
this.name = name; |
116 |
1 |
this.description = description; |
117 |
1 |
this.contentDescriptor = contentDescriptor; |
118 |
1 |
this.parameterDescriptors = parameterDescriptors; |
119 |
1 |
this.defaultCategory = defaultCategory; |
120 |
1 |
this.visibility = visibility; |
121 |
|
} |
122 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
123 |
464 |
@Override... |
124 |
|
public MacroId getId() |
125 |
|
{ |
126 |
464 |
return this.id; |
127 |
|
} |
128 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
129 |
2 |
@Override... |
130 |
|
public String getName() |
131 |
|
{ |
132 |
2 |
return this.name; |
133 |
|
} |
134 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
135 |
1 |
@Override... |
136 |
|
public String getDescription() |
137 |
|
{ |
138 |
1 |
return this.description; |
139 |
|
} |
140 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
141 |
166 |
@Override... |
142 |
|
public ContentDescriptor getContentDescriptor() |
143 |
|
{ |
144 |
166 |
return this.contentDescriptor; |
145 |
|
} |
146 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
147 |
154 |
@Override... |
148 |
|
public Class< ? > getParametersBeanClass() |
149 |
|
{ |
150 |
154 |
return WikiMacroParameters.class; |
151 |
|
} |
152 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
153 |
155 |
@Override... |
154 |
|
public Map<String, ParameterDescriptor> getParameterDescriptorMap() |
155 |
|
{ |
156 |
|
|
157 |
|
|
158 |
|
|
159 |
155 |
Map<String, ParameterDescriptor> descriptors = new LinkedHashMap<String, ParameterDescriptor>(); |
160 |
|
|
161 |
155 |
for (WikiMacroParameterDescriptor descriptor : this.parameterDescriptors) { |
162 |
1227 |
descriptors.put(descriptor.getId(), descriptor); |
163 |
|
} |
164 |
|
|
165 |
155 |
return descriptors; |
166 |
|
} |
167 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
168 |
1 |
@Override... |
169 |
|
public String getDefaultCategory() |
170 |
|
{ |
171 |
1 |
return this.defaultCategory; |
172 |
|
} |
173 |
|
|
174 |
|
|
175 |
|
@return |
176 |
|
|
177 |
|
@since |
178 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
179 |
535 |
public WikiMacroVisibility getVisibility()... |
180 |
|
{ |
181 |
535 |
return this.visibility; |
182 |
|
} |
183 |
|
} |