/** * find a JXPathBeanInfo instance for the specified class. * Similar to javax.beans property handler discovery; search for a * class with "XBeanInfo" appended to beanClass.name, then check * whether beanClass implements JXPathBeanInfo for itself. * Invokes the default constructor for any class it finds. * @param beanClass for which to look for an info provider * @return JXPathBeanInfo instance or null if none found */ private static synchronized JXPathBeanInfo findInformant(Class beanClass) { String name = beanClass.getName() + "XBeanInfo"; try { return (JXPathBeanInfo) instantiate(beanClass, name); } catch (Exception ex) { //NOPMD // Just drop through } // Now try checking if the bean is its own JXPathBeanInfo. try { if (JXPathBeanInfo.class.isAssignableFrom(beanClass)) { return (JXPathBeanInfo) beanClass.newInstance(); } } catch (Exception ex) { //NOPMD // Just drop through } return null; }