Methods Summary |
---|
public void | add(java.lang.String pattern, Rule rule)Adds a Rule to be fired on given pattern.
Pattern matching is delegated to wrapped implementation.
wrappedRules.add(pattern, rule);
allRules.add(rule);
|
public void | addDefault(Rule rule)Adds a rule to be fired when wrapped implementation returns no matches
// set up rule
if (wrappedRules.getDigester() != null) {
rule.setDigester(wrappedRules.getDigester());
}
if (wrappedRules.getNamespaceURI() != null) {
rule.setNamespaceURI(wrappedRules.getNamespaceURI());
}
defaultRules.add(rule);
allRules.add(rule);
|
public void | clear()Clears all Rule's
wrappedRules.clear();
allRules.clear();
defaultRules.clear();
|
public java.util.List | getDefaults()Gets Rule's which will be fired when the wrapped implementation returns no matches
return defaultRules;
|
public Digester | getDigester()Gets digester using these Rules
return wrappedRules.getDigester();
|
public java.lang.String | getNamespaceURI()Gets namespace to apply to Rule's added
return wrappedRules.getNamespaceURI();
|
public java.util.List | match(java.lang.String pattern)
return match("", pattern);
|
public java.util.List | match(java.lang.String namespaceURI, java.lang.String pattern)Return list of rules matching given pattern.
If wrapped implementation returns any matches return those.
Otherwise, return default matches.
List matches = wrappedRules.match(namespaceURI, pattern);
if (matches == null || matches.isEmpty()) {
// a little bit of defensive programming
return new ArrayList(defaultRules);
}
// otherwise
return matches;
|
public java.util.List | rules()Gets all rules
return allRules;
|
public void | setDigester(Digester digester)Sets digeseter using these Rules
wrappedRules.setDigester(digester);
Iterator it = defaultRules.iterator();
while (it.hasNext()) {
Rule rule = (Rule) it.next();
rule.setDigester(digester);
}
|
public void | setNamespaceURI(java.lang.String namespaceURI)Sets namespace to apply to Rule's added subsequently
wrappedRules.setNamespaceURI(namespaceURI);
|