private static Class<?>[] getParameterTypes(ASTFormalParameters params) { Class<?>[] paramTypes = new Class[params.getParameterCount()]; int i = 0; for (ASTFormalParameter p : params) { Class<?> pType = p.getType(); if (pType == null) { // fail, couldn't resolve one parameter return null; } paramTypes[i++] = pType; } return paramTypes; }
private boolean isMainMethod(ASTAnyTypeBodyDeclaration bodyDeclaration) { if (DeclarationKind.METHOD != bodyDeclaration.getKind()) { return false; } ASTMethodDeclaration decl = (ASTMethodDeclaration) bodyDeclaration.getDeclarationNode(); return decl.isStatic() && "main".equals(decl.getMethodName()) && decl.getResultType().isVoid() && decl.getFormalParameters().getParameterCount() == 1 && String[].class.equals(decl.getFormalParameters().iterator().next().getType()); }
private static Class<?>[] getParameterTypes(ASTFormalParameters params) { Class<?>[] paramTypes = new Class[params.getParameterCount()]; int i = 0; for (ASTFormalParameter p : params) { Class<?> pType = p.getType(); if (pType == null) { // fail, couldn't resolve one parameter return null; } paramTypes[i++] = pType; } return paramTypes; }
private boolean isMainMethod(ASTAnyTypeBodyDeclaration bodyDeclaration) { if (DeclarationKind.METHOD != bodyDeclaration.getKind()) { return false; } ASTMethodDeclaration decl = (ASTMethodDeclaration) bodyDeclaration.getDeclarationNode(); return decl.isStatic() && "main".equals(decl.getMethodName()) && decl.getResultType().isVoid() && decl.getFormalParameters().getParameterCount() == 1 && String[].class.equals(decl.getFormalParameters().iterator().next().getType()); }