1 17 18 19 package org.apache.commons.digester; 20 21 22 import java.util.List ; 23 24 25 38 39 abstract public class AbstractRulesImpl implements Rules { 40 41 43 44 private Digester digester; 45 46 private String namespaceURI; 47 48 50 54 public Digester getDigester() { 55 return digester; 56 } 57 58 63 public void setDigester(Digester digester) { 64 this.digester = digester; 65 } 66 67 71 public String getNamespaceURI() { 72 return namespaceURI; 73 } 74 75 83 public void setNamespaceURI(String namespaceURI) { 84 this.namespaceURI = namespaceURI; 85 } 86 87 89 97 public void add(String pattern, Rule rule) { 98 if (this.digester != null) { 100 rule.setDigester(this.digester); 101 } 102 103 if (this.namespaceURI != null) { 104 rule.setNamespaceURI(this.namespaceURI); 105 } 106 107 registerRule(pattern, rule); 108 109 } 110 111 119 abstract protected void registerRule(String pattern, Rule rule); 120 121 124 abstract public void clear(); 125 126 127 138 public List match(String pattern) { 139 return match(namespaceURI, pattern); 140 } 141 142 143 154 abstract public List match(String namespaceURI, String pattern); 155 156 157 164 abstract public List rules(); 165 166 } 167 | Popular Tags |