Clover coverage report - QedeqKernelSe Coverage Report
Coverage timestamp: Do Dez 29 2005 18:38:29 CET
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.8 2005/08/19 04:13:28 m31 Exp $
 2    *
 3    * This file is part of the project "Hilbert II" - http://www.qedeq.org
 4    *
 5    * Copyright 2000-2005, 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.8 $
 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  34 public ProofHandler(final AbstractSimpleHandler handler) {
 47  34 super(handler, "PROOF");
 48  34 informalProofHandler = new LatexListHandler(this, "PROOF");
 49    }
 50   
 51  18 public final void init() {
 52  18 proof = null;
 53    }
 54   
 55    /**
 56    * Get proof.
 57    *
 58    * @return Proof.
 59    */
 60  18 public final Proof getProof() {
 61  18 return proof;
 62    }
 63   
 64  18 public final void startElement(final String name, final SimpleAttributes attributes)
 65    throws SyntaxException {
 66  18 if (getStartTag().equals(name)) {
 67  18 proof = new ProofVo();
 68  18 changeHandler(informalProofHandler, name, attributes);
 69    } else {
 70  0 throw SyntaxException.createUnexpectedTagException(name);
 71    }
 72    }
 73   
 74  18 public final void endElement(final String name) throws SyntaxException {
 75  18 if (getStartTag().equals(name)) {
 76  18 proof.setNonFormalProof(informalProofHandler.getLatexList());
 77    } else {
 78  0 throw SyntaxException.createUnexpectedTagException(name);
 79    }
 80    }
 81   
 82    }