EMMA Coverage Report (generated Fri Feb 14 08:28:31 UTC 2014)
[all classes][org.qedeq.kernel.xml.handler.module]

COVERAGE SUMMARY FOR SOURCE FILE [FormalProofHandler.java]

nameclass, %method, %block, %line, %
FormalProofHandler.java100% (1/1)100% (5/5)91%  (63/69)88%  (15/17)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class FormalProofHandler100% (1/1)100% (5/5)91%  (63/69)88%  (15/17)
endElement (String): void 100% (1/1)87%  (20/23)80%  (4/5)
startElement (String, SimpleAttributes): void 100% (1/1)89%  (25/28)83%  (5/6)
FormalProofHandler (AbstractSimpleHandler): void 100% (1/1)100% (11/11)100% (3/3)
getProof (): FormalProofVo 100% (1/1)100% (3/3)100% (1/1)
init (): void 100% (1/1)100% (4/4)100% (2/2)

1/* This file is part of the project "Hilbert II" - http://www.qedeq.org
2 *
3 * Copyright 2000-2014,  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 
16package org.qedeq.kernel.xml.handler.module;
17 
18import org.qedeq.kernel.se.dto.module.FormalProofVo;
19import org.qedeq.kernel.xml.common.XmlSyntaxException;
20import org.qedeq.kernel.xml.handler.common.AbstractSimpleHandler;
21import org.qedeq.kernel.xml.handler.common.SimpleAttributes;
22 
23 
24/**
25 * Parse a proposition.
26 *
27 * @author  Michael Meyling
28 */
29public 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    public FormalProofHandler(final AbstractSimpleHandler handler) {
43        super(handler, "FORMAL_PROOF");
44        formalProofLineListHandler = new FormalProofLineListHandler(this);
45    }
46 
47    public final void init() {
48        proof = null;
49    }
50 
51    /**
52     * Get proof.
53     *
54     * @return  Proof.
55     */
56    public final FormalProofVo getProof() {
57        return proof;
58    }
59 
60    public final void startElement(final String name, final SimpleAttributes attributes)
61            throws XmlSyntaxException {
62        if (getStartTag().equals(name)) {
63            proof = new FormalProofVo();
64        } else if (formalProofLineListHandler.getStartTag().equals(name)) {
65            changeHandler(formalProofLineListHandler, name, attributes);
66        } else {
67            throw XmlSyntaxException.createUnexpectedTagException(name);
68        }
69    }
70 
71    public final void endElement(final String name) throws XmlSyntaxException {
72        if (getStartTag().equals(name)) {
73            // nothing to do
74        } else if (formalProofLineListHandler.getStartTag().equals(name)) {
75            proof.setFormalProofLineList(formalProofLineListHandler.getFormalProofLineList());
76        } else {
77            throw XmlSyntaxException.createUnexpectedTagException(name);
78        }
79    }
80 
81}

[all classes][org.qedeq.kernel.xml.handler.module]
EMMA 2.1.5320 (stable) (C) Vladimir Roubtsov