Package org.jboss.metadata.spi.signature

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


/*     */     }
/* 189 */     List pmds = new ArrayList();
/* 190 */     for (int i = 0; i < parameters.length; i++)
/*     */     {
/* 192 */       ParameterInfo pi = parameters[i];
/* 193 */       Signature pis = new MethodParametersSignature(pi.getName(), Configurator.getParameterTypes(this.log.isTraceEnabled(), typeInfos), i);
/*     */
/* 198 */       MetaData mdr = retrieval.getComponentMetaData(pis);
/* 199 */       if (mdr != null)
/*     */       {
/* 201 */         ValueMetaData value = null;
View Full Code Here


/*     */       {
/*     */         try
/*     */         {
/* 150 */           Method method = clazz.getMethod(signature.getName(), signature.getParametersTypes(clazz));
/* 151 */           Annotation[][] paramAnnotations = method.getParameterAnnotations();
/* 152 */           MethodParametersSignature sig = (MethodParametersSignature)signature;
/* 153 */           return new SimpleMetaDataLoader(paramAnnotations[sig.getParam()]);
/*     */         }
/*     */         catch (NoSuchMethodException e)
/*     */         {
/* 157 */           return null;
/*     */         }
/*     */       }
/* 160 */       if ((signature instanceof FieldSignature))
/*     */       {
/*     */         try
/*     */         {
/* 164 */           Field field = clazz.getField(signature.getName());
/* 165 */           return new AnnotatedElementMetaDataLoader(field);
/*     */         }
/*     */         catch (NoSuchFieldException e)
/*     */         {
/* 169 */           return null;
/*     */         }
/*     */       }
/*     */     }
/*     */
/* 174 */     if ((this.annotated instanceof Method))
/*     */     {
/* 176 */       if ((signature instanceof MethodParametersSignature))
/*     */       {
/* 178 */         Method method = (Method)this.annotated;
/* 179 */         Annotation[][] paramAnnotations = method.getParameterAnnotations();
/* 180 */         MethodParametersSignature sig = (MethodParametersSignature)signature;
/* 181 */         return new SimpleMetaDataLoader(paramAnnotations[sig.getParam()]);
/*     */       }
/*     */     }
/*     */
/* 185 */     if ((this.annotated instanceof Constructor))
/*     */     {
/* 187 */       if ((signature instanceof MethodParametersSignature))
/*     */       {
/* 189 */         Constructor constructor = (Constructor)Constructor.class.cast(this.annotated);
/* 190 */         Annotation[][] paramAnnotations = constructor.getParameterAnnotations();
/* 191 */         MethodParametersSignature sig = (MethodParametersSignature)signature;
/* 192 */         return new SimpleMetaDataLoader(paramAnnotations[sig.getParam()]);
/*     */       }
/*     */     }
/*     */
/* 196 */     return null;
/*     */   }
View Full Code Here

      List<ParameterMetaData> pmds = new ArrayList<ParameterMetaData>();
      for(int i=0; i < parameters.length; i++)
      {
         ParameterInfo pi = parameters[i];
         Signature pis = new MethodParametersSignature(
               pi.getName(),
               Configurator.getParameterTypes(log.isTraceEnabled(), typeInfos),
               i
         );
         MetaData mdr = retrieval.getComponentMetaData(pis);
View Full Code Here

            }
            return new AnnotatedElementMetaDataLoader(method);
         }
         else if (signature instanceof MethodParametersSignature)
         {
            MethodParametersSignature methodParametersSignature = (MethodParametersSignature) signature;
            Method method = methodParametersSignature.getMethod();
            if (method == null)
               method = SecurityActions.findMethod(clazz, signature.getName(), signature.getParametersTypes(clazz));
            if (method == null)
            {
               if (log.isTraceEnabled())
                  log.trace("Method with signature " + signature + " does not exist on class " + clazz.getName());
               return null;
            }
            Annotation[][] paramAnnotations = method.getParameterAnnotations();
            return new SimpleMetaDataLoader(paramAnnotations[methodParametersSignature.getParam()]);
         }
         else if (signature instanceof ConstructorParametersSignature)
         {
            ConstructorParametersSignature constructorParametersSignature = (ConstructorParametersSignature) signature;
            Constructor<?> constructor = constructorParametersSignature.getConstructor();
            if (constructor == null)
               constructor = SecurityActions.findConstructor(clazz, signature.getParametersTypes(clazz));
            if (constructor == null)
            {
               if (log.isTraceEnabled())
                  log.trace("Constructor with signature " + signature + " does not exist on class " + clazz.getName());
               return null;
            }
            Annotation[][] paramAnnotations = constructor.getParameterAnnotations();
            return new SimpleMetaDataLoader(paramAnnotations[constructorParametersSignature.getParam()]);
         }
         else if (signature instanceof FieldSignature)
         {
            FieldSignature fieldSignature = (FieldSignature) signature;
            Field field = fieldSignature.getField();
            if (field == null)
               field = SecurityActions.findField(clazz, signature.getName());
            if (field == null)
            {
               if (log.isTraceEnabled())
                  log.trace("Field " + signature.getName() + " does not exist on class " + clazz.getName());
               return null;
            }
            return new AnnotatedElementMetaDataLoader(field);
         }
      }

      if (annotated instanceof Method)
      {
         if (signature instanceof MethodParametersSignature)
         {
            Method method = (Method)annotated;
            Annotation[][] paramAnnotations = method.getParameterAnnotations();
            MethodParametersSignature sig = (MethodParametersSignature) signature;
            return new SimpleMetaDataLoader(paramAnnotations[sig.getParam()]);
         }
      }

      if (annotated instanceof Constructor)
      {
         if (signature instanceof ConstructorParametersSignature)
         {
            Constructor<?> constructor = Constructor.class.cast(annotated);
            Annotation[][] paramAnnotations = constructor.getParameterAnnotations();
            ConstructorParametersSignature sig = (ConstructorParametersSignature) signature;
            return new SimpleMetaDataLoader(paramAnnotations[sig.getParam()]);
         }
      }

      return null;
   }
View Full Code Here

         {
            try
            {
               Method method = clazz.getMethod(signature.getName(), signature.getParametersTypes(clazz));
               Annotation[][] paramAnnotations = method.getParameterAnnotations();
               MethodParametersSignature sig = (MethodParametersSignature) signature;
               return new SimpleMetaDataLoader(paramAnnotations[sig.getParam()]);
            }
            catch (NoSuchMethodException e)
            {
               return null;
            }
View Full Code Here

TOP

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

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.