1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
package org.qedeq.kernel.xml.handler.module; |
17 |
|
|
18 |
|
import org.qedeq.kernel.se.dto.module.LatexVo; |
19 |
|
import org.qedeq.kernel.xml.common.XmlSyntaxException; |
20 |
|
import org.qedeq.kernel.xml.handler.common.AbstractSimpleHandler; |
21 |
|
import org.qedeq.kernel.xml.handler.common.SimpleAttributes; |
22 |
|
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
@version |
28 |
|
@author |
29 |
|
|
|
|
| 79.4% |
Uncovered Elements: 7 (34) |
Complexity: 12 |
Complexity Density: 0.75 |
|
30 |
|
public class LatexHandler extends AbstractSimpleHandler { |
31 |
|
|
32 |
|
|
33 |
|
private String language; |
34 |
|
|
35 |
|
|
36 |
|
private LatexVo latex; |
37 |
|
|
38 |
|
|
39 |
|
private String data; |
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
|
45 |
|
@param |
46 |
|
@param |
47 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
48 |
147
|
public LatexHandler(final AbstractSimpleHandler handler, final String startTag) {... |
49 |
147
|
super(handler, startTag); |
50 |
|
} |
51 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
52 |
136
|
public final void init() {... |
53 |
136
|
latex = null; |
54 |
|
} |
55 |
|
|
56 |
|
|
57 |
|
|
58 |
|
|
59 |
|
@return |
60 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
61 |
136
|
public final LatexVo getLatex() {... |
62 |
136
|
return latex; |
63 |
|
} |
64 |
|
|
|
|
| 77.8% |
Uncovered Elements: 2 (9) |
Complexity: 3 |
Complexity Density: 0.6 |
|
65 |
272
|
public final void startElement(final String name, final SimpleAttributes attributes)... |
66 |
|
throws XmlSyntaxException { |
67 |
272
|
if (getStartTag().equals(name)) { |
68 |
|
|
69 |
136
|
} else if ("LATEX".equals(name)) { |
70 |
136
|
this.data = null; |
71 |
136
|
language = attributes.getString("language"); |
72 |
|
} else { |
73 |
0
|
throw XmlSyntaxException.createUnexpectedTagException(name); |
74 |
|
} |
75 |
|
} |
76 |
|
|
|
|
| 75% |
Uncovered Elements: 2 (8) |
Complexity: 3 |
Complexity Density: 0.75 |
|
77 |
272
|
public void endElement(final String name) throws XmlSyntaxException {... |
78 |
272
|
if (getStartTag().equals(name)) { |
79 |
|
|
80 |
136
|
} else if ("LATEX".equals(name)) { |
81 |
136
|
latex = new LatexVo(language, data); |
82 |
|
} else { |
83 |
0
|
throw XmlSyntaxException.createUnexpectedTagException(name); |
84 |
|
} |
85 |
|
} |
86 |
|
|
|
|
| 62.5% |
Uncovered Elements: 3 (8) |
Complexity: 3 |
Complexity Density: 0.75 |
|
87 |
136
|
public void characters(final String name, final String data) throws XmlSyntaxException {... |
88 |
136
|
if (getStartTag().equals(name)) { |
89 |
|
|
90 |
136
|
} else if ("LATEX".equals(name)) { |
91 |
136
|
this.data = data; |
92 |
|
} else { |
93 |
0
|
throw XmlSyntaxException.createUnexpectedTextDataException(name, data); |
94 |
|
} |
95 |
|
} |
96 |
|
|
97 |
|
} |