Clover Coverage Report
Coverage timestamp: Sa Aug 2 2008 13:56:27 CEST
../../../../../../img/srcFileCovDistChart9.png 30% of files have more coverage
13   83   7   2,6
4   37   0,54   5
5     1,4  
1    
 
  ProofHandler       Line # 32 13 7 81,8% 0.8181818
 
  (40)
 
1    /* $Id: ProofHandler.java,v 1.1 2008/07/26 08:00:51 m31 Exp $
2    *
3    * This file is part of the project "Hilbert II" - http://www.qedeq.org
4    *
5    * Copyright 2000-2008, Michael Meyling <mime@qedeq.org>.
6    *
7    * "Hilbert II" is free software; you can redistribute
8    * it and/or modify it under the terms of the GNU General Public
9    * License as published by the Free Software Foundation; either
10    * version 2 of the License, or (at your option) any later version.
11    *
12    * This program is distributed in the hope that it will be useful,
13    * but WITHOUT ANY WARRANTY; without even the implied warranty of
14    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15    * GNU General Public License for more details.
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.common.XmlSyntaxException;
22    import org.qedeq.kernel.xml.parser.AbstractSimpleHandler;
23    import org.qedeq.kernel.xml.parser.SimpleAttributes;
24   
25   
26    /**
27    * Parse a proposition.
28    *
29    * @version $Revision: 1.1 $
30    * @author Michael Meyling
31    */
 
32    public class ProofHandler extends AbstractSimpleHandler {
33   
34    /** Handle informal proofs. */
35    private final LatexListHandler informalProofHandler;
36   
37    /** Value object. */
38    private ProofVo proof;
39   
40    /**
41    * Deals with propositions.
42    *
43    * @param handler Parent handler.
44    */
 
45  280 toggle public ProofHandler(final AbstractSimpleHandler handler) {
46  280 super(handler, "PROOF");
47  280 informalProofHandler = new LatexListHandler(this, "PROOF");
48    }
49   
 
50  96 toggle public final void init() {
51  96 proof = null;
52    }
53   
54    /**
55    * Get proof.
56    *
57    * @return Proof.
58    */
 
59  96 toggle public final ProofVo getProof() {
60  96 return proof;
61    }
62   
 
63  96 toggle public final void startElement(final String name, final SimpleAttributes attributes)
64    throws XmlSyntaxException {
65  96 if (getStartTag().equals(name)) {
66  96 proof = new ProofVo();
67  96 proof.setKind(attributes.getString("kind"));
68  96 proof.setLevel(attributes.getString("level"));
69  96 changeHandler(informalProofHandler, name, attributes);
70    } else {
71  0 throw XmlSyntaxException.createUnexpectedTagException(name);
72    }
73    }
74   
 
75  96 toggle public final void endElement(final String name) throws XmlSyntaxException {
76  96 if (getStartTag().equals(name)) {
77  96 proof.setNonFormalProof(informalProofHandler.getLatexList());
78    } else {
79  0 throw XmlSyntaxException.createUnexpectedTagException(name);
80    }
81    }
82   
83    }