public static <T> void defineObserverMethods(ObservesMethodsOwner<T> component, Class<T> clazz)
{
Asserts.assertNotNull(component, "component parameter can not be null");
Asserts.nullCheckForClass(clazz);
NotificationManager manager = NotificationManager.getInstance();
Method[] candidateMethods = AnnotationUtil.getMethodsWithParameterAnnotation(clazz, Observes.class);
// From @Relizations
Method[] genericMethods = new Method[0];
if (clazz.getAnnotation(Realizes.class) != null)
{
genericMethods = AnnotationUtil.getMethodsWithParameterAnnotation(clazz.getSuperclass(), Observes.class);
}
// From normal
createObserverMethodsWithRealizes(component, clazz, candidateMethods, false);
// From @Realizations
createObserverMethodsWithRealizes(component, clazz.getSuperclass(), genericMethods, true);
manager.addObservableComponentMethods(component);
}