001    package org.apache.commons.digester3;
002    
003    /*
004     * Licensed to the Apache Software Foundation (ASF) under one
005     * or more contributor license agreements.  See the NOTICE file
006     * distributed with this work for additional information
007     * regarding copyright ownership.  The ASF licenses this file
008     * to you under the Apache License, Version 2.0 (the
009     * "License"); you may not use this file except in compliance
010     * with the License.  You may obtain a copy of the License at
011     *
012     *   http://www.apache.org/licenses/LICENSE-2.0
013     *
014     * Unless required by applicable law or agreed to in writing,
015     * software distributed under the License is distributed on an
016     * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017     * KIND, either express or implied.  See the License for the
018     * specific language governing permissions and limitations
019     * under the License.
020     */
021    
022    /**
023     * <p>
024     * Convenience base class that implements the {@link RuleSet} interface. Concrete implementations should list all of
025     * their actual rule creation logic in the <code>addRuleSet()</code> implementation.
026     * </p>
027     */
028    public abstract class RuleSetBase
029        implements RuleSet
030    {
031    
032        // ----------------------------------------------------- Instance Variables
033    
034        /**
035         * The namespace URI that all Rule instances created by this RuleSet will be associated with.
036         */
037        private final String namespaceURI;
038    
039        // ----------------------------------------------------------- Constructors
040    
041        /**
042         * Build a new RuleSetBase with a null namespaceURI
043         */
044        public RuleSetBase()
045        {
046            this( null );
047        }
048    
049        /**
050         * Build a new RuleSetBase with the given namespaceURI
051         *
052         * @param namespaceURI The namespace URI that all Rule instances will be associated with.
053         * @since 3.0
054         */
055        public RuleSetBase( String namespaceURI )
056        {
057            this.namespaceURI = namespaceURI;
058        }
059    
060        // ------------------------------------------------------------- Properties
061    
062        /**
063         * {@inheritDoc}
064         */
065        public String getNamespaceURI()
066        {
067            return ( this.namespaceURI );
068        }
069    
070    }