use of org.jetbrains.kotlin.resolve.lazy.descriptors.LazyAnnotationsContextImpl 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);
}
use of org.jetbrains.kotlin.resolve.lazy.descriptors.LazyAnnotationsContextImpl in project kotlin by JetBrains.
the class ResolveSession method createAnnotations.
private LazyAnnotations createAnnotations(KtFile file, List<KtAnnotationEntry> annotationEntries) {
LexicalScope scope = fileScopeProvider.getFileResolutionScope(file);
LazyAnnotationsContextImpl lazyAnnotationContext = new LazyAnnotationsContextImpl(annotationResolver, storageManager, trace, scope);
return new LazyAnnotations(lazyAnnotationContext, annotationEntries);
}
Aggregations