Advertisement
Guest User

Untitled

a guest
Jan 28th, 2015
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. Method[] methods = this.getClass().getMethods();
  2. for (Method method : methods) {
  3. MyAnnotation annotation = method.getAnnotation(MyAnnotation.class);
  4. if (annotation != null) {
  5. Object myAnnotationAttribute = annotation.value();
  6. // do whatever you want here
  7. try {
  8. method.invoke(this, methodParameters);
  9. } catch (IllegalAccessException|InvocationTargetException e) {
  10. e.printStackTrace();
  11. }
  12. }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement