Run the verifier test against a declared individual listener class
boolean validConstructor = false;
boolean foundIt = false;
if (listenerClass == null)
return false;
// walk up the class tree
do {
Constructor[] constructors = listenerClass.getDeclaredConstructors();
for (int i = 0; i < constructors.length; i++) {
logger.log(Level.FINE, getClass().getName() + ".debug",
new Object[] {constructors[i].toString()});
Class[] parameters = constructors[i].getParameterTypes();
if (parameters.length == 0) {
if (Modifier.isPublic(constructors[i].getModifiers())) {
validConstructor=true;
} else {
validConstructor=false;
}
foundIt = true;
break;
}
}
} while ((!foundIt) && ((listenerClass=listenerClass.getSuperclass()) != null));
if (validConstructor) {
result.addGoodDetails(smh.getLocalString
(getClass().getName() + ".passed",
"Listener class [ {0} ] implements a valid constructor.",
new Object[] {listenerClass.getName()}));
} else {
result.addErrorDetails(smh.getLocalString
(getClass().getName() + ".failed",
"Error: Listener class [ {0} ] does not implement a valid constructor.",
new Object[] {listenerClass.getName()}));
}
return validConstructor;