Clover Coverage Report
Coverage timestamp: Fri May 24 2013 13:47:27 UTC
../../../../../../img/srcFileCovDistChart8.png 62% of files have more coverage
8   73   7   1.6
4   31   0.88   5
5     1.4  
1    
 
  AddHandler       Line # 29 8 7 76.5% 0.7647059
 
  (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.AddVo;
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    * Parse an Addition usage.
26    *
27    * @author Michael Meyling
28    */
 
29    public class AddHandler extends AbstractSimpleHandler {
30   
31    /** Rule value object. */
32    private AddVo add;
33   
34    /**
35    * Deals with definitions.
36    *
37    * @param handler Parent handler.
38    */
 
39  1064 toggle public AddHandler(final AbstractSimpleHandler handler) {
40  1064 super(handler, "ADD");
41    }
42   
 
43  1243 toggle public final void init() {
44  1243 add = null;
45    }
46   
47    /**
48    * Get Addition usage.
49    *
50    * @return Addition usage.
51    */
 
52  1243 toggle public final AddVo getAddVo() {
53  1243 return add;
54    }
55   
 
56  1243 toggle public final void startElement(final String name, final SimpleAttributes attributes)
57    throws XmlSyntaxException {
58  1243 if (getStartTag().equals(name)) {
59  1243 add = new AddVo(attributes.getString("ref"));
60    } else {
61  0 throw XmlSyntaxException.createUnexpectedTagException(name);
62    }
63    }
64   
 
65  1243 toggle public final void endElement(final String name) throws XmlSyntaxException {
66  1243 if (getStartTag().equals(name)) {
67    // nothing to do
68    } else {
69  0 throw XmlSyntaxException.createUnexpectedTagException(name);
70    }
71    }
72   
73    }