Exemplo n.º 1
0
 @Override
 public List<AnnotationDescriptor> getAnnotations() {
   if (annotations == null) {
     JetClassLikeInfo classInfo = declarationProvider.getOwnerInfo();
     JetModifierList modifierList = classInfo.getModifierList();
     if (modifierList != null) {
       AnnotationResolver annotationResolver =
           resolveSession.getInjector().getAnnotationResolver();
       annotations =
           annotationResolver.resolveAnnotations(
               resolveSession.getResolutionScope(classInfo.getScopeAnchor()),
               modifierList,
               resolveSession.getTrace());
     } else {
       annotations = Collections.emptyList();
     }
   }
   return annotations;
 }
Exemplo n.º 2
0
 private void resolveAnnotationStubsOnClassesAndConstructors(@NotNull TopDownAnalysisContext c) {
   for (Map.Entry<JetClassOrObject, ClassDescriptorWithResolutionScopes> entry :
       c.getDeclaredClasses().entrySet()) {
     JetModifierList modifierList = entry.getKey().getModifierList();
     if (modifierList != null) {
       MutableClassDescriptor descriptor = (MutableClassDescriptor) entry.getValue();
       descriptor.addAnnotations(
           annotationResolver.resolveAnnotationsWithoutArguments(
               descriptor.getScopeForClassHeaderResolution(), modifierList, trace));
     }
   }
 }
Exemplo n.º 3
0
 private void resolveAnnotationsForClassOrObject(
     AnnotationResolver annotationResolver,
     JetClassOrObject jetClass,
     MutableClassDescriptor descriptor) {
   JetModifierList modifierList = jetClass.getModifierList();
   if (modifierList != null) {
     descriptor
         .getAnnotations()
         .addAll(
             annotationResolver.resolveAnnotations(
                 descriptor.getScopeForSupertypeResolution(),
                 modifierList.getAnnotationEntries()));
   }
 }