Package com.google.web.bindery.requestfactory.shared

Examples of com.google.web.bindery.requestfactory.shared.ServiceName


      } catch (MirroredTypeException expected) {
        TypeMirror locatorType = expected.getTypeMirror();
        return !state.types.asElement(locatorType).equals(state.serviceLocatorType.asElement());
      }
    }
    ServiceName serviceName = x.getAnnotation(ServiceName.class);
    return serviceName != null && !serviceName.locator().isEmpty();
  }
View Full Code Here


      } catch (MirroredTypeException expected) {
        TypeMirror locatorType = expected.getTypeMirror();
        return !state.types.asElement(locatorType).equals(state.serviceLocatorType.asElement());
      }
    }
    ServiceName serviceName = x.getAnnotation(ServiceName.class);
    return serviceName != null && !serviceName.locator().isEmpty();
  }
View Full Code Here

  @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);
View Full Code Here

    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());
    }
View Full Code Here

   * Examine a RequestContext subtype to populate a ContextMethod.
   */
  private void buildContextMethod(ContextMethod.Builder contextBuilder, JClassType contextType)
      throws UnableToCompleteException {
    Service serviceAnnotation = contextType.getAnnotation(Service.class);
    ServiceName serviceNameAnnotation = contextType.getAnnotation(ServiceName.class);
    JsonRpcService jsonRpcAnnotation = contextType.getAnnotation(JsonRpcService.class);
    if (serviceAnnotation == null && serviceNameAnnotation == null && jsonRpcAnnotation == null) {
      poison("RequestContext subtype %s is missing a @%s or @%s annotation", contextType
          .getQualifiedSourceName(), Service.class.getSimpleName(), JsonRpcService.class
          .getSimpleName());
View Full Code Here

   * Examine a RequestContext subtype to populate a ContextMethod.
   */
  private void buildContextMethod(ContextMethod.Builder contextBuilder,
      JClassType contextType) throws UnableToCompleteException {
    Service serviceAnnotation = contextType.getAnnotation(Service.class);
    ServiceName serviceNameAnnotation = contextType.getAnnotation(ServiceName.class);
    JsonRpcService jsonRpcAnnotation = contextType.getAnnotation(JsonRpcService.class);
    if (serviceAnnotation == null && serviceNameAnnotation == null
        && jsonRpcAnnotation == null) {
      poison("RequestContext subtype %s is missing a @%s or @%s annotation",
          contextType.getQualifiedSourceName(), Service.class.getSimpleName(),
View Full Code Here

    Class<? extends ServiceLocator> locatorType;

    // Look at the RequestContext
    Class<?> requestContextClass = contextMethod.getDeclaringClass();
    Service l = requestContextClass.getAnnotation(Service.class);
    ServiceName ln = requestContextClass.getAnnotation(ServiceName.class);
    if (l != null && !ServiceLocator.class.equals(l.locator())) {
      locatorType = l.locator();
    } else if (ln != null && ln.locator().length() > 0) {
      try {
        locatorType = Class.forName(ln.locator(), false,
            getTop().getDomainClassLoader()).asSubclass(ServiceLocator.class);
      } catch (ClassNotFoundException e) {
        return die(
            e,
            "Could not find the locator type specified in the @%s annotation %s",
            ServiceName.class.getCanonicalName(), ln.value());
      }
    } else {
      locatorType = null;
    }
    return locatorType;
View Full Code Here

    Service s = requestContextClass.getAnnotation(Service.class);
    // TODO Handle case when both annotations are present
    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());
    }
View Full Code Here

      } catch (MirroredTypeException expected) {
        TypeMirror locatorType = expected.getTypeMirror();
        return !state.types.asElement(locatorType).equals(state.serviceLocatorType.asElement());
      }
    }
    ServiceName serviceName = x.getAnnotation(ServiceName.class);
    return serviceName != null && !serviceName.locator().isEmpty();
  }
View Full Code Here

TOP

Related Classes of com.google.web.bindery.requestfactory.shared.ServiceName

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.