Clover Coverage Report
Coverage timestamp: Fri May 24 2013 13:47:27 UTC
../../../../../../img/srcFileCovDistChart9.png 45% of files have more coverage
13   81   7   2.6
4   37   0.54   5
5     1.4  
1    
 
  ProofHandler       Line # 30 13 7 81.8% 0.8181818
 
No Tests
 
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.ProofVo;
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    * @version $Revision: 1.1 $
28    * @author Michael Meyling
29    */
 
30    public class ProofHandler extends AbstractSimpleHandler {
31   
32    /** Handle informal proofs. */
33    private final LatexListHandler informalProofHandler;
34   
35    /** Value object. */
36    private ProofVo proof;
37   
38    /**
39    * Deals with propositions.
40    *
41    * @param handler Parent handler.
42    */
 
43  1228 toggle public ProofHandler(final AbstractSimpleHandler handler) {
44  1228 super(handler, "PROOF");
45  1228 informalProofHandler = new LatexListHandler(this, "PROOF");
46    }
47   
 
48  2953 toggle public final void init() {
49  2953 proof = null;
50    }
51   
52    /**
53    * Get proof.
54    *
55    * @return Proof.
56    */
 
57  2953 toggle public final ProofVo getProof() {
58  2953 return proof;
59    }
60   
 
61  2953 toggle public final void startElement(final String name, final SimpleAttributes attributes)
62    throws XmlSyntaxException {
63  2953 if (getStartTag().equals(name)) {
64  2953 proof = new ProofVo();
65  2953 proof.setKind(attributes.getString("kind"));
66  2953 proof.setLevel(attributes.getString("level"));
67  2953 changeHandler(informalProofHandler, name, attributes);
68    } else {
69  0 throw XmlSyntaxException.createUnexpectedTagException(name);
70    }
71    }
72   
 
73  2953 toggle public final void endElement(final String name) throws XmlSyntaxException {
74  2953 if (getStartTag().equals(name)) {
75  2953 proof.setNonFormalProof(informalProofHandler.getLatexList());
76    } else {
77  0 throw XmlSyntaxException.createUnexpectedTagException(name);
78    }
79    }
80   
81    }