public boolean hasMatchingEJBFind(Class bean, Method finder) { try { String methodName = "ejbF" + finder.getName().substring(1); return (bean.getMethod(methodName, finder.getParameterTypes()) != null); } catch (NoSuchMethodException e) { if( log.isTraceEnabled() ) { StringBuffer tmp = new StringBuffer("hasMatchingEJBFind("); tmp.append(finder.toString()); tmp.append(") failure, "); Classes.displayClassInfo(bean, tmp); log.trace(tmp.toString(), e); } return false; } }
/** * Checks if a class has a default (no args) constructor */ public boolean hasDefaultConstructor(Class c) { try { Constructor ctr = c.getConstructor(new Class[0]); } catch (NoSuchMethodException e) { if( log.isTraceEnabled() ) { StringBuffer tmp = new StringBuffer("hasDefaultConstructor("); tmp.append(") failure, "); Classes.displayClassInfo(c, tmp); log.trace(tmp.toString(), e); } return false; } return true; }
/** * Check if a class (or its superclasses) declare a given method */ public boolean hasMatchingMethod(Class bean, Method method) { try { bean.getMethod(method.getName(), method.getParameterTypes()); return true; } catch (NoSuchMethodException e) { if( log.isTraceEnabled() ) { StringBuffer tmp = new StringBuffer("hasMatchingMethod("); tmp.append(method.toString()); tmp.append(") failure, "); Classes.displayClassInfo(bean, tmp); log.trace(tmp.toString(), e); } return false; } }
public boolean hasMatchingEJBHome(Class bean, Method home) { try { return (bean.getMethod(getMatchingEJBHomeName(home.getName()), home.getParameterTypes()) != null); } catch (NoSuchMethodException e) { if( log.isTraceEnabled() ) { StringBuffer tmp = new StringBuffer("hasMatchingEJBHome("); tmp.append(home.toString()); tmp.append(") failure, "); Classes.displayClassInfo(bean, tmp); log.trace(tmp.toString(), e); } return false; } }
public boolean hasMatchingEJBCreate(Class bean, Method create) { try { return (bean.getMethod(getMatchingEJBCreateName(create.getName()), create.getParameterTypes()) != null); } catch (NoSuchMethodException e) { if( log.isTraceEnabled() ) { StringBuffer tmp = new StringBuffer("hasMatchingEJBCreate("); tmp.append(create.toString()); tmp.append(") failure, "); Classes.displayClassInfo(bean, tmp); log.trace(tmp.toString(), e); } return false; } }
/** * Check whether a bean has a matching ejbPostCreate methods for * a given ejbCreate method */ public boolean hasMatchingEJBPostCreate(Class bean, Method create) { try { return (bean.getMethod(getMatchingEJBPostCreateName(create.getName()), create.getParameterTypes()) != null); } catch (NoSuchMethodException e) { if( log.isTraceEnabled() ) { StringBuffer tmp = new StringBuffer("hasMatchingEJBPostCreate("); tmp.append(create.toString()); tmp.append(") failure, "); Classes.displayClassInfo(bean, tmp); log.trace(tmp.toString(), e); } return false; } }
Classes.displayClassInfo(loadedClass, results);
Classes.displayClassInfo(loadedClass, results);