Package org.jboss.metadata.spi.signature

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


            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


      if (BEAN_FACTORY_TYPE.isAssignableFrom(context.getBeanInfo().getClassInfo()))
         return null;

      ConstructorInfo ctor = Configurator.findConstructor(false, context.getBeanInfo(), cmd).getConstructorInfo();
      MetaData ctorMetaData = metaData.getComponentMetaData(new ConstructorSignature(ctor));
      MetaData paramMetaData = metaData.getComponentMetaData(new ConstructorParametersSignature(ctor, pmd.getIndex()));
     
      return populateQualifiersFromAnnotationsMetaData(ctorMetaData, paramMetaData);
   }
View Full Code Here

   private void updateAnnotations(MutableMetaDataRepository repository, ClassLoader classloader, ComponentMutableMetaData component, KernelControllerContext context, ConstructorInfo constructorInfo, int parameterIndex, Set<AnnotationMetaData> annotations, boolean add)
   {
      if (annotations == null || annotations.isEmpty())
         return;

      Signature signature = new ConstructorParametersSignature(constructorInfo, parameterIndex);
      ScopeKey scope = new ScopeKey(CommonLevels.JOINPOINT_OVERRIDE, "<NEW>" + parameterIndex);
      updateAnnotations(repository, classloader, component, context, signature, scope, annotations, add);
   }
View Full Code Here

   {
      Annotation[] annotations = null;
      Class<?> clazz = getOwner();
      if (signature instanceof ConstructorParametersSignature)
      {
         ConstructorParametersSignature cps = (ConstructorParametersSignature)signature;
         try
         {
            Constructor constructor = clazz.getConstructor(signature.getParametersTypes(clazz));
            annotations = constructor.getParameterAnnotations()[cps.getParam()];
         }
         catch (NoSuchMethodException ignored)
         {
         }
      }
View Full Code Here

      super(annotation, adapters);
   }

   protected Signature createParametersSignature(String name, String[] parameters, int index)
   {
      return new ConstructorParametersSignature(index, parameters);
   }
View Full Code Here

            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

TOP

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

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.