private < E extends Event > EventHandler < E > wrapbuildHandler ( final EventAdapter eventAdapter , final Class < ? extends EventAdapter > adapterClass , final Class < ? extends EventHandler < E > > handlerClass ) throws CoreException { try { return handlerClass . getDeclaredConstructor ( adapterClass ) . newInstance ( eventAdapter ) ; } catch ( InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e ) { throw new CoreException ( "Impossible to build event handler " + handlerClass . getName ( ) + " for the class " + this . getClass ( ) . getName ( ) , e ) ; } }
Build an event handler by reflection to wrap the event adapter given .