Created
January 28, 2015 15:32
-
-
Save Phocacius/a1108fd1dd0a2742a459 to your computer and use it in GitHub Desktop.
template for a method annotation processor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment