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 org.apache.commons.logging.Log;
23 import org.apache.commons.logging.LogFactory;
24 import org.apache.torque.generator.configuration.ConfigurationProvider;
25 import org.apache.torque.generator.configuration.paths.ProjectPaths;
26 import org.apache.torque.generator.control.action.MergepointAction;
27 import org.xml.sax.Attributes;
28 import org.xml.sax.SAXException;
29 import org.xml.sax.helpers.DefaultHandler;
30
31
32
33
34
35 public abstract class ActionSaxHandler extends DefaultHandler
36 {
37
38 private static Log log = LogFactory.getLog(ActionSaxHandler.class);
39
40
41 private MergepointAction action;
42
43
44 private ProjectPaths projectPaths;
45
46
47 private ConfigurationProvider configurationProvider;
48
49
50
51
52
53
54
55
56
57
58
59 public ActionSaxHandler(
60 MergepointAction action,
61 ConfigurationProvider configurationProvider,
62 ProjectPaths projectPaths)
63 {
64 if (action == null)
65 {
66 log.error("ActionSaxHandler: "
67 + " action is null");
68 throw new NullPointerException("Action is null");
69 }
70 if (configurationProvider == null)
71 {
72 log.error("ActionSaxHandler: "
73 + " configurationProvider is null");
74 throw new NullPointerException("configurationProvider is null");
75 }
76 if (projectPaths == null)
77 {
78 log.error("ActionSaxHandler: "
79 + " projectPaths is null");
80 throw new NullPointerException("projectPaths is null");
81 }
82 this.action = action;
83 this.configurationProvider = configurationProvider;
84 this.projectPaths = projectPaths;
85 }
86
87
88
89
90 @Override
91 public void startElement(
92 String uri,
93 String localName,
94 String rawName,
95 Attributes attributes)
96 throws SAXException
97 {
98 throw new SAXException("unknown Element " + rawName);
99 }
100
101
102
103
104
105
106 public MergepointAction getAction()
107 {
108 return action;
109 }
110
111
112
113
114
115
116 protected ConfigurationProvider getConfigurationProvider()
117 {
118 return configurationProvider;
119 }
120
121
122
123
124
125
126 protected ProjectPaths getProjectPaths()
127 {
128 return projectPaths;
129 }
130 }