org.apache.commons.digester.xmlrules

Class DigesterRuleParser.RulesPrefixAdapter

Enclosing Class:
DigesterRuleParser
Implemented Interfaces:
Rules

private class DigesterRuleParser.RulesPrefixAdapter
extends java.lang.Object
implements Rules

Wraps a Rules object. Delegates all the Rules interface methods to the underlying Rules object. Overrides the add method to prepend a prefix to the pattern string.

Field Summary

private Rules
delegate
private String
prefix

Constructor Summary

RulesPrefixAdapter(String patternPrefix, Rules rules)

Method Summary

void
add(String pattern, Rule rule)
Register a new Rule instance matching a pattern which is constructed by concatenating the pattern prefix with the given pattern.
void
clear()
This method passes through to the underlying Rules object.
Digester
getDigester()
This method passes through to the underlying Rules object.
String
getNamespaceURI()
This method passes through to the underlying Rules object.
List
match(String pattern)
Deprecated. Call match(namespaceURI,pattern) instead.
List
match(String namespaceURI, String pattern)
This method passes through to the underlying Rules object.
List
rules()
This method passes through to the underlying Rules object.
void
setDigester(Digester digester)
This method passes through to the underlying Rules object.
void
setNamespaceURI(String namespaceURI)
This method passes through to the underlying Rules object.

Field Details

delegate

private Rules delegate

prefix

private String prefix

Constructor Details

RulesPrefixAdapter

public RulesPrefixAdapter(String patternPrefix,
                          Rules rules)
Parameters:
patternPrefix - the pattern string to prepend to the pattern passed to the add method.
rules - The wrapped Rules object. All of this class's methods pass through to this object.

Method Details

add

public void add(String pattern,
                Rule rule)
Register a new Rule instance matching a pattern which is constructed by concatenating the pattern prefix with the given pattern.
Specified by:
add in interface Rules

clear

public void clear()
This method passes through to the underlying Rules object.
Specified by:
clear in interface Rules

getDigester

public Digester getDigester()
This method passes through to the underlying Rules object.
Specified by:
getDigester in interface Rules

getNamespaceURI

public String getNamespaceURI()
This method passes through to the underlying Rules object.
Specified by:
getNamespaceURI in interface Rules

match

public List match(String pattern)

Deprecated. Call match(namespaceURI,pattern) instead.

Specified by:
match in interface Rules

match

public List match(String namespaceURI,
                  String pattern)
This method passes through to the underlying Rules object.
Specified by:
match in interface Rules

rules

public List rules()
This method passes through to the underlying Rules object.
Specified by:
rules in interface Rules

setDigester

public void setDigester(Digester digester)
This method passes through to the underlying Rules object.
Specified by:
setDigester in interface Rules

setNamespaceURI

public void setNamespaceURI(String namespaceURI)
This method passes through to the underlying Rules object.
Specified by:
setNamespaceURI in interface Rules

Copyright 2001-2005 The Apache Software Foundation.