1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
package org.qedeq.kernel.xml.handler.common; |
17 |
|
|
18 |
|
import org.qedeq.kernel.se.common.ModuleService; |
19 |
|
import org.qedeq.kernel.xml.common.XmlSyntaxException; |
20 |
|
|
21 |
|
|
22 |
|
|
23 |
|
|
24 |
|
@link |
25 |
|
@link |
26 |
|
|
27 |
|
@author |
28 |
|
|
|
|
| 65.4% |
Uncovered Elements: 9 (26) |
Complexity: 11 |
Complexity Density: 0.73 |
|
29 |
|
public abstract class AbstractSimpleHandler { |
30 |
|
|
31 |
|
|
32 |
|
private final SaxDefaultHandler defaultHandler; |
33 |
|
|
34 |
|
|
35 |
|
private final String startTag; |
36 |
|
|
37 |
|
|
38 |
|
|
39 |
|
|
40 |
|
@param |
41 |
|
@param |
42 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
43 |
149
|
public AbstractSimpleHandler(final SaxDefaultHandler defaultHandler, final String startTag) {... |
44 |
149
|
this.defaultHandler = defaultHandler; |
45 |
149
|
this.startTag = startTag; |
46 |
|
} |
47 |
|
|
48 |
|
|
49 |
|
|
50 |
|
|
51 |
|
@param |
52 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
53 |
0
|
public AbstractSimpleHandler(final SaxDefaultHandler defaultHandler) {... |
54 |
0
|
this.defaultHandler = defaultHandler; |
55 |
0
|
this.startTag = null; |
56 |
|
} |
57 |
|
|
58 |
|
|
59 |
|
|
60 |
|
|
61 |
|
@param |
62 |
|
@param |
63 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
64 |
10749
|
public AbstractSimpleHandler(final AbstractSimpleHandler handler, final String startTag) {... |
65 |
10749
|
this.defaultHandler = handler.defaultHandler; |
66 |
10749
|
this.startTag = startTag; |
67 |
|
} |
68 |
|
|
69 |
|
|
70 |
|
|
71 |
|
|
72 |
|
@param |
73 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
74 |
2952
|
public AbstractSimpleHandler(final AbstractSimpleHandler handler) {... |
75 |
2952
|
this.defaultHandler = handler.defaultHandler; |
76 |
2952
|
this.startTag = null; |
77 |
|
} |
78 |
|
|
79 |
|
|
80 |
|
|
81 |
|
|
82 |
|
public abstract void init(); |
83 |
|
|
84 |
|
|
85 |
|
|
86 |
|
|
87 |
|
@param |
88 |
|
@param |
89 |
|
@throws |
90 |
|
|
91 |
|
public abstract void startElement(final String elementName, final SimpleAttributes attributes) |
92 |
|
throws XmlSyntaxException; |
93 |
|
|
94 |
|
|
95 |
|
|
96 |
|
|
97 |
|
@param |
98 |
|
@throws |
99 |
|
|
100 |
|
public abstract void endElement(final String elementName) throws XmlSyntaxException; |
101 |
|
|
102 |
|
|
103 |
|
|
104 |
|
|
105 |
|
|
106 |
|
@param |
107 |
|
@param |
108 |
|
@throws |
109 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
110 |
0
|
public void characters(final String elementName, final String value) throws XmlSyntaxException {... |
111 |
|
|
112 |
0
|
throw XmlSyntaxException.createUnexpectedTextDataException(elementName, value); |
113 |
|
} |
114 |
|
|
115 |
|
|
116 |
|
|
117 |
|
|
118 |
|
|
119 |
|
@param |
120 |
|
@param |
121 |
|
@param |
122 |
|
@throws |
123 |
|
|
|
|
| 60% |
Uncovered Elements: 2 (5) |
Complexity: 3 |
Complexity Density: 1 |
|
124 |
8754
|
public final void changeHandler(final AbstractSimpleHandler newHandler,... |
125 |
|
final String elementName, final SimpleAttributes attributes) |
126 |
|
throws XmlSyntaxException { |
127 |
8754
|
if (newHandler.getStartTag() != null && !newHandler.getStartTag().equals(elementName)) { |
128 |
0
|
throw new RuntimeException(newHandler.getClass().getName() + " has start tag \"" |
129 |
|
+ newHandler.getStartTag() + "\", but should start with tag \"" |
130 |
|
+ elementName + "\""); |
131 |
|
} |
132 |
8754
|
defaultHandler.changeHandler(newHandler, elementName, attributes); |
133 |
|
} |
134 |
|
|
135 |
|
|
136 |
|
|
137 |
|
|
138 |
|
@return |
139 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
140 |
0
|
public final ModuleService getPlugin() {... |
141 |
0
|
return defaultHandler.getPlugin(); |
142 |
|
} |
143 |
|
|
144 |
|
|
145 |
|
|
146 |
|
|
147 |
|
@return |
148 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
149 |
2584
|
public final int getLevel() {... |
150 |
2584
|
return defaultHandler.getLevel(); |
151 |
|
} |
152 |
|
|
153 |
|
|
154 |
|
|
155 |
|
|
156 |
|
@return |
157 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
158 |
93844
|
public final String getStartTag() {... |
159 |
93844
|
return startTag; |
160 |
|
} |
161 |
|
|
162 |
|
} |