Skip to content

Instantly share code, notes, and snippets.

@igor-brishkoski
Created February 5, 2017 00:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save igor-brishkoski/5f2c91091f08e1b502b3ce4cf43e32dc to your computer and use it in GitHub Desktop.
Save igor-brishkoski/5f2c91091f08e1b502b3ce4cf43e32dc to your computer and use it in GitHub Desktop.
Custom annotation runtime example
@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