public class AnnotationListenerRegistrator extends Object implements IListenerRegistrator
| Constructor and Description |
|---|
AnnotationListenerRegistrator(Object obj,
IWorldView worldView,
Logger log) |
| Modifier and Type | Method and Description |
|---|---|
void |
addListeners()
Introspect all object's methods and register various listeners based on
EventListener, etc... |
static WorldObjectId |
getId(Method method,
Class idClass,
String id)
Tries to instantiate ID class of 'idClass' with 'id' as an identifier.
|
static WorldObjectId |
getId(Method method,
ObjectEventListener annotation)
Returns a new
WorldObjectId for the given 'annotation'. |
static WorldObjectId |
getId(Method method,
ObjectListener annotation)
Returns a new
WorldObjectId for the given 'annotation'. |
static ListenerLevel |
getListenerLevel(Method method)
Returns listener level that is gained from the method's annotation.
|
int |
getListenersCount() |
Logger |
getLog() |
static boolean |
isStaticMethod(Method method)
Tells whether 'method' is static.
|
void |
removeListeners()
Removes (unregister) all the listeners the registrator has created.
|
public AnnotationListenerRegistrator(Object obj, IWorldView worldView, Logger log)
public static WorldObjectId getId(Method method, Class idClass, String id)
method - idClass - id - public static WorldObjectId getId(Method method, ObjectListener annotation)
WorldObjectId for the given 'annotation'.method - annotation - public static boolean isStaticMethod(Method method)
method - public static WorldObjectId getId(Method method, ObjectEventListener annotation)
WorldObjectId for the given 'annotation'.method - annotation - public static ListenerLevel getListenerLevel(Method method)
method - public void addListeners()
throws ListenersAlreadyRegisteredException
EventListener, etc... annotations.addListeners in interface IListenerRegistratorobj - ListenersAlreadyRegisteredExceptionpublic int getListenersCount()
public void removeListeners()
IListenerRegistratorremoveListeners in interface IListenerRegistratorpublic Logger getLog()
Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.