1 package org.apache.commons.digester3;
2
3 /*
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
19 * under the License.
20 */
21
22 /**
23 * <p>
24 * Convenience base class that implements the {@link RuleSet} interface. Concrete implementations should list all of
25 * their actual rule creation logic in the <code>addRuleSet()</code> implementation.
26 * </p>
27 */
28 public abstract class RuleSetBase
29 implements RuleSet
30 {
31
32 // ----------------------------------------------------- Instance Variables
33
34 /**
35 * The namespace URI that all Rule instances created by this RuleSet will be associated with.
36 */
37 private final String namespaceURI;
38
39 // ----------------------------------------------------------- Constructors
40
41 /**
42 * Build a new RuleSetBase with a null namespaceURI
43 */
44 public RuleSetBase()
45 {
46 this( null );
47 }
48
49 /**
50 * Build a new RuleSetBase with the given namespaceURI
51 *
52 * @param namespaceURI The namespace URI that all Rule instances will be associated with.
53 * @since 3.0
54 */
55 public RuleSetBase( String namespaceURI )
56 {
57 this.namespaceURI = namespaceURI;
58 }
59
60 // ------------------------------------------------------------- Properties
61
62 /**
63 * {@inheritDoc}
64 */
65 public String getNamespaceURI()
66 {
67 return ( this.namespaceURI );
68 }
69
70 }