Package org.jboss.beans.metadata.spi

Examples of org.jboss.beans.metadata.spi.ConstructorMetaData


      assertCollection(constructor.getValue());
   }

   public void testConstructorWithList() throws Exception
   {
      ConstructorMetaData constructor = getConstructor("ConstructorWithList.xml");
      assertNull(constructor.getFactoryClass());
      assertNull(constructor.getFactoryMethod());
      assertNull(constructor.getAnnotations());
      assertNull(constructor.getFactory());
      assertNull(constructor.getParameters());
      assertList(constructor.getValue());
   }
View Full Code Here


public class ParameterTestCase extends AbstractXMLTest
{
   protected ParameterMetaData getParameter(String name) throws Exception
   {
      AbstractBeanMetaData bean = unmarshalBean(name);
      ConstructorMetaData constructor = bean.getConstructor();
      assertNotNull(constructor);
      List<ParameterMetaData> parameters = constructor.getParameters();
      assertNotNull(parameters);
      assertEquals(1, parameters.size());
      ParameterMetaData parameter = parameters.get(0);
      assertNotNull(parameter);
      return parameter;
View Full Code Here

   public List<BeanMetaData> getBeans()
   {
      if (getBean() == null)
      {
         ConstructorMetaData constructor = getConstructor();
         if (constructor == null)
            throw new IllegalArgumentException("BeanFactory should have a class attribute or a constructor element.");
         if (constructor.getFactoryMethod() == null)
            throw new IllegalArgumentException("BeanFactory should have a class attribute or the constructor element should have a factoryMethod attribute.");
         if (constructor.getFactory() == null && constructor.getFactoryClass() == null)
            throw new IllegalArgumentException("BeanFactory should have a class attribute or the constructor element should have a either a factoryClass attribute or a factory element.");
      }

      if (getFactoryClass() == null)
         setFactoryClass(GenericBeanFactory.class.getName());
View Full Code Here

   @XmlTransient
   public BeanMetaData getBeanMetaData()
   {
      if (getBean() == null)
      {
         ConstructorMetaData constructor = getConstructor();
         if (constructor == null)
            throw new IllegalArgumentException("BeanFactory should have a class attribute or a constructor element.");
         if (constructor.getFactoryMethod() == null)
            throw new IllegalArgumentException("BeanFactory should have a class attribute or the constructor element should have a factoryMethod attribute.");
         if (constructor.getFactory() == null && constructor.getFactoryClass() == null)
            throw new IllegalArgumentException("BeanFactory should have a class attribute or the constructor element should have a either a factoryClass attribute or a factory element.");
      }

      if (getFactoryClass() == null)
         setFactoryClass(GenericBeanFactory.class.getName());
View Full Code Here

   {
      BeanMetaData beanMetaData = context.getBeanMetaData();
      if (beanMetaData == null)
         return;

      ConstructorMetaData constructorMetaData = beanMetaData.getConstructor();
      if (constructorMetaData == null)
         return;

      if (constructorMetaData.getFactory() != null || constructorMetaData.getFactoryClass() != null)
         return;

      BeanInfo beanInfo = context.getBeanInfo();
      if (beanInfo == null)
         return;

      Set<AnnotationMetaData> constructorAnnotations = constructorMetaData.getAnnotations();
      List<ParameterMetaData> parameterMetaDatas = constructorMetaData.getParameters();
      if ((constructorAnnotations != null && constructorAnnotations.size() > 0) || (parameterMetaDatas != null && parameterMetaDatas.size() > 0))
      {
         ClassLoader cl;
         try
         {
View Full Code Here

   {
      boolean trace = log.isTraceEnabled();
      if (trace)
         log.trace("Instantiating info=" + info + " metaData=" + metaData);

      ConstructorMetaData constructor = null;
      if (metaData != null)
         constructor = metaData.getConstructor();
      Joinpoint joinPoint = getConstructorJoinPoint(config, info, constructor, metaData);
      return joinPoint.dispatch();
   }
View Full Code Here

   {
      boolean trace = log.isTraceEnabled();
      if (trace)
         log.trace("Instantiating info=" + info + " metaData=" + metaData);

      ConstructorMetaData constructor = null;
      if (metaData != null)
         constructor = metaData.getConstructor();
      Joinpoint joinPoint = getConstructorJoinPoint(config, info, constructor, metaData);
      return joinPoint.dispatch();
   }
View Full Code Here

   public Object endElement(Object o, QName qName, ElementBinding element)
   {
      AbstractBeanMetaData bean = (AbstractBeanMetaData) o;
      if (bean.getBean() == null && bean.isAbstract() == false && bean.getParent() == null)
      {
         ConstructorMetaData constructor = bean.getConstructor();
         if (constructor == null)
            throw new IllegalArgumentException("Bean should have a class attribute or a constructor element.");
         if (constructor.getFactoryMethod() == null)
         {
            if (constructor.getValue() == null)
               throw new IllegalArgumentException("Bean should have a class attribute or the constructor element should have either a factoryMethod attribute or embedded value.");
         }
         else if (constructor.getFactory() == null && constructor.getFactoryClass() == null)
            throw new IllegalArgumentException("Bean should have a class attribute or the constructor element should have one of a factoryClass attribute or a factory element, or embedded value.");
      }
      return bean;
   }
View Full Code Here

   {
      boolean trace = log.isTraceEnabled();
      if (trace)
         log.trace("Instantiating info=" + info + " metaData=" + metaData);

      ConstructorMetaData constructor = null;
      if (metaData != null)
         constructor = metaData.getConstructor();
      Joinpoint joinPoint = getConstructorJoinPoint(config, info, constructor, metaData);
      return joinPoint.dispatch();
   }
View Full Code Here

         if (property == null)
            throw new IllegalArgumentException("BeanFactory should have a class attribute or a constructor element.");
         ValueMetaData value = property.getValue();
         if (value == null)
            throw new IllegalArgumentException("BeanFactory should have a class attribute or a constructor element.");
         ConstructorMetaData constructor = (ConstructorMetaData) value.getUnderlyingValue();
         if (constructor == null)
            throw new IllegalArgumentException("BeanFactory should have a class attribute or a constructor element.");
         if (constructor.getFactoryMethod() == null)
            throw new IllegalArgumentException("BeanFactory should have a class attribute or the constructor element should have a factoryMethod attribute.");
         if (constructor.getFactory() == null && constructor.getFactoryClass() == null)
            throw new IllegalArgumentException("BeanFactory should have a class attribute or the constructor element should have a either a factoryClass attribute or a factory element.");
      }
      return bean;
   }
View Full Code Here

TOP

Related Classes of org.jboss.beans.metadata.spi.ConstructorMetaData

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.