Clover Coverage Report
Coverage timestamp: Fri May 24 2013 13:47:27 UTC
../../../../../../img/srcFileCovDistChart8.png 62% of files have more coverage
12   86   7   2.4
4   37   0.58   5
5     1.4  
1    
 
  LiteratureItemHandler       Line # 30 12 7 81% 0.8095238
 
  (101)
 
1    /* This file is part of the project "Hilbert II" - http://www.qedeq.org
2    *
3    * Copyright 2000-2013, 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   
16    package org.qedeq.kernel.xml.handler.module;
17   
18    import org.qedeq.kernel.se.dto.module.LiteratureItemVo;
19    import org.qedeq.kernel.xml.common.XmlSyntaxException;
20    import org.qedeq.kernel.xml.handler.common.AbstractSimpleHandler;
21    import 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    */
 
30    public 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  614 toggle public LiteratureItemHandler(final AbstractSimpleHandler handler) {
49  614 super(handler, ITEM_TAG);
50  614 itemHandler = new LatexListHandler(this, ITEM_TAG);
51    }
52   
 
53  1058 toggle public final void init() {
54  1058 literatureItem = null;
55    }
56   
57    /**
58    * Get section.
59    *
60    * @return Section.
61    */
 
62  1058 toggle public final LiteratureItemVo getLiteratureItem() {
63  1058 return literatureItem;
64    }
65   
 
66  1058 toggle public final void startElement(final String name, final SimpleAttributes attributes)
67    throws XmlSyntaxException {
68  1058 if (getStartTag().equals(name)) {
69  1058 literatureItem = new LiteratureItemVo();
70  1058 literatureItem.setLabel(attributes.getString("label"));
71  1058 changeHandler(itemHandler, name, attributes);
72    } else {
73  0 throw XmlSyntaxException.createUnexpectedTagException(name);
74    }
75    }
76   
 
77  1058 toggle public final void endElement(final String name) throws XmlSyntaxException {
78  1058 if (getStartTag().equals(name)) {
79  1058 literatureItem.setItem(itemHandler.getLatexList());
80    } else {
81  0 throw XmlSyntaxException.createUnexpectedTagException(name);
82    }
83    }
84   
85   
86    }