@Override public int compare(final MethodInfo f1, final MethodInfo f2) { return f1.getMethodName().compareTo(f2.getMethodName()); } });
private static boolean isKotlinInternalScope(MethodInfo method) { return method.getMethodName().indexOf('$') >= 0; }
final List<MethodInfo> nonConstructorMethods = new ArrayList<>(); for (final MethodInfo mi : methodInfo) { final String methodName = mi.getMethodName(); if (methodName.equals("<init>")) { nonConstructorMethods.add(mi);
final List<MethodInfo> nonConstructorMethods = new ArrayList<>(); for (final MethodInfo mi : methodInfo) { final String methodName = mi.getMethodName(); if (!methodName.equals("<init>") && !methodName.equals("<clinit>")) { nonConstructorMethods.add(mi);
methodNameToMethodInfo.put(f.getMethodName(), f);
private MethodInfo filterAnnotationsFor(MethodInfo method) { return new MethodInfo( method.getClassName(), method.getMethodName(), method.getAnnotationInfo() .stream() .filter(this::isVisibleAnnotation) .sorted() .collect(toList()), method.getModifiers(), method.getTypeDescriptorStr(), method.getTypeSignatureStr(), method.getParameterNames(), method.getParameterModifiers(), method.getParameterAnnotationInfo() ); }
public void println(MethodInfo method, String indentation) { append(asAnnotations(method.getAnnotationNames(), indentation)); append(indentation); if (method.getModifiersStr() != null) { append(method.getModifiersStr()).append(' '); } if (!method.isConstructor()) { append(removeQualifierFromBaseTypes(method.getResultTypeStr())).append(' '); } append(method.getMethodName()).append('('); LinkedList<String> paramTypes = method .getTypeSignature() .getParameterTypeSignatures() .stream() .map(ApiPrintWriter::removeQualifierFromBaseTypes) .collect(toCollection(LinkedList::new)); //if parameter is varargs, remove the array [] qualifier and replace with ellipsis if (method.isVarArgs() && !paramTypes.isEmpty()) { String vararg = paramTypes.removeLast(); paramTypes.add(vararg.substring(0, vararg.length() - 2) + "..."); } append(paramTypes.stream().collect(joining(", "))); println(')'); }
for (final MethodInfo mi : methodInfoSorted) { if (!mi.getMethodName().equals("<clinit>")) { buf.append("<tr>"); buf.append(' '); if (!mi.getMethodName().equals("<init>")) { if (mi.getMethodName().equals("<init>")) { GraphvizUtils.htmlEncode(mi.getMethodName(), buf);
@Override public Set<Method> getMethodsWithAnyParamAnnotated(Class clazz) { Map<String, ClassInfo> classInfos = scanResult.getClassNameToClassInfo(); Set<MethodIdentifier> methodIdentifiers = new HashSet<>(); for (ClassInfo classInfo : classInfos.values()){ for (MethodInfo methodInfo : classInfo.getMethodAndConstructorInfo()) { AnnotationInfo[][] parametersAnnotationInfo = methodInfo.getParameterAnnotationInfo(); if (parametersAnnotationInfo != null) for (AnnotationInfo[] oneParametersAnnotationInfo: parametersAnnotationInfo) { for (AnnotationInfo ai : oneParametersAnnotationInfo) { if (ai.getAnnotationType() == clazz) { methodIdentifiers.add(new MethodIdentifier(methodInfo.getClassName(), methodInfo.getMethodName(), methodInfo.getParameterTypeSignatures())); } } } } } Set<Method> methods = new HashSet<>(methodIdentifiers.size()); for (MethodIdentifier methodIdentifier : methodIdentifiers) { Class<?> classe = scanResult.classNameToClassRef(methodIdentifier.getClassName()); for (Method method : classe.getDeclaredMethods()) { if (methodIdentifier.matchesMethod(classe, method, scanResult)){ methods.add(method); } } } return methods; }
for (AnnotationInfo ai : oneParametersAnnotationInfo) { if (ai.getAnnotationType() == clazz) { methodIdentifiers.add(new MethodIdentifier(methodInfo.getClassName(), methodInfo.getMethodName(), methodInfo.getParameterTypeSignatures()));