- All Implemented Interfaces:
Filter
- Direct Known Subclasses:
AntFilter
正则表达式过滤器
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Constructor Summary
Constructors
-
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
RegexFilter
public RegexFilter(String regex)
-
RegexFilter
public RegexFilter(Pattern pattern)
-
Method Details
-
filtrate
public boolean filtrate(String name,
URL url)
Description copied from interface: Filter
过滤资源
- Specified by:
filtrate in interface Filter
- Parameters:
name - 资源名称,即相对路径
url - 资源URL地址
- Returns:
- true: 加载 false: 不加载