1 package org.apache.torque.generator.configuration.mergepoint;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import static org.apache.torque.generator.configuration.mergepoint.MergepointConfigurationTags.ACTION_ACCEPT_NOT_SET_ATTRIBUTE;
23 import static org.apache.torque.generator.configuration.mergepoint.MergepointConfigurationTags.ACTION_ELEMENT_ATTRIBUTE;
24 import static org.apache.torque.generator.configuration.mergepoint.MergepointConfigurationTags.ACTION_OUTLET_ATTRIBUTE;
25
26 import org.apache.torque.generator.configuration.ConfigurationProvider;
27 import org.apache.torque.generator.configuration.SaxHelper;
28 import org.apache.torque.generator.configuration.paths.ProjectPaths;
29 import org.apache.torque.generator.control.action.ApplyAction;
30 import org.apache.torque.generator.control.action.MergepointAction;
31 import org.xml.sax.Attributes;
32 import org.xml.sax.SAXException;
33
34
35
36
37
38
39 public class ApplyActionSaxHandler extends ActionSaxHandler
40 {
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61 public ApplyActionSaxHandler(
62 String uri,
63 String localName,
64 String qName,
65 Attributes attributes,
66 ConfigurationProvider configurationProvider,
67 ProjectPaths projectPaths)
68 throws SAXException
69 {
70 super(createAction(attributes), configurationProvider, projectPaths);
71 }
72
73
74
75
76
77
78
79
80
81
82 private static MergepointAction createAction(Attributes attributes)
83 throws SAXException
84 {
85 String outlet = attributes.getValue(ACTION_OUTLET_ATTRIBUTE);
86 String element = attributes.getValue(ACTION_ELEMENT_ATTRIBUTE);
87 Boolean acceptNotSet = SaxHelper.getBooleanAttribute(
88 ACTION_ACCEPT_NOT_SET_ATTRIBUTE,
89 attributes,
90 "the element " + element);
91 ApplyAction action = new ApplyAction(element, outlet, acceptNotSet);
92 return action;
93 }
94
95
96
97
98 @Override
99 public void startElement(
100 String uri,
101 String localName,
102 String rawName,
103 Attributes attributes)
104 throws SAXException
105 {
106 throw new SAXException("Unknown tag " + rawName);
107 }
108 }