Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Method[] methods = this.getClass().getMethods();
- for (Method method : methods) {
- MyAnnotation annotation = method.getAnnotation(MyAnnotation.class);
- if (annotation != null) {
- Object myAnnotationAttribute = annotation.value();
- // do whatever you want here
- try {
- method.invoke(this, methodParameters);
- } catch (IllegalAccessException|InvocationTargetException e) {
- e.printStackTrace();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement