001    /*
002     * Copyright 1999-2001,2004 The Apache Software Foundation.
003     * 
004     * Licensed under the Apache License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     * 
008     *      http://www.apache.org/licenses/LICENSE-2.0
009     * 
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    
017    
018    package org.apache.commons.workflow.io;
019    
020    
021    import org.apache.commons.digester.Digester;
022    import org.apache.commons.workflow.base.BaseRuleSet;
023    
024    
025    /**
026     * <p><strong>RuleSet</strong> for the Step definitions supported by the
027     * <em>io</em> library.  This library is normally associated with the
028     * following namespace URI:</p>
029     * <pre>
030     *   http://commons.apache.org/workflow/io
031     * </pre>
032     *
033     * @author Craig R. McClanahan
034     * @version $Revision: 561366 $ $Date: 2007-07-31 16:58:29 +0100 (Tue, 31 Jul 2007) $
035     */
036    
037    public class IoRuleSet extends BaseRuleSet {
038    
039    
040        // ------------------------------------------------------------ Constructor
041    
042    
043        /**
044         * Construct a default instance of the <code>RuleSet</code>.
045         */
046        public IoRuleSet() {
047    
048            super();
049            setNamespaceURI("http://commons.apache.org/workflow/io");
050    
051        }
052    
053    
054        // --------------------------------------------------------- Public Methods
055    
056    
057        /**
058         * <p>Add the set of Rule instances defined in this RuleSet to the
059         * specified <code>Digester</code> instance, associating them with
060         * our namespace URI (if any).  This method should only be called
061         * by a Digester instance.</p>
062         *
063         * @param digester Digester instance to which the new Rule instances
064         *  should be added.
065         */
066        public void addRuleInstances(Digester digester) {
067    
068            // Add rules for each Step defined in this package
069            addStandardStep(digester, "display",
070                            "org.apache.commons.workflow.io.DisplayStep");
071            addStandardStep(digester, "get",
072                            "org.apache.commons.workflow.io.GetStep");
073            addStandardStep(digester, "peek",
074                            "org.apache.commons.workflow.io.PeekStep");
075            addStandardStep(digester, "read",
076                            "org.apache.commons.workflow.io.ReadStep");
077            addStandardStep(digester, "write",
078                            "org.apache.commons.workflow.io.WriteStep");
079    
080            // Add rules for all variations on descriptors being matched
081            addStandardDescriptor(digester, "descriptor");   // Standard version
082    
083        }
084    
085    
086    }