コード例 #1
0
 /** {@inheritDoc} */
 public Collection<AnnotationMirror> getAnnotationMirrors() {
   Collection<AnnotationMirror> res = new ArrayList<AnnotationMirror>();
   for (Attribute.Compound a : sym.getAnnotationMirrors()) {
     res.add(env.declMaker.getAnnotationMirror(a, this));
   }
   return res;
 }
コード例 #2
0
 protected <A extends Annotation> A getAnnotation(Class<A> annoType, Symbol annotated) {
   if (!annoType.isAnnotation()) {
     throw new IllegalArgumentException("Not an annotation type: " + annoType);
   }
   String name = annoType.getName();
   for (Attribute.Compound attr : annotated.getAnnotationMirrors()) {
     if (name.equals(attr.type.tsym.flatName().toString())) {
       return AnnotationProxyMaker.generateAnnotation(env, attr, annoType);
     }
   }
   return null;
 }