urlpatternfactory.java.svn-base

来自「用于JAVA的Web的权限过滤器」· SVN-BASE 代码 · 共 49 行

SVN-BASE
49
字号
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);
   }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?