Search in sources :

Example 1 with AnnotationsImpl

use of org.jetbrains.kotlin.descriptors.annotations.AnnotationsImpl 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);
}
Also used : AnnotationDescriptor(org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor) Annotated(org.jetbrains.kotlin.descriptors.annotations.Annotated) ArrayList(java.util.ArrayList) AnnotatedSimple(org.jetbrains.kotlin.codegen.annotation.AnnotatedSimple) AnnotationsImpl(org.jetbrains.kotlin.descriptors.annotations.AnnotationsImpl)

Aggregations

ArrayList (java.util.ArrayList)1 AnnotatedSimple (org.jetbrains.kotlin.codegen.annotation.AnnotatedSimple)1 Annotated (org.jetbrains.kotlin.descriptors.annotations.Annotated)1 AnnotationDescriptor (org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor)1 AnnotationsImpl (org.jetbrains.kotlin.descriptors.annotations.AnnotationsImpl)1