use of org.jetbrains.kotlin.resolve.lazy.descriptors.LazyAnnotationDescriptor in project kotlin by JetBrains.
the class AnnotationResolverImpl method resolveAnnotationEntries.
@NotNull
@Override
public Annotations resolveAnnotationEntries(@NotNull LexicalScope scope, @NotNull List<KtAnnotationEntry> annotationEntryElements, @NotNull BindingTrace trace, boolean shouldResolveArguments) {
if (annotationEntryElements.isEmpty())
return Annotations.Companion.getEMPTY();
List<AnnotationWithTarget> result = new ArrayList<AnnotationWithTarget>(0);
for (KtAnnotationEntry entryElement : annotationEntryElements) {
AnnotationDescriptor descriptor = trace.get(BindingContext.ANNOTATION, entryElement);
if (descriptor == null) {
descriptor = new LazyAnnotationDescriptor(new LazyAnnotationsContextImpl(this, storageManager, trace, scope), entryElement);
}
if (shouldResolveArguments) {
ForceResolveUtil.forceResolveAllContents(descriptor);
}
KtAnnotationUseSiteTarget target = entryElement.getUseSiteTarget();
if (target != null) {
result.add(new AnnotationWithTarget(descriptor, target.getAnnotationUseSiteTarget()));
} else {
result.add(new AnnotationWithTarget(descriptor, null));
}
}
return AnnotationsImpl.create(result);
}
Aggregations