classes = map.get(NamedEvent.class);
if (classes != null && !classes.isEmpty())
{
for (Class<?> clazz : classes)
{
NamedEvent namedEvent = (NamedEvent) clazz.getAnnotation (NamedEvent.class);
if (namedEvent != null) {
// Can only apply @NamedEvent to ComponentSystemEvent subclasses.
if (!ComponentSystemEvent.class.isAssignableFrom (clazz)) {
// Just log this. We'll catch it later in the runtime.
if (log.isLoggable(Level.WARNING)) {
log.warning (clazz.getName() + " is annotated with @javax.faces.event.NamedEvent, but does " +
"not extend javax.faces.event.ComponentSystemEvent");
}
}
// Have to register @NamedEvent annotations with the NamedEventManager class since
// we need to get access to this info later and can't from the dispenser (it's not a
// singleton).
org.apache.myfaces.config.impl.digester.elements.NamedEvent namedEventConfig =
new org.apache.myfaces.config.impl.digester.elements.NamedEvent();
namedEventConfig.setEventClass(clazz.getName());
namedEventConfig.setShortName(namedEvent.shortName());
facesConfig.addNamedEvent(namedEventConfig);
}
}
}