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

nameclass, %method, %block, %line, %
ModusPonensHandler.java100% (1/1)100% (5/5)86%  (37/43)83%  (10/12)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ModusPonensHandler100% (1/1)100% (5/5)86%  (37/43)83%  (10/12)
endElement (String): void 100% (1/1)70%  (7/10)67%  (2/3)
startElement (String, SimpleAttributes): void 100% (1/1)86%  (18/21)75%  (3/4)
ModusPonensHandler (AbstractSimpleHandler): void 100% (1/1)100% (5/5)100% (2/2)
getModusPonensVo (): ModusPonensVo 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.ModusPonensVo;
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 Modus Ponens usage.
26 *
27 * @author  Michael Meyling
28 */
29public class ModusPonensHandler extends AbstractSimpleHandler {
30 
31    /** Rule value object. */
32    private ModusPonensVo modusPonens;
33 
34    /**
35     * Deals with definitions.
36     *
37     * @param   handler Parent handler.
38     */
39    public ModusPonensHandler(final AbstractSimpleHandler handler) {
40        super(handler, "MP");
41    }
42 
43    public final void init() {
44        modusPonens = null;
45    }
46 
47    /**
48     * Get Modus Ponens usage.
49     *
50     * @return  Modus Ponens usage.
51     */
52    public final ModusPonensVo getModusPonensVo() {
53        return modusPonens;
54    }
55 
56    public final void startElement(final String name, final SimpleAttributes attributes)
57            throws XmlSyntaxException {
58        if (getStartTag().equals(name)) {
59            modusPonens = new ModusPonensVo(attributes.getString("ref1"),
60                attributes.getString("ref2"));
61        } else {
62            throw XmlSyntaxException.createUnexpectedTagException(name);
63        }
64    }
65 
66    public final void endElement(final String name) throws XmlSyntaxException {
67        if (getStartTag().equals(name)) {
68            // nothing to do
69        } else {
70            throw XmlSyntaxException.createUnexpectedTagException(name);
71        }
72    }
73 
74}

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