public Map < String , List < VariableListener < ? > > > getVariableListeners ( String eventName , boolean includeCustomListeners ) { Map < String , Map < String , List < VariableListener < ? > > > > listenerCache ; if ( includeCustomListeners ) { if ( resolvedVariableListeners == null ) { resolvedVariableListeners = new HashMap < String , Map < String , List < VariableListener < ? > > > > ( ) ; } listenerCache = resolvedVariableListeners ; } else { if ( resolvedBuiltInVariableListeners == null ) { resolvedBuiltInVariableListeners = new HashMap < String , Map < String , List < VariableListener < ? > > > > ( ) ; } listenerCache = resolvedBuiltInVariableListeners ; } Map < String , List < VariableListener < ? > > > resolvedListenersForEvent = listenerCache . get ( eventName ) ; if ( resolvedListenersForEvent == null ) { resolvedListenersForEvent = new HashMap < String , List < VariableListener < ? > > > ( ) ; listenerCache . put ( eventName , resolvedListenersForEvent ) ; CmmnActivity currentActivity = this ; while ( currentActivity != null ) { List < VariableListener < ? > > localListeners = null ; if ( includeCustomListeners ) { localListeners = currentActivity . getVariableListenersLocal ( eventName ) ; } else { localListeners = currentActivity . getBuiltInVariableListenersLocal ( eventName ) ; } if ( localListeners != null && ! localListeners . isEmpty ( ) ) { resolvedListenersForEvent . put ( currentActivity . getId ( ) , localListeners ) ; } currentActivity = currentActivity . getParent ( ) ; } } return resolvedListenersForEvent ; }
Returns a map of all variable listeners defined on this activity or any of its parents activities . The map s key is the id of the respective activity the listener is defined on .