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_ATTRIBUTE_ATTRIBUTE;
24 import static org.apache.torque.generator.configuration.mergepoint.MergepointConfigurationTags.ACTION_ELEMENT_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.SourceElementAttributeAction;
30 import org.xml.sax.Attributes;
31 import org.xml.sax.SAXException;
32
33
34
35
36
37
38 public class SourceElementAttributeActionSaxHandler extends ActionSaxHandler
39 {
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59 public SourceElementAttributeActionSaxHandler(
60 String uri,
61 String localName,
62 String qName,
63 Attributes attributes,
64 ConfigurationProvider configurationProvider,
65 ProjectPaths projectPaths)
66 throws SAXException
67 {
68 super(createAction(attributes), configurationProvider, projectPaths);
69 }
70
71
72
73
74
75
76
77
78
79
80 private static SourceElementAttributeAction createAction(
81 Attributes attributes)
82 throws SAXException
83 {
84 String element = attributes.getValue(ACTION_ELEMENT_ATTRIBUTE);
85 String attribute = attributes.getValue(ACTION_ATTRIBUTE_ATTRIBUTE);
86 Boolean acceptNotSet = SaxHelper.getBooleanAttribute(
87 ACTION_ACCEPT_NOT_SET_ATTRIBUTE,
88 attributes,
89 "the SourceElementAttributeAction " + element);
90 SourceElementAttributeAction action
91 = new SourceElementAttributeAction(
92 element,
93 attribute,
94 acceptNotSet);
95 return action;
96 }
97
98
99
100
101 @Override
102 public void startElement(
103 String uri,
104 String localName,
105 String rawName,
106 Attributes attributes)
107 throws SAXException
108 {
109 throw new SAXException("Unknown tag " + rawName);
110 }
111 }