isCachedList = true; // else annotations were found in the cache
}
if(listenerForList == null) //not in production or the class hasn't been inspected yet
{
ListenerFor listener = inspectedClass.getAnnotation(ListenerFor.class);
ListenersFor listeners = inspectedClass.getAnnotation(ListenersFor.class);
if(listener != null || listeners != null)
{
//listeners were found using one or both annotations, create and build a new list
listenerForList = new ArrayList<ListenerFor>();
if(listener != null)
{
listenerForList.add(listener);
}
if(listeners != null)
{
listenerForList.addAll(Arrays.asList(listeners.value()));
}
}
else
{
listenerForList = Collections.emptyList();
}
}
// listeners were found through inspection or from cache, handle them
if (listenerForList != null && !listenerForList.isEmpty())
{
for (int i = 0, size = listenerForList.size(); i < size; i++)
{
ListenerFor listenerFor = listenerForList.get(i);
_handleListenerFor(context, inspected, component, listenerFor);
}
}
if(isProduction && !isCachedList) //if we're in production and the list is not yet cached, store it