| java.lang.Object org.apache.commons.digester.AbstractRulesImpl org.apache.commons.digester.RegexRules
RegexRules | public class RegexRules extends AbstractRulesImpl (Code) | | Rules implementation that uses regular expression matching for paths.
The regex implementation is pluggable, allowing different strategies to be used.
The basic way that this class work does not vary.
All patterns are tested to see if they match the path using the regex matcher.
All those that do are return in the order which the rules were added.
since: 1.5 |
Method Summary | |
public void | clear() Clear all existing Rule instance registrations. | public RegexMatcher | getRegexMatcher() Gets the current regex matching strategy. | public List | match(String namespaceURI, String pattern) Finds matching rules by using current regex matching strategy. | protected void | registerRule(String pattern, Rule rule) Register a new Rule instance matching the specified pattern. | public List | rules() Return a List of all registered Rule instances, or a zero-length List
if there are no registered Rule instances. | public void | setRegexMatcher(RegexMatcher matcher) Sets the current regex matching strategy. |
RegexRules | public RegexRules(RegexMatcher matcher)(Code) | | Construct sets the Regex matching strategy.
Parameters: matcher - the regex strategy to be used, not null throws: IllegalArgumentException - if the strategy is null |
clear | public void clear()(Code) | | Clear all existing Rule instance registrations.
|
getRegexMatcher | public RegexMatcher getRegexMatcher()(Code) | | Gets the current regex matching strategy.
|
match | public List match(String namespaceURI, String pattern)(Code) | | Finds matching rules by using current regex matching strategy.
The rule associated with each path that matches is added to the list of matches.
The order of matching rules is the same order that they were added.
Parameters: namespaceURI - Namespace URI for which to select matching rules,or null to match regardless of namespace URI Parameters: pattern - Nesting pattern to be matched a list of matching Rule 's |
registerRule | protected void registerRule(String pattern, Rule rule)(Code) | | Register a new Rule instance matching the specified pattern.
Parameters: pattern - Nesting pattern to be matched for this Rule Parameters: rule - Rule instance to be registered |
rules | public List rules()(Code) | | Return a List of all registered Rule instances, or a zero-length List
if there are no registered Rule instances. If more than one Rule
instance has been registered, they must be returned
in the order originally registered through the add()
method.
|
setRegexMatcher | public void setRegexMatcher(RegexMatcher matcher)(Code) | | Sets the current regex matching strategy.
Parameters: matcher - use this RegexMatcher, not null throws: IllegalArgumentException - if the strategy is null |
|
|