Save This Page
Home » commons-digester-1.8-src » org.apache.commons » digester » [javadoc | source]
org.apache.commons.digester
public class: RegexRules [javadoc | source]
java.lang.Object
   org.apache.commons.digester.AbstractRulesImpl
      org.apache.commons.digester.RegexRules

All Implemented Interfaces:
    Rules

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.

Constructor:
 public RegexRules(RegexMatcher matcher) 
    Construct sets the Regex matching strategy.
    Parameters:
    matcher - the regex strategy to be used, not null
    Throws:
    IllegalArgumentException - if the strategy is null
Method from org.apache.commons.digester.RegexRules Summary:
clear,   getRegexMatcher,   match,   registerRule,   rules,   setRegexMatcher
Methods from org.apache.commons.digester.AbstractRulesImpl:
add,   clear,   getDigester,   getNamespaceURI,   match,   match,   registerRule,   rules,   setDigester,   setNamespaceURI
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.commons.digester.RegexRules Detail:
 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. 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.
 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. If more than one Rule instance has been registered, they must be returned in the order originally registered through the add() method.
 public  void setRegexMatcher(RegexMatcher matcher) 
    Sets the current regex matching strategy.