Browse Source
Merge in DESIGN/design from ~HADES/design:release/10.0 to release/10.0 * commit '24c771bd55849fbf350bcd2e6e8698fdc62d7a4d': REPORT-46589 把单独过滤的类抽出来 以过滤器形式调用feature/big-screen
Hades
4 years ago
2 changed files with 36 additions and 2 deletions
@ -0,0 +1,34 @@
|
||||
package com.fr.design.file.filter; |
||||
|
||||
import com.fr.stable.Filter; |
||||
import java.util.HashSet; |
||||
import java.util.Set; |
||||
|
||||
/** |
||||
* 过滤无需遍历的jdk class
|
||||
* |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2021/1/7 |
||||
*/ |
||||
public class ClassFilter implements Filter<String> { |
||||
|
||||
|
||||
private static final Set<String> FILTER_SET = new HashSet<>(); |
||||
|
||||
private static final Filter<String> INSTANCE = new ClassFilter(); |
||||
|
||||
public static Filter<String> getInstance() { |
||||
return INSTANCE; |
||||
} |
||||
|
||||
static { |
||||
FILTER_SET.add("java.awt.image.BufferedImage"); |
||||
FILTER_SET.add("sun.awt.AppContext"); |
||||
} |
||||
|
||||
@Override |
||||
public boolean accept(String s) { |
||||
return FILTER_SET.contains(s); |
||||
} |
||||
} |
Loading…
Reference in new issue