Class PatternFilter
- java.lang.Object
-
- com.tonic.analysis.query.planner.filter.PatternFilter
-
- All Implemented Interfaces:
StaticFilter
public class PatternFilter extends Object implements StaticFilter
Static filter keeping classes and methods whose names match a regex, tested with both full match and substring find.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.tonic.analysis.query.planner.filter.StaticFilter
StaticFilter.AllFilter, StaticFilter.CompositeFilter
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PatternFilterclassMatching(String regex)Builds a filter matching on the owning class name.static PatternFilterclinitMethods()Builds a filter matching static initializers.Set<ClassFile>filterClasses(Stream<ClassFile> classes)Selects the classes that pass this filter.Set<MethodEntry>filterMethods(Stream<MethodEntry> methods)Selects the methods that pass this filter.static PatternFiltermethodMatching(String regex)Builds a filter matching on the method signature or bare method name.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.tonic.analysis.query.planner.filter.StaticFilter
and, or
-
-
-
-
Method Detail
-
classMatching
public static PatternFilter classMatching(String regex)
Builds a filter matching on the owning class name.- Parameters:
regex- the pattern to compile- Returns:
- a filter with no method constraint
- Throws:
PatternSyntaxException- if the regex is malformed
-
methodMatching
public static PatternFilter methodMatching(String regex)
Builds a filter matching on the method signature or bare method name.- Parameters:
regex- the pattern to compile- Returns:
- a filter with no class constraint
- Throws:
PatternSyntaxException- if the regex is malformed
-
clinitMethods
public static PatternFilter clinitMethods()
Builds a filter matching static initializers.- Returns:
- a filter whose method pattern is ".*\\.<clinit>\\(\\)V"
-
filterMethods
public Set<MethodEntry> filterMethods(Stream<MethodEntry> methods)
Description copied from interface:StaticFilterSelects the methods that pass this filter.- Specified by:
filterMethodsin interfaceStaticFilter- Parameters:
methods- the candidate methods- Returns:
- the candidates that pass
-
filterClasses
public Set<ClassFile> filterClasses(Stream<ClassFile> classes)
Description copied from interface:StaticFilterSelects the classes that pass this filter.- Specified by:
filterClassesin interfaceStaticFilter- Parameters:
classes- the candidate classes- Returns:
- the candidates that pass
-
-