|
1 |
| |
|
2 |
| |
|
3 |
| |
|
4 |
| |
|
5 |
| |
|
6 |
| |
|
7 |
| |
|
8 |
| |
|
9 |
| |
|
10 |
| |
|
11 |
| |
|
12 |
| |
|
13 |
| |
|
14 |
| |
|
15 |
| |
|
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.parser.AbstractSimpleHandler; |
|
22 |
| import org.qedeq.kernel.xml.parser.SimpleAttributes; |
|
23 |
| import org.qedeq.kernel.xml.parser.SyntaxException; |
|
24 |
| |
|
25 |
| |
|
26 |
| |
|
27 |
| |
|
28 |
| |
|
29 |
| |
|
30 |
| |
|
31 |
| |
|
32 |
| public final class UsedByListHandler extends AbstractSimpleHandler { |
|
33 |
| |
|
34 |
| |
|
35 |
| private UsedByListVo list; |
|
36 |
| |
|
37 |
| |
|
38 |
| private final SpecificationHandler specificationHandler; |
|
39 |
| |
|
40 |
| |
|
41 |
| |
|
42 |
| |
|
43 |
| |
|
44 |
| |
|
45 |
| |
|
46 |
27
| public UsedByListHandler(final AbstractSimpleHandler handler) {
|
|
47 |
27
| super(handler, "USEDBY");
|
|
48 |
27
| specificationHandler = new SpecificationHandler(this);
|
|
49 |
| } |
|
50 |
| |
|
51 |
15
| public final void init() {
|
|
52 |
15
| list = new UsedByListVo();
|
|
53 |
| } |
|
54 |
| |
|
55 |
| |
|
56 |
| |
|
57 |
| |
|
58 |
| |
|
59 |
| |
|
60 |
15
| public final UsedByListVo getUsedByList() {
|
|
61 |
15
| return list;
|
|
62 |
| } |
|
63 |
| |
|
64 |
30
| public final void startElement(final String name, final SimpleAttributes attributes)
|
|
65 |
| throws SyntaxException { |
|
66 |
30
| if (getStartTag().equals(name)) {
|
|
67 |
| |
|
68 |
15
| } else if (specificationHandler.getStartTag().equals(name)) {
|
|
69 |
15
| changeHandler(specificationHandler, name, attributes);
|
|
70 |
| } else { |
|
71 |
0
| throw SyntaxException.createUnexpectedTagException(name);
|
|
72 |
| } |
|
73 |
| } |
|
74 |
| |
|
75 |
30
| public final void endElement(final String name) throws SyntaxException {
|
|
76 |
30
| if (getStartTag().equals(name)) {
|
|
77 |
| |
|
78 |
15
| } else if (specificationHandler.getStartTag().equals(name)) {
|
|
79 |
15
| list.add(specificationHandler.getSpecification());
|
|
80 |
| } else { |
|
81 |
0
| throw SyntaxException.createUnexpectedTagException(name);
|
|
82 |
| } |
|
83 |
| } |
|
84 |
| |
|
85 |
| } |