|
1 |
| |
|
2 |
| |
|
3 |
| |
|
4 |
| |
|
5 |
| |
|
6 |
| |
|
7 |
| |
|
8 |
| |
|
9 |
| |
|
10 |
| |
|
11 |
| |
|
12 |
| |
|
13 |
| |
|
14 |
| |
|
15 |
| |
|
16 |
| |
|
17 |
| |
|
18 |
| package org.qedeq.kernel.xml.handler.module; |
|
19 |
| |
|
20 |
| import org.qedeq.kernel.dto.module.ProofVo; |
|
21 |
| import org.qedeq.kernel.xml.parser.AbstractSimpleHandler; |
|
22 |
| import org.qedeq.kernel.xml.parser.SimpleAttributes; |
|
23 |
| import org.qedeq.kernel.xml.parser.SyntaxException; |
|
24 |
| |
|
25 |
| |
|
26 |
| |
|
27 |
| |
|
28 |
| |
|
29 |
| |
|
30 |
| |
|
31 |
| |
|
32 |
| public final class ProofHandler extends AbstractSimpleHandler { |
|
33 |
| |
|
34 |
| |
|
35 |
| private final LatexListHandler informalProofHandler; |
|
36 |
| |
|
37 |
| |
|
38 |
| private ProofVo proof; |
|
39 |
| |
|
40 |
| |
|
41 |
| |
|
42 |
| |
|
43 |
| |
|
44 |
| |
|
45 |
54
| public ProofHandler(final AbstractSimpleHandler handler) {
|
|
46 |
54
| super(handler, "PROOF");
|
|
47 |
54
| informalProofHandler = new LatexListHandler(this, "PROOF");
|
|
48 |
| } |
|
49 |
| |
|
50 |
26
| public final void init() {
|
|
51 |
26
| proof = null;
|
|
52 |
| } |
|
53 |
| |
|
54 |
| |
|
55 |
| |
|
56 |
| |
|
57 |
| |
|
58 |
| |
|
59 |
26
| public final ProofVo getProof() {
|
|
60 |
26
| return proof;
|
|
61 |
| } |
|
62 |
| |
|
63 |
26
| public final void startElement(final String name, final SimpleAttributes attributes)
|
|
64 |
| throws SyntaxException { |
|
65 |
26
| if (getStartTag().equals(name)) {
|
|
66 |
26
| proof = new ProofVo();
|
|
67 |
26
| proof.setKind(attributes.getString("kind"));
|
|
68 |
26
| proof.setLevel(attributes.getString("level"));
|
|
69 |
26
| changeHandler(informalProofHandler, name, attributes);
|
|
70 |
| } else { |
|
71 |
0
| throw SyntaxException.createUnexpectedTagException(name);
|
|
72 |
| } |
|
73 |
| } |
|
74 |
| |
|
75 |
26
| public final void endElement(final String name) throws SyntaxException {
|
|
76 |
26
| if (getStartTag().equals(name)) {
|
|
77 |
26
| proof.setNonFormalProof(informalProofHandler.getLatexList());
|
|
78 |
| } else { |
|
79 |
0
| throw SyntaxException.createUnexpectedTagException(name);
|
|
80 |
| } |
|
81 |
| } |
|
82 |
| |
|
83 |
| } |