Run the verifier test against a declared individual listener class
boolean validInterface = false;
Class clazz = listenerClass;
if (listenerClass==null) {
return false;
}
validInterface = isImplementorOf(clazz,"javax.servlet.ServletContextAttributeListener");
if (validInterface != true) {
validInterface = isImplementorOf(clazz,"javax.servlet.ServletContextListener");
}
if (validInterface != true) {
validInterface = isImplementorOf(clazz,"javax.servlet.http.HttpSessionAttributeListener");
}
if (validInterface != true) {
validInterface = isImplementorOf(clazz,"javax.servlet.http.HttpSessionListener");
}
if (validInterface != true) {
validInterface = isImplementorOf(clazz,"javax.servlet.ServletRequestAttributeListener");
}if (validInterface != true) {
validInterface = isImplementorOf(clazz,"javax.servlet.ServletRequestListener");
}if (validInterface != true) {
validInterface = isImplementorOf(clazz,"javax.servlet.http.HttpSessionBindingListener");
}
if (validInterface) {
result.addGoodDetails(smh.getLocalString
(getClass().getName() + ".passed",
"Listener class [ {0} ] implements a valid interface.",
new Object[] {listenerClass.getName()}));
} else if (!validInterface){
result.addErrorDetails(smh.getLocalString
(getClass().getName() + ".failed",
"Error: Listener class [ {0} ] does not implement one or more of the following valid interface.\n javax.servlet.ServletContextAttributeListener, javax.servlet.ServletContextListener, javax.servlet.http.HttpSessionAttributeListener, javax.servlet.http.HttpSessionListener",
new Object[] {clazz.getName()}));
}
return validInterface;