本文整理了Java中org.codehaus.groovy.ast.ClassNode.hasDeclaredMethod()
方法的一些代码示例,展示了ClassNode.hasDeclaredMethod()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ClassNode.hasDeclaredMethod()
方法的具体详情如下:
包路径:org.codehaus.groovy.ast.ClassNode
类名称:ClassNode
方法名:hasDeclaredMethod
暂无
代码示例来源:origin: org.grails/grails-plugin-testing
public Junit3TestFixtureMethodHandler(ClassNode classNode) {
this.classNode=classNode;
hasExistingSetUp = classNode.hasDeclaredMethod(SET_UP_METHOD, Parameter.EMPTY_ARRAY);
hasExistingTearDown = classNode.hasDeclaredMethod(TEAR_DOWN_METHOD, Parameter.EMPTY_ARRAY);
}
代码示例来源:origin: com.adaptc.mws/plugins-testing
protected boolean hasDeclaredMethod(ClassNode classNode, MethodNode mixinMethod) {
return classNode.hasDeclaredMethod(mixinMethod.getName(), mixinMethod.getParameters());
}
代码示例来源:origin: org.grails/grails-plugin-testing
private BlockStatement getJunit3Setup(ClassNode classNode) {
boolean hasExistingSetupMethod = classNode.hasDeclaredMethod(SET_UP_METHOD, Parameter.EMPTY_ARRAY);
BlockStatement setUpMethodBody = getOrCreateNoArgsMethodBody(classNode, SET_UP_METHOD);
if(!hasExistingSetupMethod) {
setUpMethodBody.getStatements().add(new ExpressionStatement(new MethodCallExpression(new VariableExpression("super"), SET_UP_METHOD, GrailsArtefactClassInjector.ZERO_ARGS)));
}
return setUpMethodBody;
}
代码示例来源:origin: com.adaptc.mws/plugins-testing
Parameter[] parameterTypes = delegateMethod.getParameters();
String declaredMethodName = delegateMethod.getName();
if (classNode.hasDeclaredMethod(declaredMethodName, parameterTypes)) {
return null;
代码示例来源:origin: com.adaptc.mws/plugins-testing
Parameter[] parameterTypes = thisAsFirstArgument ? getRemainingParameterTypes(declaredMethod.getParameters()) : declaredMethod.getParameters();
String methodName = declaredMethod.getName();
if (classNode.hasDeclaredMethod(methodName, parameterTypes)) {
return null;
内容来源于网络,如有侵权,请联系作者删除!