Clover coverage report - QedeqKernelSe Coverage Report
Coverage timestamp: Sa Okt 21 2006 08:24:31 CEST
file stats: LOC: 82   Methods: 5
NCLOC: 36   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
ProofHandler.java 50% 81,8% 100% 80%
coverage coverage
 1    /* $Id: ProofHandler.java,v 1.9 2006/10/20 20:23:02 m31 Exp $
 2    *
 3    * This file is part of the project "Hilbert II" - http://www.qedeq.org
 4    *
 5    * Copyright 2000-2006, 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.base.module.Proof;
 21    import org.qedeq.kernel.dto.module.ProofVo;
 22    import org.qedeq.kernel.xml.parser.AbstractSimpleHandler;
 23    import org.qedeq.kernel.xml.parser.SyntaxException;
 24    import org.qedeq.kernel.xml.parser.SimpleAttributes;
 25   
 26   
 27    /**
 28    * Parse a proposition.
 29    *
 30    * @version $Revision: 1.9 $
 31    * @author Michael Meyling
 32    */
 33    public final class ProofHandler extends AbstractSimpleHandler {
 34   
 35    /** Handle informal proofs. */
 36    private final LatexListHandler informalProofHandler;
 37   
 38    /** Value object. */
 39    private ProofVo proof;
 40   
 41    /**
 42    * Deals with propositions.
 43    *
 44    * @param handler Parent handler.
 45    */
 46  50 public ProofHandler(final AbstractSimpleHandler handler) {
 47  50 super(handler, "PROOF");
 48  50 informalProofHandler = new LatexListHandler(this, "PROOF");
 49    }
 50   
 51  26 public final void init() {
 52  26 proof = null;
 53    }
 54   
 55    /**
 56    * Get proof.
 57    *
 58    * @return Proof.
 59    */
 60  26 public final Proof getProof() {
 61  26 return proof;
 62    }
 63   
 64  26 public final void startElement(final String name, final SimpleAttributes attributes)
 65    throws SyntaxException {
 66  26 if (getStartTag().equals(name)) {
 67  26 proof = new ProofVo();
 68  26 changeHandler(informalProofHandler, name, attributes);
 69    } else {
 70  0 throw SyntaxException.createUnexpectedTagException(name);
 71    }
 72    }
 73   
 74  26 public final void endElement(final String name) throws SyntaxException {
 75  26 if (getStartTag().equals(name)) {
 76  26 proof.setNonFormalProof(informalProofHandler.getLatexList());
 77    } else {
 78  0 throw SyntaxException.createUnexpectedTagException(name);
 79    }
 80    }
 81   
 82    }