Package org.jboss.beans.metadata.spi

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


   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


      return this;
   }

   public BeanMetaDataBuilder addRelatedClass(String className, Object... enabled)
   {
      RelatedClassMetaData related = createRelated(className, enabled);
      return addRelatedClass(related);
   }
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

      assertSame(abmd, beans.get(0));
   }

   public void testRelatedClassName() throws Throwable
   {
      RelatedClassMetaData rcmd = new AbstractRelatedClassMetaData(Object.class.getName());
      Set<RelatedClassMetaData> related = new HashSet<RelatedClassMetaData>();
      related.add(rcmd);

      BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("Bean");
      builder.addRelatedClass(Object.class.getName());
View Full Code Here

   {
      AbstractBeanMetaData bean = unmarshalBean();
      Set<RelatedClassMetaData> related = bean.getRelated();
      assertNotNull(related);
      assertEquals(1, related.size());
      RelatedClassMetaData rcmd = related.iterator().next();
      assertNotNull(rcmd);
      return rcmd;
   }
View Full Code Here

      return rcmd;
   }

   public void testRelatedWithName() throws Exception
   {
      RelatedClassMetaData related = getRelated();
      assertEquals("java.lang.Object", related.getClassName());
   }
View Full Code Here

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

   public void testRelatedWithEnabled() throws Exception
   {
      RelatedClassMetaData related = getRelated();
      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();
      assertEquals("java.lang.Object", related.getClassName());
      Set<Object> enabled = related.getEnabled();
      assertNotNull(enabled);
      assertEquals(2, enabled.size());
   }
View Full Code Here

   {
      AbstractBeanMetaData bean = unmarshalBean(name);
      Set<RelatedClassMetaData> related = bean.getRelated();
      assertNotNull(related);
      assertEquals(1, related.size());
      RelatedClassMetaData rcmd = related.iterator().next();
      assertNotNull(rcmd);
      return rcmd;
   }
View Full Code Here

      return rcmd;
   }

   public void testRelatedWithName() throws Exception
   {
      RelatedClassMetaData related = getRelated("RelatedWithName.xml");
      assertEquals("java.lang.Object", related.getClassName());
   }
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.