use of com.sun.tools.javac.code.Symbol.TypeSymbol in project lombok by rzwitserloot.
the class HandleDelegate method addMethodBindings.
public void addMethodBindings(List<MethodSig> signatures, ClassType ct, JavacTypes types, Set<String> banList) throws DelegateRecursion {
TypeSymbol tsym = ct.asElement();
if (tsym == null)
return;
for (Symbol member : tsym.getEnclosedElements()) {
for (Compound am : member.getAnnotationMirrors()) {
String name = null;
try {
name = am.type.tsym.flatName().toString();
} catch (Exception ignore) {
}
if ("lombok.Delegate".equals(name) || "lombok.experimental.Delegate".equals(name)) {
throw new DelegateRecursion(ct.tsym.name.toString(), member.name.toString());
}
}
if (member.getKind() != ElementKind.METHOD)
continue;
if (member.isStatic())
continue;
if (member.isConstructor())
continue;
ExecutableElement exElem = (ExecutableElement) member;
if (!exElem.getModifiers().contains(Modifier.PUBLIC))
continue;
ExecutableType methodType = (ExecutableType) types.asMemberOf(ct, member);
String sig = printSig(methodType, member.name, types);
//If add returns false, it was already in there
if (!banList.add(sig))
continue;
boolean isDeprecated = (member.flags() & DEPRECATED) != 0;
signatures.add(new MethodSig(member.name, methodType, isDeprecated, exElem));
}
if (ct.supertype_field instanceof ClassType)
addMethodBindings(signatures, (ClassType) ct.supertype_field, types, banList);
if (ct.interfaces_field != null)
for (Type iface : ct.interfaces_field) {
if (iface instanceof ClassType)
addMethodBindings(signatures, (ClassType) iface, types, banList);
}
}
Aggregations