1 18 19 20 package org.apache.tomcat.util.digester; 21 22 23 import java.util.List ; 24 25 26 39 40 abstract public class AbstractRulesImpl implements Rules { 41 42 44 45 private Digester digester; 46 47 private String namespaceURI; 48 49 51 55 public Digester getDigester() { 56 return digester; 57 } 58 59 64 public void setDigester(Digester digester) { 65 this.digester = digester; 66 } 67 68 72 public String getNamespaceURI() { 73 return namespaceURI; 74 } 75 76 84 public void setNamespaceURI(String namespaceURI) { 85 this.namespaceURI = namespaceURI; 86 } 87 88 90 98 public void add(String pattern, Rule rule) { 99 if (this.digester != null) { 101 rule.setDigester(this.digester); 102 } 103 104 if (this.namespaceURI != null) { 105 rule.setNamespaceURI(this.namespaceURI); 106 } 107 108 registerRule(pattern, rule); 109 110 } 111 112 120 abstract protected void registerRule(String pattern, Rule rule); 121 122 125 abstract public void clear(); 126 127 128 139 public List match(String pattern) { 140 return match(namespaceURI, pattern); 141 } 142 143 144 155 abstract public List match(String namespaceURI, String pattern); 156 157 158 165 abstract public List rules(); 166 167 } 168 | Popular Tags |