1
2
3
4
5
6
7
8
9
10
11
12
13
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
26
27
28
29 public class ChangedRuleHandler extends LatexListHandler {
30
31
32 private ChangedRuleVo rule;
33
34
35
36
37
38
39 public ChangedRuleHandler(final AbstractSimpleHandler handler) {
40 super(handler, "CHANGED_RULE");
41 }
42
43 public final void init() {
44 super.init();
45 rule = null;
46 }
47
48
49
50
51
52
53 public final ChangedRuleVo getChangedRule() {
54 return rule;
55 }
56
57 public final void startElement(final String name, final SimpleAttributes attributes)
58 throws XmlSyntaxException {
59 if (getStartTag().equals(name)) {
60 rule = new ChangedRuleVo();
61 if (null != attributes.getString("name")) {
62 rule.setName(attributes.getString("name"));
63 } else {
64 throw XmlSyntaxException.createMissingAttributeException(name, "name");
65 }
66 if (null != attributes.getString("version")) {
67 rule.setVersion(attributes.getString("version"));
68 } else {
69 throw XmlSyntaxException.createMissingAttributeException(name, "version");
70 }
71 } else {
72 super.startElement(name, attributes);
73 }
74 }
75
76 public final void endElement(final String name) throws XmlSyntaxException {
77 if (getStartTag().equals(name)) {
78 rule.setDescription(getLatexList());
79 } else {
80 super.endElement(name);
81 }
82 }
83
84
85 }