Run the verifier test against a declared individual filter class
boolean validConstructor = false;
boolean foundIt = false;
Class clazz = filterClass;
if (filterClass == null)
return false;
// walk up the class tree
do {
Constructor[] constructors = filterClass.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) {
// we found it, let's look if it is public
if (Modifier.isPublic(constructors[i].getModifiers())) {
validConstructor = true;
} else {
validConstructor = false;
}
// we exit anyway...
foundIt = true;;
}
}
} while ((!foundIt) && ((filterClass=filterClass.getSuperclass()) != null));
if (validConstructor) {
result.addGoodDetails(smh.getLocalString
(getClass().getName() + ".passed",
"Listener class [ {0} ] implements a valid constructor.",
new Object[] {filterClass.getName()}));
} else {
result.addErrorDetails(smh.getLocalString
(getClass().getName() + ".failed",
"Error: Listener class [ {0} ] does not implement a valid constructor.",
new Object[] {clazz.getName()}));
}
return validConstructor;