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

nameclass, %method, %block, %line, %
UsedByListHandler.java100% (1/1)100% (5/5)91%  (60/66)88%  (14/16)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class UsedByListHandler100% (1/1)100% (5/5)91%  (60/66)88%  (14/16)
endElement (String): void 100% (1/1)87%  (20/23)80%  (4/5)
startElement (String, SimpleAttributes): void 100% (1/1)87%  (20/23)80%  (4/5)
UsedByListHandler (AbstractSimpleHandler): void 100% (1/1)100% (11/11)100% (3/3)
getUsedByList (): UsedByListVo 100% (1/1)100% (3/3)100% (1/1)
init (): void 100% (1/1)100% (6/6)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.UsedByListVo;
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 list of referencing modules.
26 *
27 * @version $Revision: 1.1 $
28 * @author  Michael Meyling
29 */
30public class UsedByListHandler extends AbstractSimpleHandler {
31 
32    /** Value object for the "this module is used by" list. */
33    private UsedByListVo list;
34 
35    /** Handler for a single module specification. */
36    private final SpecificationHandler specificationHandler;
37 
38 
39    /**
40     * Handles list of modules that use the current one.
41     *
42     * @param   handler Parent handler.
43     */
44    public UsedByListHandler(final AbstractSimpleHandler handler) {
45        super(handler, "USEDBY");
46        specificationHandler = new SpecificationHandler(this);
47    }
48 
49    public final void init() {
50        list = new UsedByListVo();
51    }
52 
53    /**
54     * Get parsed result.
55     *
56     * @return  Location list.
57     */
58    public final UsedByListVo getUsedByList() {
59        return list;
60    }
61 
62    public final void startElement(final String name, final SimpleAttributes attributes)
63            throws XmlSyntaxException {
64        if (getStartTag().equals(name)) {
65            // ignore
66        } else if (specificationHandler.getStartTag().equals(name)) {
67            changeHandler(specificationHandler, name, attributes);
68        } else {
69            throw XmlSyntaxException.createUnexpectedTagException(name);
70        }
71    }
72 
73    public final void endElement(final String name) throws XmlSyntaxException {
74        if (getStartTag().equals(name)) {
75            // ignore
76        } else if (specificationHandler.getStartTag().equals(name)) {
77            list.add(specificationHandler.getSpecification());
78        } else {
79            throw XmlSyntaxException.createUnexpectedTagException(name);
80        }
81    }
82 
83}

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