private void processAnnotations ( final Field property ) throws CoreException { // For each field annotation we will attach an event handler for ( final Annotation a : property . getAnnotations ( ) ) { if ( EventTarget . class . isAssignableFrom ( property . getType ( ) ) ) { // Manage only JRebirth OnXxxxx annotations if ( a . annotationType ( ) . getName ( ) . startsWith ( BASE_ANNOTATION_NAME ) ) { try { // Retrieve the property value final EventTarget target = ( EventTarget ) property . get ( this ) ; // Process the annotation if the node is not null if ( target != null && controller ( ) instanceof AbstractController ) { addHandler ( target , a ) ; } } catch ( IllegalArgumentException | IllegalAccessException e ) { LOGGER . log ( UIMessages . NODE_ANNO_PROCESSING_FAILURE , e , this . getClass ( ) . getName ( ) , property . getName ( ) ) ; } } // Manage only JRebirth OnFinished annotations } else if ( Animation . class . isAssignableFrom ( property . getType ( ) ) && OnFinished . class . getName ( ) . equals ( a . annotationType ( ) . getName ( ) ) ) { try { // Retrieve the property value final Animation animation = ( Animation ) property . get ( this ) ; // Process the annotation if the node is not null if ( animation != null && controller ( ) instanceof AbstractController ) { addHandler ( animation , a ) ; } } catch ( IllegalArgumentException | IllegalAccessException e ) { LOGGER . log ( UIMessages . ANIM_ANNO_PROCESSING_FAILURE , e , this . getClass ( ) . getName ( ) , property . getName ( ) ) ; } } } }
Process all OnXxxx Annotation to attach event handler on this field .