• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java BeanInfoEmbryo类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中gnu.java.beans.BeanInfoEmbryo的典型用法代码示例。如果您正苦于以下问题:Java BeanInfoEmbryo类的具体用法?Java BeanInfoEmbryo怎么用?Java BeanInfoEmbryo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

BeanInfoEmbryo类属于gnu.java.beans包,在下文中一共展示了BeanInfoEmbryo类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getBeanInfo

点赞 2

import gnu.java.beans.BeanInfoEmbryo; //导入依赖的package包/类
/**
 * Get the BeanInfo for class <CODE>beanClass</CODE>,
 * first by looking for explicit information, next by
 * using standard design patterns to determine
 * information about the class.  It crawls up the
 * inheritance tree until it hits <CODE>topClass</CODE>.
 *
 * @param beanClass the Bean class.
 * @param stopClass the class to stop at.
 * @return the BeanInfo object representing the class.
 */
public static BeanInfo getBeanInfo(Class<?> beanClass, Class<?> stopClass)
  throws IntrospectionException
{
  ExplicitInfo explicit = new ExplicitInfo(beanClass, stopClass);

  IntrospectionIncubator ii = new IntrospectionIncubator();
  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();
}
 

开发者ID:vilie,
项目名称:javify,
代码行数:39,
代码来源:Introspector.java

示例2: getBeanInfo

点赞 2

import gnu.java.beans.BeanInfoEmbryo; //导入依赖的package包/类
/** 
 * Get the BeanInfo for class <CODE>beanClass</CODE>,
 * first by looking for explicit information, next by
 * using standard design patterns to determine
 * information about the class.  It crawls up the
 * inheritance tree until it hits <CODE>topClass</CODE>.
 *
 * @param beanClass the Bean class.
 * @param stopClass the class to stop at.
 * @return the BeanInfo object representing the class.
 */
public static BeanInfo getBeanInfo(Class<?> beanClass, Class<?> stopClass) 
  throws IntrospectionException 
{
  ExplicitInfo explicit = new ExplicitInfo(beanClass, stopClass);

  IntrospectionIncubator ii = new IntrospectionIncubator();
  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();
}
 

开发者ID:nmldiegues,
项目名称:jvm-stm,
代码行数:39,
代码来源:Introspector.java

示例3: merge

点赞 2

import gnu.java.beans.BeanInfoEmbryo; //导入依赖的package包/类
/** Adds all explicity given bean info data to the introspected
 * data.
 *
 * @param infoEmbryo Bean info data retrieved by introspection.
 * @param explicit Bean info data retrieved by BeanInfo classes.
 */
private static void merge(BeanInfoEmbryo infoEmbryo, ExplicitInfo explicit)
{
  PropertyDescriptor[] p = explicit.explicitPropertyDescriptors;
  if(p!=null)
    {
  for(int i=0;i<p.length;i++)
    {
      if(!infoEmbryo.hasProperty(p[i]))
        {
      infoEmbryo.addProperty(p[i]);
        }
    }

  // -1 should be used to denote a missing default property but
  // for robustness reasons any value below zero is discarded.
  // Not doing so would let Classpath fail where the JDK succeeds.
  if(explicit.defaultProperty > -1)
    {
      infoEmbryo.setDefaultPropertyName(p[explicit.defaultProperty].getName());
    }
    }
  EventSetDescriptor[] e = explicit.explicitEventSetDescriptors;
  if(e!=null)
    {
  for(int i=0;i<e.length;i++)
    {
      if(!infoEmbryo.hasEvent(e[i]))
        {
      infoEmbryo.addEvent(e[i]);
        }
    }

  // -1 should be used to denote a missing default event but
  // for robustness reasons any value below zero is discarded.
  // Not doing so would let Classpath fail where the JDK succeeds.
  if(explicit.defaultEvent > -1)
    {
      infoEmbryo.setDefaultEventName(e[explicit.defaultEvent].getName());
    }
    }
  MethodDescriptor[] m = explicit.explicitMethodDescriptors;
  if(m!=null)
    {
  for(int i=0;i<m.length;i++)
    {
      if(!infoEmbryo.hasMethod(m[i]))
        {
      infoEmbryo.addMethod(m[i]);
        }
    }
    }

  infoEmbryo.setAdditionalBeanInfo(explicit.explicitBeanInfo);
  infoEmbryo.setIcons(explicit.im);

}
 

开发者ID:vilie,
项目名称:javify,
代码行数:63,
代码来源:Introspector.java

示例4: merge

点赞 2

import gnu.java.beans.BeanInfoEmbryo; //导入依赖的package包/类
/** Adds all explicity given bean info data to the introspected
 * data.
 * 
 * @param infoEmbryo Bean info data retrieved by introspection.
 * @param explicit Bean info data retrieved by BeanInfo classes.
 */
private static void merge(BeanInfoEmbryo infoEmbryo, ExplicitInfo explicit)
{
  PropertyDescriptor[] p = explicit.explicitPropertyDescriptors;
  if(p!=null) 
    {
  for(int i=0;i<p.length;i++) 
    {
      if(!infoEmbryo.hasProperty(p[i])) 
        {
      infoEmbryo.addProperty(p[i]);
        }
    }
  
  // -1 should be used to denote a missing default property but
  // for robustness reasons any value below zero is discarded.
  // Not doing so would let Classpath fail where the JDK succeeds.
  if(explicit.defaultProperty > -1) 
    {
      infoEmbryo.setDefaultPropertyName(p[explicit.defaultProperty].getName());
    }
    }
  EventSetDescriptor[] e = explicit.explicitEventSetDescriptors;
  if(e!=null) 
    {
  for(int i=0;i<e.length;i++) 
    {
      if(!infoEmbryo.hasEvent(e[i])) 
        {
      infoEmbryo.addEvent(e[i]);
        }
    }
  
  // -1 should be used to denote a missing default event but
  // for robustness reasons any value below zero is discarded.
  // Not doing so would let Classpath fail where the JDK succeeds.
  if(explicit.defaultEvent > -1) 
    {
      infoEmbryo.setDefaultEventName(e[explicit.defaultEvent].getName());
    }
    }
  MethodDescriptor[] m = explicit.explicitMethodDescriptors;
  if(m!=null) 
    {
  for(int i=0;i<m.length;i++) 
    {
      if(!infoEmbryo.hasMethod(m[i])) 
        {
      infoEmbryo.addMethod(m[i]);
        }
    }
    }

  infoEmbryo.setAdditionalBeanInfo(explicit.explicitBeanInfo);
  infoEmbryo.setIcons(explicit.im);
  
}
 

开发者ID:nmldiegues,
项目名称:jvm-stm,
代码行数:63,
代码来源:Introspector.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)