View Javadoc

1   /*
2    * Copyright 1999-2001,2004 The Apache Software Foundation.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  
18  package org.apache.commons.workflow.core;
19  
20  
21  import org.apache.commons.digester.Digester;
22  import org.apache.commons.workflow.base.BaseRuleSet;
23  
24  
25  /**
26   * <p><strong>RuleSet</strong> for the Step definitions supported by the
27   * <em>core</em> library.  This library is normally associated with the
28   * following namespace URI:</p>
29   * <pre>
30   *   http://commons.apache.org/workflow/core
31   * </pre>
32   *
33   * @author Craig R. McClanahan
34   * @author Preston Sheldon
35   * @version $Revision: 561366 $ $Date: 2007-07-31 16:58:29 +0100 (Tue, 31 Jul 2007) $
36   */
37  
38  public class CoreRuleSet extends BaseRuleSet {
39  
40  
41      // ------------------------------------------------------------ Constructor
42  
43  
44      /**
45       * Construct a default instance of the <code>RuleSet</code>.
46       */
47      public CoreRuleSet() {
48  
49          super();
50          setNamespaceURI("http://commons.apache.org/workflow/core");
51  
52      }
53  
54  
55      // --------------------------------------------------------- Public Methods
56  
57  
58      /**
59       * <p>Add the set of Rule instances defined in this RuleSet to the
60       * specified <code>Digester</code> instance, associating them with
61       * our namespace URI (if any).  This method should only be called
62       * by a Digester instance.</p>
63       *
64       * @param digester Digester instance to which the new Rule instances
65       *  should be added.
66       */
67      public void addRuleInstances(Digester digester) {
68  
69          // Add rules for each Step defined in this package
70          addStandardStep(digester, "and",
71                          "org.apache.commons.workflow.core.AndStep");
72          addStandardStep(digester, "break",
73                          "org.apache.commons.workflow.core.BreakStep");
74          addStandardStep(digester, "call",
75                          "org.apache.commons.workflow.core.CallStep");
76          addStandardStep(digester, "construct",
77                          "org.apache.commons.workflow.core.ConstructStep");
78          addStandardStep(digester, "duplicate",
79                          "org.apache.commons.workflow.core.DuplicateStep");
80          addStandardStep(digester, "exit",
81                          "org.apache.commons.workflow.core.ExitStep");
82          addStandardStep(digester, "get",
83                          "org.apache.commons.workflow.core.GetStep");
84          addStandardStep(digester, "goto",
85                          "org.apache.commons.workflow.core.GotoStep");
86          addStandardStep(digester, "if",
87                          "org.apache.commons.workflow.core.IfStep");
88          addStandardStep(digester, "ifAny",
89                          "org.apache.commons.workflow.core.IfAnyStep");
90          addStandardStep(digester, "ifNot",
91                          "org.apache.commons.workflow.core.IfNotStep");
92          addStandardStep(digester, "ifNotAny",
93                          "org.apache.commons.workflow.core.IfNotAnyStep");
94          addStandardStep(digester, "invoke",
95                          "org.apache.commons.workflow.core.InvokeStep");
96          addStandardStep(digester, "load",
97                          "org.apache.commons.workflow.core.LoadStep");
98          addStandardStep(digester, "notAnd",
99                          "org.apache.commons.workflow.core.NotAndStep");
100         addStandardStep(digester, "notOr",
101                         "org.apache.commons.workflow.core.NotOrStep");
102         addStandardStep(digester, "or",
103                         "org.apache.commons.workflow.core.OrStep");
104         addStandardStep(digester, "pop",
105                         "org.apache.commons.workflow.core.PopStep");
106         addStandardStep(digester, "put",
107                         "org.apache.commons.workflow.core.PutStep");
108         addStandardStep(digester, "remove",
109                         "org.apache.commons.workflow.core.RemoveStep");
110         addStandardStep(digester, "string",
111                         "org.apache.commons.workflow.core.StringStep");
112         addStandardStep(digester, "suspend",
113                         "org.apache.commons.workflow.core.SuspendStep");
114         addStandardStep(digester, "swap",
115                         "org.apache.commons.workflow.core.SwapStep");
116         addStandardStep(digester, "while",
117                         "org.apache.commons.workflow.core.WhileStep");
118         addStandardStep(digester, "whileAny",
119                         "org.apache.commons.workflow.core.WhileAnyStep");
120         addStandardStep(digester, "whileNot",
121                         "org.apache.commons.workflow.core.WhileNotStep");
122         addStandardStep(digester, "whileNotAny",
123                         "org.apache.commons.workflow.core.WhileNotAnyStep");
124 
125         // Add rules for all variations on descriptors being matched
126         addStandardDescriptor(digester, "bean");         // For invoke
127         addStandardDescriptor(digester, "class");        // For construct
128         addStandardDescriptor(digester, "descriptor");   // Standard version
129 
130     }
131 
132 
133 }