title: Can annotations be nested in a class in Java?
body: <p>I'm trying to understand how this annotation is invoked @WebMethod</p>
  
  <pre><code>import javax.jws.WebService;
  import javax.jws.WebMethod;
  import javax.jws.soap.SOAPBinding;
  import javax.jws.soap.SOAPBinding.Style;
  
  @WebService          //&lt;----- is this annotation nested in WebService class
  @SOAPBinding(style = Style.RPC)
  public interface TimeServer {
  
  
      @WebMethod String getTimeAsString();  //&lt;-------is this nested in a class too
      @WebMethod long getTimeAsElapsed();
  }
  </code></pre>
  
  <p>According to my import javax.jws.WebMethod, and to Java docs<br>
  <a href="http://docs.oracle.com/javase/7/docs/api/javax/jws/WebMethod.html" rel="nofollow noreferrer">http://docs.oracle.com/javase/7/docs/api/javax/jws/WebMethod.html</a><br>
  <code>public @interface WebMethod</code> is described.</p>
  
  <p>Is the @WebMethod annotation defined as the WebMethod class?<br>
  Could the source code for the WebMethod class be something like this?</p>
  
  <pre><code>Public class WebMethod{
     //members
     //methods
    public @interface WebMethod{ //annotation definition in class, is this possible
    }
  }
  </code></pre>
  
  <p>If this is not the case, please let me how it's done with a simple example.</p>