Clover Coverage Report
Coverage timestamp: Fri May 24 2013 13:47:27 UTC
../../../../../../img/srcFileCovDistChart9.png 45% of files have more coverage
13   81   9   2.6
8   37   0.69   5
5     1.8  
1    
 
  FormalProofHandler       Line # 29 13 9 84.6% 0.84615386
 
  (93)
 
1    /* This file is part of the project "Hilbert II" - http://www.qedeq.org
2    *
3    * Copyright 2000-2013, Michael Meyling <mime@qedeq.org>.
4    *
5    * "Hilbert II" is free software; you can redistribute
6    * it and/or modify it under the terms of the GNU General Public
7    * License as published by the Free Software Foundation; either
8    * version 2 of the License, or (at your option) any later version.
9    *
10    * This program is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13    * GNU General Public License for more details.
14    */
15   
16    package org.qedeq.kernel.xml.handler.module;
17   
18    import org.qedeq.kernel.se.dto.module.FormalProofVo;
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    * Parse a proposition.
26    *
27    * @author Michael Meyling
28    */
 
29    public class FormalProofHandler extends AbstractSimpleHandler {
30   
31    /** Handle formal proofs. */
32    private final FormalProofLineListHandler formalProofLineListHandler;
33   
34    /** Value object. */
35    private FormalProofVo proof;
36   
37    /**
38    * Deals with propositions.
39    *
40    * @param handler Parent handler.
41    */
 
42  614 toggle public FormalProofHandler(final AbstractSimpleHandler handler) {
43  614 super(handler, "FORMAL_PROOF");
44  614 formalProofLineListHandler = new FormalProofLineListHandler(this);
45    }
46   
 
47  541 toggle public final void init() {
48  541 proof = null;
49    }
50   
51    /**
52    * Get proof.
53    *
54    * @return Proof.
55    */
 
56  541 toggle public final FormalProofVo getProof() {
57  541 return proof;
58    }
59   
 
60  1082 toggle public final void startElement(final String name, final SimpleAttributes attributes)
61    throws XmlSyntaxException {
62  1082 if (getStartTag().equals(name)) {
63  541 proof = new FormalProofVo();
64  541 } else if (formalProofLineListHandler.getStartTag().equals(name)) {
65  541 changeHandler(formalProofLineListHandler, name, attributes);
66    } else {
67  0 throw XmlSyntaxException.createUnexpectedTagException(name);
68    }
69    }
70   
 
71  1082 toggle public final void endElement(final String name) throws XmlSyntaxException {
72  1082 if (getStartTag().equals(name)) {
73    // nothing to do
74  541 } else if (formalProofLineListHandler.getStartTag().equals(name)) {
75  541 proof.setFormalProofLineList(formalProofLineListHandler.getFormalProofLineList());
76    } else {
77  0 throw XmlSyntaxException.createUnexpectedTagException(name);
78    }
79    }
80   
81    }