1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.rendering.xdomxml10.internal.parser; |
21 |
|
|
22 |
|
import java.util.HashSet; |
23 |
|
import java.util.Set; |
24 |
|
|
25 |
|
import javax.inject.Named; |
26 |
|
|
27 |
|
import org.xml.sax.SAXException; |
28 |
|
import org.xwiki.component.annotation.Component; |
29 |
|
import org.xwiki.component.annotation.InstantiationStrategy; |
30 |
|
import org.xwiki.component.descriptor.ComponentInstantiationStrategy; |
31 |
|
import org.xwiki.rendering.xdomxml10.internal.renderer.parameter.FormatConverter; |
32 |
|
|
33 |
|
@Component |
34 |
|
@Named("format") |
35 |
|
@InstantiationStrategy(ComponentInstantiationStrategy.PER_LOOKUP) |
|
|
| 0% |
Uncovered Elements: 8 (8) |
Complexity: 4 |
Complexity Density: 1 |
|
36 |
|
public class FormatBlockParser extends DefaultBlockParser |
37 |
|
{ |
38 |
|
private static final FormatConverter FORMATCONVERTER = new FormatConverter(); |
39 |
|
|
40 |
|
private static final Set<String> NAMES = new HashSet<String>() |
41 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
42 |
0 |
{... |
43 |
0 |
add("format"); |
44 |
|
} |
45 |
|
}; |
46 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
47 |
0 |
public FormatBlockParser()... |
48 |
|
{ |
49 |
0 |
super(NAMES); |
50 |
|
} |
51 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
52 |
0 |
@Override... |
53 |
|
protected void beginBlock() throws SAXException |
54 |
|
{ |
55 |
0 |
getListener() |
56 |
|
.beginFormat(FORMATCONVERTER.toFormat(getParameterAsString("format", null)), getCustomParameters()); |
57 |
|
} |
58 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
59 |
0 |
@Override... |
60 |
|
protected void endBlock() throws SAXException |
61 |
|
{ |
62 |
0 |
getListener().endFormat(FORMATCONVERTER.toFormat(getParameterAsString("format", null)), getCustomParameters()); |
63 |
|
} |
64 |
|
} |