public static boolean isCompiledKotlinPackageClass(@NotNull JavaClass javaClass) { if (javaClass.getOriginKind() == JavaClass.OriginKind.COMPILED) { return javaClass.findAnnotation(JvmAnnotationNames.KOTLIN_PACKAGE) != null || javaClass.findAnnotation(JvmAnnotationNames.KOTLIN_PACKAGE_FRAGMENT) != null; } return false; }
@NotNull public static Collection<JavaClass> getClassesInPackage(@NotNull JavaPackage javaPackage) { Collection<JavaClass> classes = javaPackage.getClasses(); Set<FqName> addedQualifiedNames = new HashSet<FqName>(classes.size()); List<JavaClass> result = new ArrayList<JavaClass>(classes.size()); for (JavaClass javaClass : classes) { FqName fqName = javaClass.getFqName(); if (fqName != null && addedQualifiedNames.add(fqName)) { result.add(javaClass); } } return result; }
private static boolean hasStaticMembers(@NotNull JavaClass javaClass) { for (JavaMethod method : javaClass.getMethods()) { if (method.isStatic() && !shouldBeInEnumClassObject(method)) { return true; } } for (JavaField field : javaClass.getFields()) { if (field.isStatic() && !field.isEnumEntry()) { return true; } } for (JavaClass nestedClass : javaClass.getInnerClasses()) { if (SingleAbstractMethodUtils.isSamInterface(nestedClass)) { return true; } if (nestedClass.isStatic() && hasStaticMembers(nestedClass)) { return true; } } return false; }
public static boolean isCompiledKotlinClass(@NotNull JavaClass javaClass) { if (javaClass.getOriginKind() == JavaClass.OriginKind.COMPILED) { return javaClass.findAnnotation(JvmAnnotationNames.KOTLIN_CLASS) != null; } return false; }