title: Is it possible to find all classes annotated with @MyAnnotation using a GWT GeneratorContext?
body: <p>While creating classes using <a href="https://developers.google.com/web-toolkit/doc/latest/DevGuideCodingBasicsDeferred#generators">Generators</a>, it's possible to discover all subclasses of a type. You can find this technique for example in the GWT Showcase source (see <a href="http://code.google.com/p/google-web-toolkit/source/browse/releases/2.4/samples/showcase/src/com/google/gwt/sample/showcase/generator/ShowcaseGenerator.java#94">full code</a>):</p>
  
  <pre class="lang-java prettyprint-override"><code>JClassType cwType = null;
  try {
    cwType = context.getTypeOracle().getType(ContentWidget.class.getName());
  } catch (NotFoundException e) {
    logger.log(TreeLogger.ERROR, "Cannot find ContentWidget class", e);
    throw new UnableToCompleteException();
  }
  JClassType[] types = cwType.getSubtypes();
  </code></pre>
  
  <p>I would like to do something similar, but instead of <em>extending</em> a class (or implementing an interface)</p>
  
  <pre class="lang-java prettyprint-override"><code>public class SomeWidget extends ContentWidget { ... }
  </code></pre>
  
  <p>, could I also do this by <em>annotating</em> Widgets?</p>
  
  <pre class="lang-java prettyprint-override"><code>@MyAnnotation(...)
  public class SomeWidget extends Widget { ... }
  </code></pre>
  
  <p>And then finding all Widgets that are annotated with @MyAnnotation? I couldn't find a method like <code>JAnnotationType.getAnnotatedTypes()</code>, but maybe I'm just blind?</p>
  
  <p><sub>Note: I was able to make it work with the <a href="http://code.google.com/p/reflections/">Google Reflections</a> library, using <code>reflections.getTypesAnnotatedWith(SomeAnnotation.class)</code>, but I'd prefer using the GeneratorContext instead, especially because this works a lot better when reloading the app in DevMode.</sub></p>