@Override
public Void visitType(TypeElement x, State state) {
checkedElement = x;
ProxyFor proxyFor = x.getAnnotation(ProxyFor.class);
ProxyForName proxyForName = x.getAnnotation(ProxyForName.class);
JsonRpcProxy jsonRpcProxy = x.getAnnotation(JsonRpcProxy.class);
if (proxyFor != null) {
poisonIfAnnotationPresent(state, x, proxyForName, jsonRpcProxy);
// See javadoc on Element.getAnnotation() for why it works this way
try {
proxyFor.value();
throw new RuntimeException("Should not reach here");
} catch (MirroredTypeException expected) {
TypeMirror type = expected.getTypeMirror();
state.addMapping(x, (TypeElement) state.types.asElement(type));
}
}
if (proxyForName != null) {
poisonIfAnnotationPresent(state, x, jsonRpcProxy);
TypeElement domain =
state.elements.getTypeElement(BinaryName.toSourceName(proxyForName.value()));
if (domain == null) {
state.warn(x, Messages.proxyMissingDomainType(proxyForName.value()));
}
state.addMapping(x, domain);
}
scanAllInheritedMethods(x, state);