title: Java annotation execute a method within the annotation declaration(usage for android)
body: <p>I'm fairly new to the annotation terms. 
  I have read some sources and came to the conclusion that non answered my question.
  Perhaps I googled using the wrong search. Perhaps I overlook, or mayhbe im just clueless..</p>
  
  <p>Anyway here is the deal.</p>
  
  <p>I am busy writing an application that requires "role validation". </p>
  
  <p>To do this I want to use an annotation.</p>
  
  <p>So something along the line of:</p>
  
  <pre><code>@interface Validate (){
  
  }
  </code></pre>
  
  <p>What I aim to achieve is sometihng along the lines of: </p>
  
  <pre><code>public @interface Validate() {
     public Validate() {
        //Do validation stuff
       return true/false
     }
  }
  </code></pre>
  
  <p>So basically I want to define methods within the annotation.
  I want to be able to call </p>
  
  <pre><code>@Validate
  public void methodThatRequiresAdminRole() {
    doStuff();
  }
  </code></pre>
  
  <p>Only admins should be able to enter this method. Otherwise an error should be generated.</p>
  
  <p>so if @validate returns true, the method should be executed</p>
  
  <p>Sorry if I am really unclear. I am not quite sure how to properly ask what I want. 
  So I hope the examples tell the stories.</p>
  
  <p>Hope to read tips and perhaps even an answer soon.
  Thanks.</p>
  
  <p>** EDIT **</p>
  
  <p>I need to stress out the fact that the code must be used on an android application.
  So I prefer to not use strange frameworks not meant for android. I have no problem adding a custom library that gives the functionality without any kind of application framework.</p>