@Override public List<MethodNode> getAllDeclaredMethods() { List<MethodNode> allMethods = new LinkedList<MethodNode>(); for (ClassNode delegate : delegates) { allMethods.addAll(delegate.getAllDeclaredMethods()); } return allMethods; }
private void checkMethodsForIncorrectName(ClassNode cn) { if (!strictNames) return; List<MethodNode> methods = cn.getAllDeclaredMethods(); for (MethodNode mNode : methods) { String name = mNode.getName(); if (name.equals("<init>") || name.equals("<clinit>")) continue; // Groovy allows more characters than Character.isValidJavaIdentifier() would allow // if we find a good way to encode special chars we could remove (some of) these checks for (String ch : INVALID_NAME_CHARS) { if (name.contains(ch)) { addError("You are not allowed to have '" + ch + "' in a method name", mNode); } } } }
private static List<ClassNode[]> extractSignaturesFromMethods(final ClassNode cn) { List<MethodNode> methods = cn.getAllDeclaredMethods(); List<ClassNode[]> signatures = new LinkedList<ClassNode[]>(); for (MethodNode method : methods) { if (!method.isSynthetic() && method.isAbstract()) { extractParametersFromMethod(signatures, method); } } return signatures; }
public static void addPseudoProperties(ClassNode origType, ClassNode cNode, List<PropertyNode> result, Set<String> names, boolean includeStatic, boolean includePseudoGetters, boolean includePseudoSetters) { if (!includePseudoGetters && !includePseudoSetters) return; List<MethodNode> methods = cNode.getAllDeclaredMethods(); for (MethodNode mNode : methods) { if (!includeStatic && mNode.isStatic()) continue;
private void processClass(ClassNode cNode, final ClassCodeVisitorSupport visitor) { if (!isEnabled(cNode)) return; if (cNode.isInterface()) { addError("Error processing interface '" + cNode.getName() + "'. " + MY_TYPE_NAME + " only allowed for classes.", cNode); return; } for (ConstructorNode cn : cNode.getDeclaredConstructors()) { if (hasNoExplicitAutoFinal(cn)) { processConstructorOrMethod(cn, visitor); } } for (MethodNode mn : cNode.getAllDeclaredMethods()) { if (hasNoExplicitAutoFinal(mn)) { processConstructorOrMethod(mn, visitor); } } Iterator<InnerClassNode> it = cNode.getInnerClasses(); while (it.hasNext()) { InnerClassNode in = it.next(); if (in.getAnnotations(MY_TYPE).isEmpty()) { processClass(in, visitor); } } visitor.visitClass(cNode); }
public void createMopMethods() { ClassNode classNode = controller.getClassNode(); if (classNode.declaresInterface(ClassHelper.GENERATED_CLOSURE_Type)) { return; } Set<MopKey> currentClassSignatures = buildCurrentClassSignatureSet(classNode.getMethods()); visitMopMethodList(classNode.getMethods(), true, Collections.EMPTY_SET, Collections.EMPTY_LIST); visitMopMethodList(classNode.getSuperClass().getAllDeclaredMethods(), false, currentClassSignatures, controller.getSuperMethodNames()); }
if (type.isInterface()) { methods = type.redirect().getAllDeclaredMethods(); } else { methods = type.getMethods();
Set<ASTNode> accessedMethods = (Set<ASTNode>) node.getNodeMetaData(StaticTypesMarker.PV_METHODS_ACCESS); if (accessedMethods==null) return; List<MethodNode> methods = new ArrayList<MethodNode>(node.getAllDeclaredMethods()); methods.addAll(node.getDeclaredConstructors()); Map<MethodNode, MethodNode> privateBridgeMethods = (Map<MethodNode, MethodNode>) node.getNodeMetaData(PRIVATE_BRIDGE_METHODS);
genericsSpec = GenericsUtils.createGenericsSpec(trait, genericsSpec); for (MethodNode methodNode : helperClassNode.getAllDeclaredMethods()) { String name = methodNode.getName(); Parameter[] helperMethodParams = methodNode.getParameters(); for (MethodNode declaredMethod : fieldHelperClassNode.getAllDeclaredMethods()) { if (declaredMethod.getName().endsWith(Traits.DIRECT_GETTER_SUFFIX)) { declaredMethods.add(0, declaredMethod); for (MethodNode declaredMethod : staticFieldHelperClassNode.getAllDeclaredMethods()) { if (declaredMethod.getName().endsWith(Traits.DIRECT_GETTER_SUFFIX)) { declaredMethods.add(0, declaredMethod);
private void inspectInterface(ClassNode cn, Set<ClassNode> crawled) { List<MethodNode> apiMethods = cn.getAllDeclaredMethods(); for(MethodNode apiMethod: apiMethods) { List<AnnotationNode> skipNodes = apiMethod.getAnnotations(new ClassNode(SkipStatistics.class)); if(skipNodes !=null && !skipNodes.isEmpty()) { MethodSignature ms = new MethodSignature(apiMethod, false); apiSkipStats.add(ms); } } if(!crawled.contains(cn)) { crawlParents(cn, crawled); } }
private void inspectInterface(ClassNode cn, Set<ClassNode> crawled) { List<MethodNode> apiMethods = cn.getAllDeclaredMethods(); for(MethodNode apiMethod: apiMethods) { List<AnnotationNode> skipNodes = apiMethod.getAnnotations(new ClassNode(SkipStatistics.class)); if(skipNodes !=null && !skipNodes.isEmpty()) { MethodSignature ms = new MethodSignature(apiMethod, false); apiSkipStats.add(ms); } } if(!crawled.contains(cn)) { crawlParents(cn, crawled); } }
private void createMopMethods() { visitMopMethodList(classNode.getMethods(), true); visitMopMethodList(classNode.getSuperClass().getAllDeclaredMethods(), false); }
private void createMopMethods() { visitMopMethodList(classNode.getMethods(), true); visitMopMethodList(classNode.getSuperClass().getAllDeclaredMethods(), false); }
private void createMopMethods() { visitMopMethodList(classNode.getMethods(), true); visitMopMethodList(classNode.getSuperClass().getAllDeclaredMethods(), false); }
public void createMopMethods() { ClassNode classNode = controller.getClassNode(); if (classNode.declaresInterface(ClassHelper.GENERATED_CLOSURE_Type)) { return; } visitMopMethodList(classNode.getMethods(), true); visitMopMethodList(classNode.getSuperClass().getAllDeclaredMethods(), false); }
clazz.getAllDeclaredMethods() .forEach(method -> parseMethod(newIndexer, sourceUri, clazz, classes, classFields, method)); });
for (MethodNode methodNode : declaringClass.getAllDeclaredMethods()) { threadingPolicy = getThreadingPolicy(methodNode, threadingPolicy); threadingMethod = resolveThreadingMethod(threadingPolicy);
private void applyDelegateAsyncTransform(ClassNode classNode, ClassNode targetApi, String fieldName) { List<MethodNode> methods = targetApi.getAllDeclaredMethods();