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.io; 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>io</em> library. This library is normally associated with the 28 * following namespace URI:</p> 29 * <pre> 30 * http://commons.apache.org/workflow/io 31 * </pre> 32 * 33 * @author Craig R. McClanahan 34 * @version $Revision: 561366 $ $Date: 2007-07-31 16:58:29 +0100 (Tue, 31 Jul 2007) $ 35 */ 36 37 public class IoRuleSet extends BaseRuleSet { 38 39 40 // ------------------------------------------------------------ Constructor 41 42 43 /** 44 * Construct a default instance of the <code>RuleSet</code>. 45 */ 46 public IoRuleSet() { 47 48 super(); 49 setNamespaceURI("http://commons.apache.org/workflow/io"); 50 51 } 52 53 54 // --------------------------------------------------------- Public Methods 55 56 57 /** 58 * <p>Add the set of Rule instances defined in this RuleSet to the 59 * specified <code>Digester</code> instance, associating them with 60 * our namespace URI (if any). This method should only be called 61 * by a Digester instance.</p> 62 * 63 * @param digester Digester instance to which the new Rule instances 64 * should be added. 65 */ 66 public void addRuleInstances(Digester digester) { 67 68 // Add rules for each Step defined in this package 69 addStandardStep(digester, "display", 70 "org.apache.commons.workflow.io.DisplayStep"); 71 addStandardStep(digester, "get", 72 "org.apache.commons.workflow.io.GetStep"); 73 addStandardStep(digester, "peek", 74 "org.apache.commons.workflow.io.PeekStep"); 75 addStandardStep(digester, "read", 76 "org.apache.commons.workflow.io.ReadStep"); 77 addStandardStep(digester, "write", 78 "org.apache.commons.workflow.io.WriteStep"); 79 80 // Add rules for all variations on descriptors being matched 81 addStandardDescriptor(digester, "descriptor"); // Standard version 82 83 } 84 85 86 }