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.PropositionVo; |
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 |
|
|
|
|
| 92.5% |
Uncovered Elements: 4 (53) |
Complexity: 15 |
Complexity Density: 0.54 |
|
30 |
|
public class PropositionHandler extends AbstractSimpleHandler { |
31 |
|
|
32 |
|
|
33 |
|
private final FormulaHandler formulaHandler; |
34 |
|
|
35 |
|
|
36 |
|
private final LatexListHandler descriptionHandler; |
37 |
|
|
38 |
|
|
39 |
|
private final ProofHandler proofHandler; |
40 |
|
|
41 |
|
|
42 |
|
private final FormalProofHandler formalProofHandler; |
43 |
|
|
44 |
|
|
45 |
|
private PropositionVo proposition; |
46 |
|
|
47 |
|
|
48 |
|
|
49 |
|
|
50 |
|
|
51 |
|
@param |
52 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
|
53 |
147
|
public PropositionHandler(final AbstractSimpleHandler handler) {... |
54 |
147
|
super(handler, "THEOREM"); |
55 |
147
|
formulaHandler = new FormulaHandler(this); |
56 |
147
|
descriptionHandler = new LatexListHandler(this, "DESCRIPTION"); |
57 |
147
|
proofHandler = new ProofHandler(this); |
58 |
147
|
formalProofHandler = new FormalProofHandler(this); |
59 |
|
} |
60 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
61 |
205
|
public final void init() {... |
62 |
205
|
proposition = null; |
63 |
|
} |
64 |
|
|
65 |
|
|
66 |
|
|
67 |
|
|
68 |
|
@return |
69 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
70 |
205
|
public final PropositionVo getProposition() {... |
71 |
205
|
return proposition; |
72 |
|
} |
73 |
|
|
|
|
| 90.5% |
Uncovered Elements: 2 (21) |
Complexity: 6 |
Complexity Density: 0.55 |
|
74 |
509
|
public final void startElement(final String name, final SimpleAttributes attributes)... |
75 |
|
throws XmlSyntaxException { |
76 |
509
|
if (getStartTag().equals(name)) { |
77 |
205
|
proposition = new PropositionVo(); |
78 |
304
|
} else if (formulaHandler.getStartTag().equals(name)) { |
79 |
205
|
changeHandler(formulaHandler, name, attributes); |
80 |
99
|
} else if (descriptionHandler.getStartTag().equals(name)) { |
81 |
2
|
changeHandler(descriptionHandler, name, attributes); |
82 |
97
|
} else if (proofHandler.getStartTag().equals(name)) { |
83 |
44
|
changeHandler(proofHandler, name, attributes); |
84 |
53
|
} else if (formalProofHandler.getStartTag().equals(name)) { |
85 |
53
|
changeHandler(formalProofHandler, name, attributes); |
86 |
|
} else { |
87 |
0
|
throw XmlSyntaxException.createUnexpectedTagException(name); |
88 |
|
} |
89 |
|
} |
90 |
|
|
|
|
| 90% |
Uncovered Elements: 2 (20) |
Complexity: 6 |
Complexity Density: 0.6 |
|
91 |
509
|
public final void endElement(final String name) throws XmlSyntaxException {... |
92 |
509
|
if (getStartTag().equals(name)) { |
93 |
|
|
94 |
304
|
} else if (formulaHandler.getStartTag().equals(name)) { |
95 |
205
|
proposition.setFormula(formulaHandler.getFormula()); |
96 |
99
|
} else if (descriptionHandler.getStartTag().equals(name)) { |
97 |
2
|
proposition.setDescription(descriptionHandler.getLatexList()); |
98 |
97
|
} else if (proofHandler.getStartTag().equals(name)) { |
99 |
44
|
proposition.addProof(proofHandler.getProof()); |
100 |
53
|
} else if (formalProofHandler.getStartTag().equals(name)) { |
101 |
53
|
proposition.addFormalProof(formalProofHandler.getProof()); |
102 |
|
} else { |
103 |
0
|
throw XmlSyntaxException.createUnexpectedTagException(name); |
104 |
|
} |
105 |
|
} |
106 |
|
|
107 |
|
} |