Package org.jboss.reflect.spi

Examples of org.jboss.reflect.spi.ConstructorInfo


         paramClasses = parameterTypes;
     
      TypeInfo[] paramTypes = new TypeInfo[paramClasses.length];
      for (int i = 0; i < paramClasses.length; ++i)
         paramTypes[i] = factory.getTypeInfo(paramClasses[i]);
      ConstructorInfo constructorInfo = classInfo.getDeclaredConstructor(paramTypes);
      assertNotNull(constructorInfo);
      TypeInfo[] actualParamTypes = constructorInfo.getParameterTypes();
      for (int i = 0; i < paramTypes.length; ++i)
         assertTypeEquals(clazz + " constructorParameter" + i, paramTypes[i], actualParamTypes[i]);
      Class<?>[] exceptionClasses = constructor.getExceptionTypes();
      TypeInfo[] expectedExceptionTypes = new TypeInfo[exceptionClasses.length];
      for (int i = 0; i < exceptionClasses.length; ++i)
         expectedExceptionTypes[i] = factory.getTypeInfo(exceptionClasses[i]);
      TypeInfo[] actualExceptionTypes = constructorInfo.getExceptionTypes();
      for (int i = 0; i < exceptionClasses.length; ++i)
         assertTypeEquals(clazz + " constructorException" + i, expectedExceptionTypes[i], actualExceptionTypes[i]);
      assertEquals(classInfo, constructorInfo.getDeclaringClass());
      assertEquals(constructor.getModifiers(), constructorInfo.getModifiers());
      assertConstructorAnnotations(constructor, constructorInfo);
      assertParameterAnnotations(constructor, constructorInfo);
   }
View Full Code Here


      expectClone = new HashSet<ConstructorInfo>(expected);
      actualClone = new ArrayList<ConstructorInfo>(Arrays.asList(actually));
      for (Iterator<ConstructorInfo> i = expectClone.iterator(); i.hasNext();)
      {
         ConstructorInfo expect = i.next();
         int j = actualClone.indexOf(expect);
         ConstructorInfo actual = actualClone.get(j);
         compareConstructor(expect, actual);
      }
   }
View Full Code Here

         TypeInfo[] paramTypes = new TypeInfo[paramClasses.length];
         AnnotationValue[][] paramAnnotations = new AnnotationValue[paramClasses.length][0];
         int i = 0;
         for (Class<?> c : paramClasses)
            paramTypes[i++] = factory.getTypeInfo(c);
         ConstructorInfo c = new ConstructorInfoImpl(null, paramTypes, paramAnnotations, null, constructor.getModifiers(), classInfo);
         expected.add(c);
      }
     
      Set<ConstructorInfo> actual = beanInfo.getConstructors();
      if (expected.isEmpty())
View Full Code Here

     
      assertTrue("Not found annotations " + set, set.isEmpty());
    
      ConstructorInfo[] ctors = info.getDeclaredConstructors();
      assertEquals(1, ctors.length);
      ConstructorInfo ctor = ctors[0];
      annotations = ctor.getAnnotations();
      assertEquals(1, annotations.length);
      anotherAnnotation = getAnnotationCheckTypeAndName(ctor, AnotherAnnotation.class.getName());
   }
View Full Code Here

         TypeInfo[] paramTypes = new TypeInfo[paramClasses.length];
         AnnotationValue[][] paramAnnotations = new AnnotationValue[paramClasses.length][0];
         int i = 0;
         for (Class<?> c : paramClasses)
            paramTypes[i++] = factory.getTypeInfo(c);
         ConstructorInfo c = new ConstructorInfoImpl(null, paramTypes, paramAnnotations, null, constructor.getModifiers(), classInfo);
         expected.add(c);
      }
     
      ConstructorInfo[] result = classInfo.getDeclaredConstructors();
      if (expected.isEmpty())
View Full Code Here

         return null;
     
      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

         catch(Throwable t)
         {
            throw new RuntimeException("Error getting classloader for metadata: " + t);
         }

         ConstructorInfo constructorInfo = Configurator.resolveConstructor(log.isTraceEnabled(), beanInfo, constructorMetaData);
         if (constructorAnnotations != null && constructorAnnotations.size() > 0)
            updateAnnotations(repository, cl, mutable, context, constructorInfo, constructorAnnotations, add);
        
         if (parameterMetaDatas != null && parameterMetaDatas.size() > 0)
         {
View Full Code Here

            return handleMethod(trace, factoryInfo, cl, metaData.getFactoryMethod(), parameters, true, true, unget);
         }

         // Find the constructor
         ConstructorJoinpoint joinPoint = findConstructor(trace, info, metaData, object);
         ConstructorInfo cinfo = joinPoint.getConstructorInfo();
         // Set the parameters
         if (cinfo != null)
         {
            TypeInfo[] pinfos = cinfo.getParameterTypes();
            Object[] params = handleParameters(trace, cl, pinfos, metaData.getParameters(), unget);
            joinPoint.setArguments(params);
         }
         return joinPoint;
      }
View Full Code Here

    * @return the constructor join point
    * @throws Exception for any error
    */
   public static ConstructorJoinpoint findConstructor(boolean trace, BeanInfo info, ConstructorMetaData metaData, Object object) throws Exception
   {
      ConstructorInfo cinfo = resolveConstructor(trace, info, metaData);
      JoinpointFactory jpf = info.getJoinpointFactory();
      if (object == null)
         return jpf.getConstructorJoinpoint(cinfo);
      else
         return jpf.getConstructorJoinpoint(cinfo, object);
View Full Code Here

         // find matching parameter
         if (previous instanceof ParameterMetaData)
         {
            ParameterMetaData parameter = (ParameterMetaData) previous;
            String[] paramTypes = Configurator.getParameterTypes(false, parameters);
            ConstructorInfo ci = Configurator.findConstructorInfo(beanInfo.getClassInfo(), paramTypes);
            return applyCollectionOrMapCheck(ci.getParameterTypes()[parameter.getIndex()]);
         }
         else
         {
            // currently value constructor supports only values that are instances of class itself
            // this will add another instance with the same class to context
View Full Code Here

TOP

Related Classes of org.jboss.reflect.spi.ConstructorInfo

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.