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