1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.rendering.internal.macro.comment; |
21 |
|
|
22 |
|
import java.util.Collections; |
23 |
|
import java.util.List; |
24 |
|
|
25 |
|
import javax.inject.Named; |
26 |
|
import javax.inject.Singleton; |
27 |
|
|
28 |
|
import org.xwiki.component.annotation.Component; |
29 |
|
import org.xwiki.rendering.block.Block; |
30 |
|
import org.xwiki.rendering.macro.AbstractNoParameterMacro; |
31 |
|
import org.xwiki.rendering.macro.MacroExecutionException; |
32 |
|
import org.xwiki.rendering.macro.descriptor.DefaultContentDescriptor; |
33 |
|
import org.xwiki.rendering.transformation.MacroTransformationContext; |
34 |
|
|
35 |
|
|
36 |
|
|
37 |
|
|
38 |
|
@version |
39 |
|
@since |
40 |
|
|
41 |
|
@Component |
42 |
|
@Named("comment") |
43 |
|
@Singleton |
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 3 |
Complexity Density: 0.75 |
|
44 |
|
public class CommentMacro extends AbstractNoParameterMacro |
45 |
|
{ |
46 |
|
|
47 |
|
|
48 |
|
|
49 |
|
private static final String DESCRIPTION = |
50 |
|
"Allows putting comments in the source content. This macro doesn't output anything."; |
51 |
|
|
52 |
|
|
53 |
|
|
54 |
|
|
55 |
|
private static final String CONTENT_DESCRIPTION = "Comments"; |
56 |
|
|
57 |
|
|
58 |
|
|
59 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
60 |
2 |
public CommentMacro()... |
61 |
|
{ |
62 |
2 |
super("Comment", DESCRIPTION, new DefaultContentDescriptor(CONTENT_DESCRIPTION)); |
63 |
2 |
setDefaultCategory(DEFAULT_CATEGORY_DEVELOPMENT); |
64 |
|
} |
65 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
66 |
1 |
@Override... |
67 |
|
public boolean supportsInlineMode() |
68 |
|
{ |
69 |
1 |
return true; |
70 |
|
} |
71 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
72 |
2 |
@Override... |
73 |
|
public List<Block> execute(Object unusedParameters, String content, MacroTransformationContext context) |
74 |
|
throws MacroExecutionException |
75 |
|
{ |
76 |
2 |
return Collections.emptyList(); |
77 |
|
} |
78 |
|
} |