public class MethodFilter extends Object
SourcePatterns = SourcePattern ["," SourcePatterns] . SourcePattern = [ Class "." ] method [ "(" [ Parameter { ";" Parameter } ] ")" ] . Parameter = Class | "int" | "long" | "float" | "double" | "short" | "char" | "boolean" . Class = { package "." } class .Glob pattern matching (*, ?) is allowed in all parts of the source pattern. Examples for valid filters are:
visit(Argument;BlockScope)Matches all methods named "visit", with the first parameter of type "Argument", and the second parameter of type "BlockScope". The packages of the parameter types are irrelevant.
arraycopy(Object;;;;)Matches all methods named "arraycopy", with the first parameter of type "Object", and four more parameters of any type. The packages of the parameter types are irrelevant.
com.oracle.graal.compiler.graph.PostOrderNodeIterator.*Matches all methods in the class "com.oracle.graal.compiler.graph.PostOrderNodeIterator".
*Matches all methods in all classes
com.oracle.graal.compiler.graph.*.visitMatches all methods named "visit" in classes in the package "com.oracle.graal.compiler.graph".
arraycopy,toStringMatches all methods named "arraycopy" or "toString", meaning that ',' acts as an or operator.
Modifier and Type | Field and Description |
---|---|
private Pattern |
clazz |
private Pattern |
methodName |
private Pattern[] |
signature |
Constructor and Description |
---|
MethodFilter(String sourcePattern) |
Modifier and Type | Method and Description |
---|---|
private static Pattern |
createClassGlobPattern(String pattern) |
static String |
createGlobString(String pattern) |
boolean |
matches(JavaMethod o) |
static boolean |
matches(MethodFilter[] filters,
JavaMethod method)
Determines if a given method is matched by a given array of filters.
|
static boolean |
matchesClassName(MethodFilter[] filters,
String className)
Determines if a given class name is matched by a given array of filters.
|
boolean |
matchesClassName(String className)
Determines if the class part of this filter matches a given class name.
|
static MethodFilter[] |
parse(String commaSeparatedPatterns)
Parses a string containing list of comma separated filter patterns into an array of
MethodFilter s. |
String |
toString() |
private final Pattern methodName
public MethodFilter(String sourcePattern)
public static MethodFilter[] parse(String commaSeparatedPatterns)
MethodFilter
s.public static boolean matches(MethodFilter[] filters, JavaMethod method)
public static boolean matchesClassName(MethodFilter[] filters, String className)
public static String createGlobString(String pattern)
private static Pattern createClassGlobPattern(String pattern)
public boolean matchesClassName(String className)
public boolean matches(JavaMethod o)