/** {@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; }
/** * Returns the symbols of type or package members (and constructors) that are not synthetic or * otherwise unwanted. Caches the result if "cache" is true. */ protected Collection<Symbol> getMembers(boolean cache) { if (members != null) { return members; } LinkedList<Symbol> res = new LinkedList<Symbol>(); for (Scope.Entry e = sym.members().elems; e != null; e = e.sibling) { if (e.sym != null && !unwanted(e.sym)) { res.addFirst(e.sym); } } return cache ? (members = res) : res; }
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; }
/** * {@inheritDoc} * * <p>ParameterDeclarationImpl overrides this implementation. */ public int hashCode() { return sym.hashCode() + env.hashCode(); }
/** Returns this declaration's enter environment, or null if it has none. */ private Env<AttrContext> getEnterEnv() { // Get enclosing class of sym, or sym itself if it is a class // or package. TypeSymbol ts = (sym.kind != PCK) ? sym.enclClass() : (PackageSymbol) sym; return (ts != null) ? env.enter.getEnv(ts) : null; }