Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save qzagarese/cd020241d055248f2bf8749bc3f4e0da to your computer and use it in GitHub Desktop.
Save qzagarese/cd020241d055248f2bf8749bc3f4e0da to your computer and use it in GitHub Desktop.
// Get a reference to the "handle" method
Method handle = handlerType.getDeclaredMethod("handle",
new Class<?>[] {
ScanContext.class, FrameworkAnnotationContext.class
});
// Create a FrameworkAnnotationContext instance by passing the annotation to process,
// the instance being scanned and the method where the annotation is placed
FrameworkAnnotationContext<Annotation> annotationContext = new FrameworkAnnotationContext<>(annotation, instance, m);
// Invoke the "handle" method
ScanContext newContext = (ScanContext) handle.invoke(handler, scanContext, annotationContext);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment