Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Sep 15th, 2011  |  syntax: Java  |  size: 0.45 KB  |  views: 53  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. public class InterceptorExtension
  2. {
  3.         public <T> void processAnnotatedType(@Observes ProcessAnnotatedType<T> event)
  4.         {
  5.                 AnnotatedTypeBuilder<T> builder = new AnnotatedTypeBuilder<T>().readFromType(event.getAnnotatedType());
  6.                 builder.addToClass(new ExceptionHandledImpl());
  7.                 event.setAnnotatedType(builder.create());
  8.         }
  9.  
  10.         private static class ExceptionHandledImpl extends AnnotationLiteral<ExceptionHandled> implements ExceptionHandled
  11.         {
  12.         }
  13. }
clone this paste RAW Paste Data