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

nameclass, %method, %block, %line, %
LiteratureItemHandler.java100% (1/1)100% (5/5)90%  (56/62)88%  (14/16)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class LiteratureItemHandler100% (1/1)100% (5/5)90%  (56/62)88%  (14/16)
endElement (String): void 100% (1/1)81%  (13/16)75%  (3/4)
startElement (String, SimpleAttributes): void 100% (1/1)89%  (24/27)83%  (5/6)
LiteratureItemHandler (AbstractSimpleHandler): void 100% (1/1)100% (12/12)100% (3/3)
getLiteratureItem (): LiteratureItemVo 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.LiteratureItemVo;
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 * Handle bibliography entry.
26 *
27 * @version $Revision: 1.1 $
28 * @author  Michael Meyling
29 */
30public  class LiteratureItemHandler extends AbstractSimpleHandler {
31 
32    /** Tag for this handler. */
33    public static final String ITEM_TAG = "ITEM";
34 
35    /** Handle reference texts. */
36    private final LatexListHandler itemHandler;
37 
38    /** Value object. */
39    private LiteratureItemVo literatureItem;
40 
41 
42    /**
43     * Constructor.
44     *
45     * @param handler
46     *            Parent handler.
47     */
48    public LiteratureItemHandler(final AbstractSimpleHandler handler) {
49        super(handler, ITEM_TAG);
50        itemHandler = new LatexListHandler(this, ITEM_TAG);
51    }
52 
53    public final void init() {
54        literatureItem = null;
55    }
56 
57    /**
58     * Get section.
59     *
60     * @return  Section.
61     */
62    public final LiteratureItemVo getLiteratureItem() {
63        return literatureItem;
64    }
65 
66    public final void startElement(final String name, final SimpleAttributes attributes)
67            throws XmlSyntaxException {
68        if (getStartTag().equals(name)) {
69            literatureItem = new LiteratureItemVo();
70            literatureItem.setLabel(attributes.getString("label"));
71            changeHandler(itemHandler, name, attributes);
72        } else {
73            throw XmlSyntaxException.createUnexpectedTagException(name);
74        }
75    }
76 
77    public final void endElement(final String name) throws XmlSyntaxException {
78        if (getStartTag().equals(name)) {
79            literatureItem.setItem(itemHandler.getLatexList());
80        } else {
81            throw XmlSyntaxException.createUnexpectedTagException(name);
82        }
83    }
84 
85 
86}

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