Package gnu.java.beans

Examples of gnu.java.beans.BeanInfoEmbryo


   */
  public static BeanInfo getBeanInfo(Class<?> beanClass, int flag)
    throws IntrospectionException
  {
    IntrospectionIncubator ii;
    BeanInfoEmbryo infoEmbryo;
   
    switch(flag)
    {
      case USE_ALL_BEANINFO:
        return getBeanInfo(beanClass);
      case IGNORE_IMMEDIATE_BEANINFO:
        Class superclass = beanClass.getSuperclass();
        ExplicitInfo explicit = new ExplicitInfo(superclass, null);
       
        ii = new IntrospectionIncubator();
        if (explicit.explicitEventSetDescriptors != null)
          ii.setEventStopClass(superclass);
       
        if (explicit.explicitMethodDescriptors != null)
          ii.setMethodStopClass(superclass);
       
        if (explicit.explicitPropertyDescriptors != null)
          ii.setPropertyStopClass(superclass);
       
        ii.addMethods(beanClass.getMethods());

        infoEmbryo = ii.getBeanInfoEmbryo();
        merge(infoEmbryo, explicit);

        infoEmbryo.setBeanDescriptor(new BeanDescriptor(beanClass, null));
       
        return infoEmbryo.getBeanInfo();
      case IGNORE_ALL_BEANINFO:
      default:
        ii = new IntrospectionIncubator();
        ii.addMethods(beanClass.getMethods());
        infoEmbryo = ii.getBeanInfoEmbryo();
        infoEmbryo.setBeanDescriptor(new BeanDescriptor(beanClass, null));
       
        return infoEmbryo.getBeanInfo();
    }
  }
View Full Code Here


    ii.setPropertyStopClass(explicit.propertyStopClass);
    ii.setEventStopClass(explicit.eventStopClass);
    ii.setMethodStopClass(explicit.methodStopClass);
    ii.addMethods(beanClass.getMethods());
   
    BeanInfoEmbryo currentInfo = ii.getBeanInfoEmbryo();
   
    merge(currentInfo, explicit);
   
    //  Sets the info's BeanDescriptor to the one we extracted from the
    // explicit BeanInfo instance(s) if they contained one. Otherwise we
    // create the BeanDescriptor from scratch.
    // Note: We do not create a copy the retrieved BeanDescriptor which will allow
    // the user to modify the instance while it is cached. However this is how
    // the RI does it.
    currentInfo.setBeanDescriptor(
        (explicit.explicitBeanDescriptor == null ?
            new BeanDescriptor(beanClass, null) :
            explicit.explicitBeanDescriptor));   
    return currentInfo.getBeanInfo();
  }
View Full Code Here

TOP

Related Classes of gnu.java.beans.BeanInfoEmbryo

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.