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.ConditionalProofVo;
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
28
29 public class ConditionalProofHandler extends AbstractSimpleHandler {
30
31
32 private ConditionalProofVo conditionalProof;
33
34
35 private HypothesisHandler hypothesisHandler;
36
37
38 private FormalProofLineListHandler proofListHandler;
39
40
41 private ConclusionHandler conclusionHandler;
42
43
44
45
46
47
48 public ConditionalProofHandler(final AbstractSimpleHandler handler) {
49 super(handler, "CP");
50 }
51
52 public final void init() {
53 conditionalProof = null;
54
55 hypothesisHandler = new HypothesisHandler(this);
56 proofListHandler = new FormalProofLineListHandler(this);
57 conclusionHandler = new ConclusionHandler(this);
58 }
59
60
61
62
63
64
65 public final ConditionalProofVo getConditionalProofVo() {
66 return conditionalProof;
67 }
68
69 public final void startElement(final String name, final SimpleAttributes attributes)
70 throws XmlSyntaxException {
71 if (getStartTag().equals(name)) {
72
73 } else if (hypothesisHandler.getStartTag().equals(name)) {
74 changeHandler(hypothesisHandler, name, attributes);
75 } else if (proofListHandler.getStartTag().equals(name)) {
76 changeHandler(proofListHandler, name, attributes);
77 } else if (conclusionHandler.getStartTag().equals(name)) {
78 changeHandler(conclusionHandler, name, attributes);
79 } else {
80 throw XmlSyntaxException.createUnexpectedTagException(name);
81 }
82 }
83
84 public final void endElement(final String name) throws XmlSyntaxException {
85 if (getStartTag().equals(name)) {
86 conditionalProof = new ConditionalProofVo(hypothesisHandler.getHypothesis(),
87 proofListHandler.getFormalProofLineList(),
88 conclusionHandler.getConclusion());
89 } else if (hypothesisHandler.getStartTag().equals(name)) {
90
91 } else if (proofListHandler.getStartTag().equals(name)) {
92
93 } else if (conclusionHandler.getStartTag().equals(name)) {
94
95 } else {
96 throw XmlSyntaxException.createUnexpectedTagException(name);
97 }
98 }
99
100 }