use of org.jetbrains.kotlin.codegen.annotation.AnnotatedSimple in project kotlin by JetBrains.
the class MemberCodegen method generateSyntheticAnnotationsMethod.
protected void generateSyntheticAnnotationsMethod(@NotNull MemberDescriptor descriptor, @NotNull Method syntheticMethod, @NotNull Annotations annotations, @Nullable AnnotationUseSiteTarget allowedTarget) {
int flags = ACC_DEPRECATED | ACC_STATIC | ACC_SYNTHETIC | AsmUtil.getVisibilityAccessFlag(descriptor);
MethodVisitor mv = v.newMethod(JvmDeclarationOriginKt.OtherOrigin(descriptor), flags, syntheticMethod.getName(), syntheticMethod.getDescriptor(), null, null);
AnnotationCodegen.forMethod(mv, this, typeMapper).genAnnotations(new AnnotatedSimple(annotations), Type.VOID_TYPE, allowedTarget);
mv.visitCode();
mv.visitInsn(Opcodes.RETURN);
mv.visitEnd();
}
use of org.jetbrains.kotlin.codegen.annotation.AnnotatedSimple in project kotlin by JetBrains.
the class PackagePartCodegen method generateAnnotationsForPartClass.
private void generateAnnotationsForPartClass() {
List<AnnotationDescriptor> fileAnnotationDescriptors = new ArrayList<AnnotationDescriptor>();
for (KtAnnotationEntry annotationEntry : element.getAnnotationEntries()) {
AnnotationDescriptor annotationDescriptor = state.getBindingContext().get(BindingContext.ANNOTATION, annotationEntry);
if (annotationDescriptor != null) {
fileAnnotationDescriptors.add(annotationDescriptor);
}
}
Annotated annotatedFile = new AnnotatedSimple(new AnnotationsImpl(fileAnnotationDescriptors));
AnnotationCodegen.forClass(v.getVisitor(), this, state.getTypeMapper()).genAnnotations(annotatedFile, null);
}
Aggregations