Package org.jboss.beans.info.spi

Examples of org.jboss.beans.info.spi.BeanInfo.newInstance()


   protected Serializable createUnderlyingObject(ManagedObjectImpl managedObject, Class<? extends Serializable> clazz)
   {
      BeanInfo beanInfo = configuration.getBeanInfo(clazz);
      try
      {
         Object result = beanInfo.newInstance();
         return Serializable.class.cast(result);
      }
      catch (Throwable t)
      {
         throw new RuntimeException("Unable to create new object for " + managedObject + " clazz=" + clazz, t);
View Full Code Here


         TypeInfo rcntType = configuration.getTypeInfo(RuntimeComponentNameTransformer.class);
         if (rcntType.isAssignableFrom(type))
         {
            BeanInfo beanInfo = configuration.getBeanInfo(type);
            RuntimeComponentNameTransformer newTransformer = (RuntimeComponentNameTransformer)beanInfo.newInstance();
            transformers.put(type, newTransformer);
            return newTransformer;
         }

         return null;
View Full Code Here

   public void testDefaultConstructor() throws Throwable
   {
      BeanInfo beanInfo = getBeanInfo(BeanInfoDefaultConstructor.class);
      assertNotNull(beanInfo);
      Object object = beanInfo.newInstance();
      BeanInfoDefaultConstructor bean = assertInstanceOf(object, BeanInfoDefaultConstructor.class);
      assertTrue(bean.invoked);
   }

   public void testParameterConstructor() throws Throwable
View Full Code Here

   public void testParameterConstructor() throws Throwable
   {
      BeanInfo beanInfo = getBeanInfo(BeanInfoParameterConstructor.class);
      assertNotNull(beanInfo);
      String invoked = "invoked";
      Object object = beanInfo.newInstance(new String[] { String.class.getName() }, new Object[] { invoked });
      BeanInfoParameterConstructor bean = assertInstanceOf(object, BeanInfoParameterConstructor.class);
      assertTrue(invoked == bean.invoked);
   }

   public void testGet() throws Throwable
View Full Code Here

   public void testGet() throws Throwable
   {
      BeanInfo beanInfo = getBeanInfo(BeanInfoProperties.class);
      assertNotNull(beanInfo);
      String invoked = "invoked";
      BeanInfoProperties bean = assertInstanceOf(beanInfo.newInstance(), BeanInfoProperties.class);
      bean.notInvoked = invoked;
      assertTrue(invoked == beanInfo.getProperty(bean, "invoked"));
   }

   public void testSet() throws Throwable
View Full Code Here

   public void testSet() throws Throwable
   {
      BeanInfo beanInfo = getBeanInfo(BeanInfoProperties.class);
      assertNotNull(beanInfo);
      String invoked = "invoked";
      BeanInfoProperties bean = assertInstanceOf(beanInfo.newInstance(), BeanInfoProperties.class);
      assertNull(bean.notInvoked);
      beanInfo.setProperty(bean, "invoked", invoked);
      assertTrue(invoked == bean.notInvoked);
   }
View Full Code Here

   public void testInvokeNoParametersAndResult() throws Throwable
   {
      BeanInfo beanInfo = getBeanInfo(BeanInfoProperties.class);
      assertNotNull(beanInfo);
      String invoked = "invoked";
      BeanInfoProperties bean = assertInstanceOf(beanInfo.newInstance(), BeanInfoProperties.class);
      bean.notInvoked = invoked;
      assertTrue(invoked == beanInfo.invoke(bean, "getInvoked"));
   }

   public void testInvokeWithParameters() throws Throwable
View Full Code Here

   public void testInvokeWithParameters() throws Throwable
   {
      BeanInfo beanInfo = getBeanInfo(BeanInfoProperties.class);
      assertNotNull(beanInfo);
      String invoked = "invoked";
      BeanInfoProperties bean = assertInstanceOf(beanInfo.newInstance(), BeanInfoProperties.class);
      assertNull(bean.notInvoked);
      beanInfo.invoke(bean, "setInvoked", new String[] { String.class.getName() }, new Object[] { invoked });
      assertTrue(invoked == bean.notInvoked);
   }
  
View Full Code Here

      {

         TypeInfo typeInfo = JBossXBBuilder.configuration.getTypeInfo(type);
         BeanInfo adapterInfo = JBossXBBuilder.configuration.getBeanInfo(adapter);

         ValueAdapter valueAdapter = (ValueAdapter) adapterInfo.newInstance();

         QName qName = generateXmlName(typeInfo, XmlNsForm.QUALIFIED, overrideNamespace, overrideName);

         TypeInfo parentType = typeInfo.getTypeInfoFactory().getTypeInfo(String.class);
         TypeBinding parent = getSimpleType(parentType);
View Full Code Here

   private BeanAdapterFactory createAdapterFactory(Class<? extends BeanAdapterBuilder> beanAdapterBuilderClass, BeanInfo beanInfo, MethodInfo factory)
   {
      try
      {
         BeanInfo adapterBuilderInfo = JBossXBBuilder.configuration.getBeanInfo(beanAdapterBuilderClass);
         BeanAdapterBuilder adapterBuilder = (BeanAdapterBuilder) adapterBuilderInfo.newInstance();
         return adapterBuilder.newFactory(beanInfo, factory);
      }
      catch (Throwable t)
      {
         throw new RuntimeException("Error creating BeanAdapterFactory for "
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.