panda.aop.matcher.SimpleMethodMatcher Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of panda-glue Show documentation
Show all versions of panda-glue Show documentation
Panda Glue is a ASM/AOP module of the Panda Framework.
The newest version!
package panda.aop.matcher;
import java.lang.reflect.Method;
import panda.aop.MethodMatcher;
public class SimpleMethodMatcher implements MethodMatcher {
private Method m;
public SimpleMethodMatcher(Method method) {
this.m = method;
}
public boolean match(Method method) {
if (m == method)
return true;
if (!m.getName().equals(method.getName()))
return false;
Class>[] parameterTypesMe = m.getParameterTypes();
Class>[] parameterTypesOut = method.getParameterTypes();
if (parameterTypesMe.length != parameterTypesOut.length)
return false;
for (int i = 0; i < parameterTypesMe.length; i++)
if (!parameterTypesMe[i].isAssignableFrom(parameterTypesOut[i]))
return false;
return true;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy