Package org.jboss.metadata.spi.signature

Examples of org.jboss.metadata.spi.signature.MethodSignature


      {
         annotation = annotationClass.getName();
      }
      if (metadata != null)
      {
         if (hasJoinPointAnnotation(m.getDeclaringClass(), new MethodSignature(m), annotation))
         {
            return true;
         }
      }
View Full Code Here


   private void addAnnotations(ClassLoader classloader, MemoryMetaDataLoader mutable, MethodInfo methodInfo, Set<AnnotationMetaData> annotations)
   {
      ScopeKey scope = new ScopeKey(CommonLevels.JOINPOINT_OVERRIDE, methodInfo.getName());
      MemoryMetaDataLoader loader = new MemoryMetaDataLoader(scope);
      addAnnotations(classloader, loader, annotations);
      mutable.addComponentMetaDataRetrieval(new MethodSignature(methodInfo), loader);
   }
View Full Code Here

            FieldInfo field = pi.getFieldInfo();

            if (setter != null)
            {
               visitedMethods.add(setter);
               Signature sis = new MethodSignature(setter);
               MetaData cmdr = retrieval.getComponentMetaData(sis);
               if (cmdr != null)
               {
                  for(AnnotationPlugin plugin : propertyAnnotationPlugins)
                  {
                     if (isApplyPhase)
                        plugin.applyAnnotation(pi, cmdr, visitor);
                     else
                        plugin.cleanAnnotation(pi, cmdr, visitor);
                  }
               }
               else if (trace)
                  log.trace("No annotations for property " + pi.getName());
            }
            else if (field != null)
            {
               Signature sis = new FieldSignature(field);
               MetaData cmdr = retrieval.getComponentMetaData(sis);
               if (cmdr != null)
               {
                  for(AnnotationPlugin plugin : fieldAnnotationPlugins)
                  {
                     if (isApplyPhase)
                        plugin.applyAnnotation(field, cmdr, visitor);
                     else
                        plugin.cleanAnnotation(field, cmdr, visitor);
                  }
               }
               else if (trace)
                  log.trace("No annotations for field " + field.getName());
            }
         }
      }
      else if (trace)
         log.trace("No properties");

      // methods
      Set<MethodInfo> methods = info.getMethods();
      if (methods != null && methods.isEmpty() == false)
      {
         for(MethodInfo mi : methods)
         {
            if (visitedMethods.contains(mi) == false)
            {
               Signature mis = new MethodSignature(mi);
               MetaData cmdr = retrieval.getComponentMetaData(mis);
               if (cmdr != null)
               {
                  for(AnnotationPlugin plugin : methodAnnotationPlugins)
                  {
                     if (isApplyPhase)
                        plugin.applyAnnotation(mi, cmdr, visitor);
                     else
                        plugin.cleanAnnotation(mi, cmdr, visitor);
                  }
               }
               else if (trace)
                  log.trace("No annotations for " + mi);
            }
         }
      }
      else if (trace)
         log.trace("No methods");

      // static methods
      MethodInfo[] staticMethods = classInfo.getDeclaredMethods();
      if (staticMethods != null && staticMethods.length != 0)
      {
         for(MethodInfo smi : staticMethods)
         {
            if (smi.isStatic() && smi.isPublic())
            {
               Signature mis = new MethodSignature(smi);
               MetaData cmdr = retrieval.getComponentMetaData(mis);
               if (cmdr != null)
               {
                  for(AnnotationPlugin plugin : methodAnnotationPlugins)
                  {
View Full Code Here

   private void addAnnotations(ClassLoader classloader, MemoryMetaDataLoader mutable, MethodInfo methodInfo, Set<AnnotationMetaData> annotations)
   {
      ScopeKey scope = new ScopeKey(CommonLevels.JOINPOINT_OVERRIDE, methodInfo.getName());
      MemoryMetaDataLoader loader = new MemoryMetaDataLoader(scope);
      addAnnotations(classloader, loader, annotations);
      mutable.addComponentMetaDataRetrieval(new MethodSignature(methodInfo), loader);
   }
View Full Code Here

    */
   public <T extends Annotation> T resolveTypedAnnotation(long hash, Method m, Class<T> annotation)
   {
      if (metadata != null)
      {
         MethodSignature signature = new MethodSignature(m.getName(), m.getParameterTypes());
         MetaData methodMD = metadata.getComponentMetaData(signature);
         if (methodMD != null)
         {
            T val = methodMD.getAnnotation(annotation);
            if (val != null) return val;
View Full Code Here

      {
         annotation = annotationClass.getName();
      }
      if (metadata != null)
      {
         if (hasJoinPointAnnotation(m.getDeclaringClass(), new MethodSignature(m), annotation))
         {
            return true;
         }
      }
View Full Code Here

/*     */   private void addAnnotations(ClassLoader classloader, MemoryMetaDataLoader mutable, MethodInfo methodInfo, Set<AnnotationMetaData> annotations)
/*     */   {
/* 212 */     ScopeKey scope = new ScopeKey(CommonLevels.JOINPOINT_OVERRIDE, methodInfo.getName());
/* 213 */     MemoryMetaDataLoader loader = new MemoryMetaDataLoader(scope);
/* 214 */     addAnnotations(classloader, loader, annotations);
/* 215 */     mutable.addComponentMetaDataRetrieval(new MethodSignature(methodInfo), loader);
/*     */   }
View Full Code Here

/*     */       {
/* 186 */         MethodInfo setter = pi.getSetter();
/* 187 */         if (setter != null)
/*     */         {
/* 189 */           visitedMethods.add(setter);
/* 190 */           Signature sis = new MethodSignature(setter);
/* 191 */           MetaData cmdr = retrieval.getComponentMetaData(sis);
/* 192 */           if (cmdr != null)
/*     */           {
/* 194 */             for (AnnotationPlugin plugin : this.propertyAnnotationPlugins)
/*     */             {
/* 196 */               if (isApplyPhase)
/* 197 */                 plugin.applyAnnotation(pi, cmdr, visitor);
/*     */               else
/* 199 */                 plugin.cleanAnnotation(pi, cmdr, visitor);
/*     */             }
/*     */           }
/* 202 */           else if (trace)
/* 203 */             this.log.trace("No annotations for property " + pi.getName());
/*     */         }
/*     */       }
/*     */     }
/* 207 */     else if (trace) {
/* 208 */       this.log.trace("No properties");
/*     */     }
/*     */
/* 211 */     Set methods = info.getMethods();
/* 212 */     if ((methods != null) && (!methods.isEmpty()))
/*     */     {
/* 214 */       for (MethodInfo mi : methods)
/*     */       {
/* 216 */         if (!visitedMethods.contains(mi))
/*     */         {
/* 218 */           Signature mis = new MethodSignature(mi);
/* 219 */           MetaData cmdr = retrieval.getComponentMetaData(mis);
/* 220 */           if (cmdr != null)
/*     */           {
/* 222 */             for (AnnotationPlugin plugin : this.methodAnnotationPlugins)
/*     */             {
/* 224 */               if (isApplyPhase)
/* 225 */                 plugin.applyAnnotation(mi, cmdr, visitor);
/*     */               else
/* 227 */                 plugin.cleanAnnotation(mi, cmdr, visitor);
/*     */             }
/*     */           }
/* 230 */           else if (trace)
/* 231 */             this.log.trace("No annotations for " + mi);
/*     */         }
/*     */       }
/*     */     }
/* 235 */     else if (trace) {
/* 236 */       this.log.trace("No methods");
/*     */     }
/*     */
/* 239 */     MethodInfo[] staticMethods = classInfo.getDeclaredMethods();
/* 240 */     if ((staticMethods != null) && (staticMethods.length != 0))
/*     */     {
/* 242 */       for (MethodInfo smi : staticMethods)
/*     */       {
/* 244 */         if ((!smi.isStatic()) || (!smi.isPublic()))
/*     */           continue;
/* 246 */         Signature mis = new MethodSignature(smi);
/* 247 */         MetaData cmdr = retrieval.getComponentMetaData(mis);
/* 248 */         if (cmdr != null)
/*     */         {
/* 250 */           for (AnnotationPlugin plugin : this.methodAnnotationPlugins)
/*     */           {
View Full Code Here

/*     */
/*     */   private void getMetaDataMethodAnnotationDependencies(MethodInfo method, MetaData metaData, HashMap<String, ArrayList<String>> dependencies) throws Exception
/*     */   {
/* 229 */     if (metaData != null)
/*     */     {
/* 231 */       MetaData methodMetaData = metaData.getComponentMetaData(new MethodSignature(method));
/* 232 */       if (methodMetaData != null)
/*     */       {
/* 234 */         for (Object annotation : methodMetaData.getAnnotations())
/*     */         {
/* 236 */           getDependenciesForMetaDataAnnotation(annotation, dependencies);
View Full Code Here

/* 131 */     return false;
/*     */   }
/*     */
/*     */   private boolean methodHasAnnotations(MetaData metaData, MethodInfo mi)
/*     */   {
/* 136 */     MethodSignature sig = new MethodSignature(mi);
/* 137 */     MetaData methodMD = metaData.getComponentMetaData(sig);
/* 138 */     if (methodMD != null)
/*     */     {
/* 140 */       return methodMD.getAnnotations() != MetaData.NO_ANNOTATIONS;
/*     */     }
View Full Code Here

TOP

Related Classes of org.jboss.metadata.spi.signature.MethodSignature

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.