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 [ConditionalProofHandler.java]

nameclass, %method, %block, %line, %
ConditionalProofHandler.java100% (1/1)100% (5/5)95%  (118/124)92%  (22/24)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ConditionalProofHandler100% (1/1)100% (5/5)95%  (118/124)92%  (22/24)
endElement (String): void 100% (1/1)93%  (42/45)86%  (6/7)
startElement (String, SimpleAttributes): void 100% (1/1)94%  (46/49)89%  (8/9)
ConditionalProofHandler (AbstractSimpleHandler): void 100% (1/1)100% (5/5)100% (2/2)
getConditionalProofVo (): ConditionalProofVo 100% (1/1)100% (3/3)100% (1/1)
init (): void 100% (1/1)100% (22/22)100% (5/5)

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.ConditionalProofVo;
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 conditional proof rule usage.
26 *
27 * @author  Michael Meyling
28 */
29public class ConditionalProofHandler extends AbstractSimpleHandler {
30 
31    /** Rule value object. */
32    private ConditionalProofVo conditionalProof;
33 
34    /** Handle hypothesis. */
35    private HypothesisHandler hypothesisHandler;
36 
37    /** Handle elements. */
38    private FormalProofLineListHandler proofListHandler;
39 
40    /** Handle hypothesis. */
41    private ConclusionHandler conclusionHandler;
42 
43    /**
44     * Deals with definitions.
45     *
46     * @param   handler Parent handler.
47     */
48    public ConditionalProofHandler(final AbstractSimpleHandler handler) {
49        super(handler, "CP");
50    }
51 
52    public final void init() {
53        conditionalProof = null;
54        // we initialize the parsers only when really needed (so we have no recursive calls)
55        hypothesisHandler = new HypothesisHandler(this);
56        proofListHandler = new FormalProofLineListHandler(this);
57        conclusionHandler = new ConclusionHandler(this);
58    }
59 
60    /**
61     * Get conditional proof usage.
62     *
63     * @return  Substitute Free Variable usage.
64     */
65    public final ConditionalProofVo getConditionalProofVo() {
66        return conditionalProof;
67    }
68 
69    public final void startElement(final String name, final SimpleAttributes attributes)
70            throws XmlSyntaxException {
71        if (getStartTag().equals(name)) {
72            // ok
73        } else if (hypothesisHandler.getStartTag().equals(name)) {
74            changeHandler(hypothesisHandler, name, attributes);
75        } else if (proofListHandler.getStartTag().equals(name)) {
76            changeHandler(proofListHandler, name, attributes);
77        } else if (conclusionHandler.getStartTag().equals(name)) {
78            changeHandler(conclusionHandler, name, attributes);
79        } else {
80            throw XmlSyntaxException.createUnexpectedTagException(name);
81        }
82    }
83 
84    public final void endElement(final String name) throws XmlSyntaxException {
85        if (getStartTag().equals(name)) {
86            conditionalProof = new ConditionalProofVo(hypothesisHandler.getHypothesis(),
87                proofListHandler.getFormalProofLineList(),
88                conclusionHandler.getConclusion());
89        } else if (hypothesisHandler.getStartTag().equals(name)) {
90            // ok
91        } else if (proofListHandler.getStartTag().equals(name)) {
92            // ok
93        } else if (conclusionHandler.getStartTag().equals(name)) {
94            // ok
95        } else {
96            throw XmlSyntaxException.createUnexpectedTagException(name);
97        }
98    }
99 
100}

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