www.pudn.com > SecurityFilter.rar > URLPatternFactory.java


package dev.trade.common.securityfilter.filter; 
 
import org.apache.oro.text.regex.*; 
import dev.trade.common.securityfilter.config.*; 
 
/** 
 * URLPatternFactory creates URLPattern instances. It keeps a Perl5PatternCompiler to use 
 * for the creation of a set of instances. 
 */ 
public class URLPatternFactory { 
   protected PatternCompiler compiler; 
 
   /** 
    * Constructor 
    */ 
   public URLPatternFactory() { 
      compiler = new Perl5Compiler(); 
   } 
 
   /** 
    * Create a URLPatternMatcher object that is compatible with the URLPattern 
    * objects created by this Facotry class. 
    * 
    * @return a URLPatternMatcher object compatible with the URLPatterns created by this class 
    */ 
   public URLPatternMatcher createURLPatternMatcher() { 
      return new URLPatternMatcher(); 
   } 
 
   /** 
    * Create a URLPattern instance. 
    * 
    * @param pattern url pattern in config file syntax 
    * @param constraint SecurityConstraint object to associate with this pattern 
    * @param resourceCollection WebResourceCollection to associate with this pattern 
    * @param order order in which this pattern appeared in the config file 
    * 
    * @exception Exception 
    */ 
   public URLPattern createURLPattern( 
      String pattern, 
      SecurityConstraint constraint, 
      WebResourceCollection resourceCollection, 
      int order 
   ) throws Exception { 
      return new URLPattern(pattern, constraint, resourceCollection, order, compiler); 
   } 
}