Package org.jboss.beans.metadata.spi

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


      assertEquals("java.lang.Object", related.getClassName());
   }

   public void testRelatedWithEnabled() throws Exception
   {
      RelatedClassMetaData related = getRelated("RelatedWithEnabled.xml");
      assertEquals("java.lang.Object", related.getClassName());
      Set<Object> enabled = related.getEnabled();
      assertNotNull(enabled);
      assertEquals(1, enabled.size());
      assertEquals("aop", enabled.iterator().next());
   }
View Full Code Here


      assertEquals("aop", enabled.iterator().next());
   }

   public void testRelatedWithEnableds() throws Exception
   {
      RelatedClassMetaData related = getRelated("RelatedWithEnableds.xml");
      assertEquals("java.lang.Object", related.getClassName());
      Set<Object> enabled = related.getEnabled();
      assertNotNull(enabled);
      assertEquals(2, enabled.size());
   }
View Full Code Here

      return this;
   }

   public BeanMetaDataBuilder addRelatedClass(String className, Object... enabled)
   {
      RelatedClassMetaData related = createRelated(className, enabled);
      return addRelatedClass(related);
   }
View Full Code Here

   public boolean equals(Object obj)
   {
      if (obj instanceof RelatedClassMetaData == false)
         return false;

      RelatedClassMetaData rcmd = (RelatedClassMetaData)obj;
      if (getClassName().equals(rcmd.getClassName()) == false)
         return false;

      return JBossObject.equals(enabled, rcmd.getEnabled());
   }
View Full Code Here

      BeanMetaData bmd = context.getBeanMetaData();
      Set<RelatedClassMetaData> related = bmd.getRelated();
      if (related == null || related.size() != 1)
         throw new IllegalArgumentException("Invalid information for contextual injection: " + bmd);
      // TODO - perhaps match which related metadata is the right one
      RelatedClassMetaData beanClassMetaData = related.iterator().next();
      KernelConfigurator configurator = context.getKernel().getConfigurator();
      BeanInfo beanInfo = configurator.getBeanInfo(beanClassMetaData.getClassName(), context.getClassLoader());
      PropertyInfo pi = beanInfo.getProperty(valueInfo.name);
      TypeInfo typeInfo = pi.getType();
      if (typeInfo.isCollection() || typeInfo.isMap())
      {
         throw new IllegalArgumentException("Cannot handle collection or map: " + valueInfo);
View Full Code Here

      return this;
   }

   public BeanMetaDataBuilder addRelatedClass(String className, Object... enabled)
   {
      RelatedClassMetaData related = createRelated(className, enabled);
      return addRelatedClass(related);
   }
View Full Code Here

TOP

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

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.