Clover Coverage Report
Coverage timestamp: Sa Aug 2 2008 13:56:27 CEST
../../../../../../img/srcFileCovDistChart9.png 30% of files have more coverage
12   85   9   2,4
8   36   0,75   5
5     1,8  
1    
 
  UsedByListHandler       Line # 32 12 9 84% 0.84
 
  (41)
 
1    /* $Id: UsedByListHandler.java,v 1.1 2008/07/26 08:00:51 m31 Exp $
2    *
3    * This file is part of the project "Hilbert II" - http://www.qedeq.org
4    *
5    * Copyright 2000-2008, Michael Meyling <mime@qedeq.org>.
6    *
7    * "Hilbert II" is free software; you can redistribute
8    * it and/or modify it under the terms of the GNU General Public
9    * License as published by the Free Software Foundation; either
10    * version 2 of the License, or (at your option) any later version.
11    *
12    * This program is distributed in the hope that it will be useful,
13    * but WITHOUT ANY WARRANTY; without even the implied warranty of
14    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15    * GNU General Public License for more details.
16    */
17   
18    package org.qedeq.kernel.xml.handler.module;
19   
20    import org.qedeq.kernel.dto.module.UsedByListVo;
21    import org.qedeq.kernel.xml.common.XmlSyntaxException;
22    import org.qedeq.kernel.xml.parser.AbstractSimpleHandler;
23    import org.qedeq.kernel.xml.parser.SimpleAttributes;
24   
25   
26    /**
27    * Parse list of referencing modules.
28    *
29    * @version $Revision: 1.1 $
30    * @author Michael Meyling
31    */
 
32    public class UsedByListHandler extends AbstractSimpleHandler {
33   
34    /** Value object for the "this module is used by" list. */
35    private UsedByListVo list;
36   
37    /** Handler for a single module specification. */
38    private final SpecificationHandler specificationHandler;
39   
40   
41    /**
42    * Handles list of modules that use the current one.
43    *
44    * @param handler Parent handler.
45    */
 
46  140 toggle public UsedByListHandler(final AbstractSimpleHandler handler) {
47  140 super(handler, "USEDBY");
48  140 specificationHandler = new SpecificationHandler(this);
49    }
50   
 
51  41 toggle public final void init() {
52  41 list = new UsedByListVo();
53    }
54   
55    /**
56    * Get parsed result.
57    *
58    * @return Location list.
59    */
 
60  41 toggle public final UsedByListVo getUsedByList() {
61  41 return list;
62    }
63   
 
64  82 toggle public final void startElement(final String name, final SimpleAttributes attributes)
65    throws XmlSyntaxException {
66  82 if (getStartTag().equals(name)) {
67    // ignore
68  41 } else if (specificationHandler.getStartTag().equals(name)) {
69  41 changeHandler(specificationHandler, name, attributes);
70    } else {
71  0 throw XmlSyntaxException.createUnexpectedTagException(name);
72    }
73    }
74   
 
75  82 toggle public final void endElement(final String name) throws XmlSyntaxException {
76  82 if (getStartTag().equals(name)) {
77    // ignore
78  41 } else if (specificationHandler.getStartTag().equals(name)) {
79  41 list.add(specificationHandler.getSpecification());
80    } else {
81  0 throw XmlSyntaxException.createUnexpectedTagException(name);
82    }
83    }
84   
85    }