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