Created
February 5, 2017 00:40
-
-
Save igor-brishkoski/5f2c91091f08e1b502b3ce4cf43e32dc to your computer and use it in GitHub Desktop.
Custom annotation runtime example
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
@MethodInfo(author = "John Snow", revision = 2, comments = "Hey!") | |
public void awesomeMethod() { | |
Method method = getClass().getMethod("awesomeMethod"); | |
MethodInfo methodInfo = method.getAnnotation(MethodInfo.class); | |
Log.d("MethodInfo", methodInfo.author()); | |
Log.d("MethodInfo", methodInfo.revision()); | |
Log.d("MethodInfo", methodInfo.comments()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment