1
2
3
4
5
6
7 package genie.core;
8
9
10 import org.apache.commons.digester.Digester;
11 import org.apache.commons.digester.RuleSet;
12
13 /***
14 *
15 *
16 * @author T. Kia Ntoni
17 *
18 * 3 janv. 2005
19 * ConfigRuleSet @version
20 */
21 public class ConfigRuleSet extends AbstractRuleSet {
22 private RuleSet contextRuleset;
23 private RuleSet handlerRuleset;
24 private RuleSet taskdefRuleset;
25 private RuleSet taskRuleset;
26 private RuleSet projectRuleset;
27 private RuleSet genieRuleset;
28 /***
29 *
30 */
31 public ConfigRuleSet() {
32 super();
33 contextRuleset = new ContextRuleSet();
34 genieRuleset = new CommandRuleSet();
35 ((CommandRuleSet)genieRuleset).setCmdName("genie");
36 ((CommandRuleSet)genieRuleset).setNestedCmd(false);
37 projectRuleset = new CommandRuleSet();
38 ((CommandRuleSet)projectRuleset).setCmdName("project");
39 taskRuleset = new CommandRuleSet();
40 ((CommandRuleSet)taskRuleset).setCmdName("task");
41 taskdefRuleset = new CommandRuleSet();
42 ((CommandRuleSet)taskdefRuleset).setCmdName("task-def");
43 handlerRuleset = new CommandRuleSet();
44 ((CommandRuleSet)handlerRuleset).setCmdName("handler");
45 ((CommandRuleSet)handlerRuleset).setHandler(true);
46
47 }
48
49
50
51
52 public void addRuleInstances(Digester digester) {
53
54 super.addRuleInstances(digester);
55
56 digester.addRuleSet(contextRuleset);
57
58 digester.addRuleSet(genieRuleset);
59
60 digester.addRuleSet(projectRuleset);
61
62 digester.addRuleSet(taskRuleset);
63
64 digester.addRuleSet(taskdefRuleset);
65
66 digester.addRuleSet(handlerRuleset);
67 }
68
69 /***
70 * @return Returns the contextRuleset.
71 */
72 public RuleSet getContextRuleset() {
73 return contextRuleset;
74 }
75 /***
76 * @param contextRuleset The contextRuleset to set.
77 */
78 public void setContextRuleset(RuleSet contextRuleset) {
79 this.contextRuleset = contextRuleset;
80 }
81 /***
82 * @return Returns the genieRuleset.
83 */
84 public RuleSet getGenieRuleset() {
85 return genieRuleset;
86 }
87 /***
88 * @param genieRuleset The genieRuleset to set.
89 */
90 public void setGenieRuleset(RuleSet genieRuleset) {
91 this.genieRuleset = genieRuleset;
92 }
93 /***
94 * @return Returns the handlerRuleset.
95 */
96 public RuleSet getHandlerRuleset() {
97 return handlerRuleset;
98 }
99 /***
100 * @param handlerRuleset The handlerRuleset to set.
101 */
102 public void setHandlerRuleset(RuleSet handlerRuleset) {
103 this.handlerRuleset = handlerRuleset;
104 }
105 /***
106 * @return Returns the projectRuleset.
107 */
108 public RuleSet getProjectRuleset() {
109 return projectRuleset;
110 }
111 /***
112 * @param projectRuleset The projectRuleset to set.
113 */
114 public void setProjectRuleset(RuleSet projectRuleset) {
115 this.projectRuleset = projectRuleset;
116 }
117 /***
118 * @return Returns the taskdefRuleset.
119 */
120 public RuleSet getTaskdefRuleset() {
121 return taskdefRuleset;
122 }
123 /***
124 * @param taskdefRuleset The taskdefRuleset to set.
125 */
126 public void setTaskdefRuleset(RuleSet taskdefRuleset) {
127 this.taskdefRuleset = taskdefRuleset;
128 }
129 /***
130 * @return Returns the taskRuleset.
131 */
132 public RuleSet getTaskRuleset() {
133 return taskRuleset;
134 }
135 /***
136 * @param taskRuleset The taskRuleset to set.
137 */
138 public void setTaskRuleset(RuleSet taskRuleset) {
139 this.taskRuleset = taskRuleset;
140 }
141 }