@Override public Class<?> resolveServiceClass(Class<? extends RequestContext> requestContextClass) { Class<?> searchIn = null; Service s = requestContextClass.getAnnotation(Service.class); if (s != null) { searchIn = s.value(); } ServiceName sn = requestContextClass.getAnnotation(ServiceName.class); if (sn != null) { searchIn = forName(sn.value()); } if (searchIn == null) { die(null, "The %s type %s did not specify a service type", RequestContext.class .getSimpleName(), requestContextClass.getCanonicalName()); } return searchIn; }
@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); state.checkExtraTypes(x); return null; }
@Override public Class<?> resolveServiceClass(Class<? extends RequestContext> requestContextClass) { Class<?> searchIn = null; Service s = requestContextClass.getAnnotation(Service.class); if (s != null) { searchIn = s.value(); } ServiceName sn = requestContextClass.getAnnotation(ServiceName.class); if (sn != null) { searchIn = forName(sn.value()); } if (searchIn == null) { die(null, "The %s type %s did not specify a service type", RequestContext.class .getSimpleName(), requestContextClass.getCanonicalName()); } return searchIn; }
@Override public Class<?> resolveServiceClass(Class<? extends RequestContext> requestContextClass) { Class<?> searchIn = null; Service s = requestContextClass.getAnnotation(Service.class); if (s != null) { searchIn = s.value(); } ServiceName sn = requestContextClass.getAnnotation(ServiceName.class); if (sn != null) { searchIn = forName(sn.value()); } if (searchIn == null) { die(null, "The %s type %s did not specify a service type", RequestContext.class .getSimpleName(), requestContextClass.getCanonicalName()); } return searchIn; }
@Override public Class<?> resolveServiceClass(Class<? extends RequestContext> requestContextClass) { Class<?> searchIn = null; Service s = requestContextClass.getAnnotation(Service.class); if (s != null) { searchIn = s.value(); } ServiceName sn = requestContextClass.getAnnotation(ServiceName.class); if (sn != null) { searchIn = forName(sn.value()); } if (searchIn == null) { die(null, "The %s type %s did not specify a service type", RequestContext.class .getSimpleName(), requestContextClass.getCanonicalName()); } return searchIn; }
@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); state.checkExtraTypes(x); return null; }
@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); state.checkExtraTypes(x); return null; }
@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); state.checkExtraTypes(x); return null; }