Clover Coverage Report
Coverage timestamp: Fri May 24 2013 13:47:27 UTC
../../../../../../img/srcFileCovDistChart9.png 45% of files have more coverage
16   85   9   3.2
8   43   0.56   5
5     1.8  
1    
 
  ChangedRuleHandler       Line # 29 16 9 86.2% 0.86206895
 
  (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.ChangedRuleVo;
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 a rule change.
26    *
27    * @author Michael Meyling
28    */
 
29    public class ChangedRuleHandler extends LatexListHandler {
30   
31    /** Rule value object. */
32    private ChangedRuleVo rule;
33   
34    /**
35    * Deals with definitions.
36    *
37    * @param handler Parent handler.
38    */
 
39  614 toggle public ChangedRuleHandler(final AbstractSimpleHandler handler) {
40  614 super(handler, "CHANGED_RULE");
41    }
42   
 
43  72 toggle public final void init() {
44  72 super.init();
45  72 rule = null;
46    }
47   
48    /**
49    * Get changed rule.
50    *
51    * @return Rule.
52    */
 
53  72 toggle public final ChangedRuleVo getChangedRule() {
54  72 return rule;
55    }
56   
 
57  216 toggle public final void startElement(final String name, final SimpleAttributes attributes)
58    throws XmlSyntaxException {
59  216 if (getStartTag().equals(name)) {
60  72 rule = new ChangedRuleVo();
61  72 if (null != attributes.getString("name")) {
62  72 rule.setName(attributes.getString("name"));
63    } else {
64  0 throw XmlSyntaxException.createMissingAttributeException(name, "name");
65    }
66  72 if (null != attributes.getString("version")) {
67  72 rule.setVersion(attributes.getString("version"));
68    } else {
69  0 throw XmlSyntaxException.createMissingAttributeException(name, "version");
70    }
71    } else {
72  144 super.startElement(name, attributes);
73    }
74    }
75   
 
76  216 toggle public final void endElement(final String name) throws XmlSyntaxException {
77  216 if (getStartTag().equals(name)) {
78  72 rule.setDescription(getLatexList());
79    } else {
80  144 super.endElement(name);
81    }
82    }
83   
84   
85    }