1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.rendering.wikimodel.xml; |
21 |
|
|
22 |
|
import java.util.Map; |
23 |
|
|
24 |
|
import org.xwiki.rendering.wikimodel.IWemListenerDocument; |
25 |
|
import org.xwiki.rendering.wikimodel.WikiParameters; |
26 |
|
|
27 |
|
|
28 |
|
@version |
29 |
|
@since |
30 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (22) |
Complexity: 10 |
Complexity Density: 0.83 |
|
31 |
|
public class WemDocumentTagNotifier extends AbstractTagNotifier |
32 |
|
implements |
33 |
|
IWemListenerDocument |
34 |
|
{ |
35 |
|
private int fSectionDepth; |
36 |
|
|
37 |
|
|
38 |
|
@param |
39 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
40 |
6
|
public WemDocumentTagNotifier(ITagListener listener)... |
41 |
|
{ |
42 |
6
|
super(listener); |
43 |
|
} |
44 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
45 |
6
|
public void beginDocument(WikiParameters params)... |
46 |
|
{ |
47 |
6
|
fListener.beginTag(DOCUMENT, tagParams(), userParams(params)); |
48 |
|
} |
49 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
50 |
3
|
public void beginHeader(int headerLevel, WikiParameters params)... |
51 |
|
{ |
52 |
3
|
fListener.beginTag( |
53 |
|
HEADER, |
54 |
|
tagParams(HEADER_LEVEL, "" + headerLevel), |
55 |
|
userParams(params)); |
56 |
|
} |
57 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
58 |
9
|
public void beginSection(... |
59 |
|
int docLevel, |
60 |
|
int headerLevel, |
61 |
|
WikiParameters params) |
62 |
|
{ |
63 |
9
|
fSectionDepth++; |
64 |
9
|
fListener.beginTag( |
65 |
|
SECTION, |
66 |
|
getSectionParams(docLevel, headerLevel), |
67 |
|
userParams(params)); |
68 |
|
} |
69 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
70 |
9
|
public void beginSectionContent(... |
71 |
|
int docLevel, |
72 |
|
int headerLevel, |
73 |
|
WikiParameters params) |
74 |
|
{ |
75 |
9
|
fListener.beginTag(SECTION_CONTENT, getSectionParams( |
76 |
|
docLevel, |
77 |
|
headerLevel), userParams(params)); |
78 |
|
} |
79 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
80 |
6
|
public void endDocument(WikiParameters params)... |
81 |
|
{ |
82 |
6
|
fListener.endTag(DOCUMENT, tagParams(), userParams(params)); |
83 |
|
} |
84 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
85 |
3
|
public void endHeader(int headerLevel, WikiParameters params)... |
86 |
|
{ |
87 |
3
|
fListener.endTag( |
88 |
|
HEADER, |
89 |
|
tagParams(HEADER_LEVEL, "" + headerLevel), |
90 |
|
userParams(params)); |
91 |
|
} |
92 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
93 |
9
|
public void endSection(int docLevel, int headerLevel, WikiParameters params)... |
94 |
|
{ |
95 |
9
|
fListener.endTag( |
96 |
|
SECTION, |
97 |
|
getSectionParams(docLevel, headerLevel), |
98 |
|
userParams(params)); |
99 |
9
|
fSectionDepth--; |
100 |
|
} |
101 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
102 |
9
|
public void endSectionContent(... |
103 |
|
int docLevel, |
104 |
|
int headerLevel, |
105 |
|
WikiParameters params) |
106 |
|
{ |
107 |
9
|
fListener.endTag(SECTION_CONTENT, getSectionParams( |
108 |
|
docLevel, |
109 |
|
headerLevel), userParams(params)); |
110 |
|
} |
111 |
|
|
112 |
|
|
113 |
|
@param |
114 |
|
@param |
115 |
|
@return |
116 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
117 |
36
|
private Map<String, String> getSectionParams(int docLevel, int headerLevel)... |
118 |
|
{ |
119 |
36
|
return tagParams( |
120 |
|
SECTION_LEVEL, |
121 |
|
"" + fSectionDepth, |
122 |
|
SECTION_DOC_LEVEL, |
123 |
|
"" + docLevel, |
124 |
|
SECTION_HEADER_LEVEL, |
125 |
|
"" + headerLevel); |
126 |
|
} |
127 |
|
} |