public static synchronized BeanInfo findBeanInfo(String beanClassName){
  String[] beanInfoPaths=Introspector.getBeanInfoSearchPath();
  String infoClassName=beanClassName + "BeanInfo";
  Class infoClass=null;
  try {
    infoClass=Class.forName(infoClassName);
    return (BeanInfo)infoClass.newInstance();
  }
 catch (  Exception ex) {
  }
  for (int i=0; i < beanInfoPaths.length; i++) {
    int index=beanClassName.lastIndexOf(".");
    String classNameWithDot=beanClassName.substring(index);
    infoClassName=beanInfoPaths[i] + classNameWithDot + "BeanInfo";
    try {
      infoClass=Class.forName(infoClassName);
      break;
    }
 catch (    ClassNotFoundException ex) {
    }
  }
  Object retval=null;
  if (infoClass != null) {
    try {
      retval=infoClass.newInstance();
    }
 catch (    Exception ex) {
    }
  }
  return (BeanInfo)retval;
}

public static synchronized BeanInfo findBeanInfo ( String beanClassName ) { String [ ] beanInfoPaths = Introspector . getBeanInfoSearchPath ( ) ; String infoClassName = beanClassName + "BeanInfo" ; Class infoClass = null ; try { infoClass = Class . forName ( infoClassName ) ; return ( BeanInfo ) infoClass . newInstance ( ) ; } catch ( Exception ex ) { } for ( int i = 0 ; i < beanInfoPaths . length ; i ++ ) { int index = beanClassName . lastIndexOf ( "." ) ; String classNameWithDot = beanClassName . substring ( index ) ; infoClassName = beanInfoPaths [ i ] + classNameWithDot + "BeanInfo" ; try { infoClass = Class . forName ( infoClassName ) ; break ; } catch ( ClassNotFoundException ex ) { } } Object retval = null ; if ( infoClass != null ) { try { retval = infoClass . newInstance ( ) ; } catch ( Exception ex ) { } } return ( BeanInfo ) retval ; }
utility method for finding the beaninfo associated with a bean class name . this method first attaches the string " beaninfo " to the end of the class name and then searches the package of the specified class for the beaninfo class . if the beaninfo is not found in the bean class ' s package , then the method searches for the beaninfo in the introspector search path .
