Examples of JParameterizedType


Examples of com.google.gwt.core.ext.typeinfo.JParameterizedType

      } else {
        return "[" + computeBinaryClassName(arrayType.getComponentType());
      }
    }

    JParameterizedType parameterizedType = type.isParameterized();
    if (parameterizedType != null) {
      return computeBinaryClassName(parameterizedType.getBaseType());
    }

    JClassType classType = type.isClassOrInterface();
    assert (classType != null);
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JParameterizedType

  private String findGetMethod(JGenericType desiredReturnType,
      JClassType desiredReturnTypeParameter, JClassType ginjectorClass) {

    for (JClassType classType : ginjectorClass.getFlattenedSupertypeHierarchy()) {
      for (JMethod method : classType.getMethods()) {
        JParameterizedType returnType = method.getReturnType().isParameterized();
        if (method.getParameters().length == 0
            && returnType != null
            && returnType.isAssignableTo(desiredReturnType)
            && returnType.getTypeArgs()[0].isAssignableTo(desiredReturnTypeParameter)) {
          return method.getName();
        }
      }
    }
    return null;
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JParameterizedType

      SourceWriter writer)
      throws UnableToCompleteException {
    boolean foundRequestTabsEventType = false;
    for (JField field : tabContainerClass.getFields()) {
      RequestTabs annotation = field.getAnnotation(RequestTabs.class);
      JParameterizedType parameterizedType = field.getType().isParameterized();
      if (annotation != null) {
        if (!field.isStatic()
            || parameterizedType == null
            || !parameterizedType.isAssignableTo(typeClass)
            || !parameterizedType.getTypeArgs()[0].isAssignableTo(requestTabsHandlerClass)) {
          logger.log(
              TreeLogger.ERROR,
              "Found the annotation @"
                  + RequestTabs.class.getSimpleName()
                  + " on the invalid field '"
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JParameterizedType

    // presenter
    writer.println();
    boolean noContentSlotFound = true;
    for (JField field : presenterClass.getFields()) {
      ContentSlot annotation = field.getAnnotation(ContentSlot.class);
      JParameterizedType parameterizedType = field.getType().isParameterized();
      if (annotation != null) {
        if (!field.isStatic()
            || parameterizedType == null
            || !parameterizedType.isAssignableTo(typeClass)
            || !parameterizedType.getTypeArgs()[0].isAssignableTo(revealContentHandlerClass)) {
          logger.log(
              TreeLogger.WARN,
              "Found the annotation @"
                  + ContentSlot.class.getSimpleName()
                  + " on the invalid field '"
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JParameterizedType

        || valueProxyInterface.isAssignableFrom(transportedClass)) {
      // EntityProxy and ValueProxy return types
      methodBuilder.setEntityType(getEntityProxyType(transportedClass));
    } else if (collectionInterface.isAssignableFrom(transportedClass)) {
      // Only allow certain collections for now
      JParameterizedType parameterized = transportedClass.isParameterized();
      if (parameterized == null) {
        poison("Requests that return collections of List or Set must be parameterized");
        return false;
      }
      if (listInterface.equals(parameterized.getBaseType())) {
        methodBuilder.setCollectionType(CollectionType.LIST);
      } else if (setInterface.equals(parameterized.getBaseType())) {
        methodBuilder.setCollectionType(CollectionType.SET);
      } else {
        poison("Requests that return collections may be declared with"
            + " %s or %s only", listInterface.getQualifiedSourceName(),
            setInterface.getQualifiedSourceName());
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JParameterizedType

        CompositeEditor.class.getName());
    assert compositeEditorIntf.isAssignableFrom(editorType) : editorType.getQualifiedSourceName()
        + " is not a ComposedEditor";

    for (JClassType supertype : editorType.getFlattenedSupertypeHierarchy()) {
      JParameterizedType parameterized = supertype.isParameterized();
      if (parameterized != null) {
        // Found the Editor<Foo> supertype
        if (compositeEditorIntf.equals(parameterized.getBaseType())) {
          JClassType[] typeArgs = parameterized.getTypeArgs();
          assert typeArgs.length == 3;
          return new JClassType[]{typeArgs[1], typeArgs[2]};
        }
      }
    }
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JParameterizedType

    assert intfType.isAssignableFrom(subType) : subType.getParameterizedQualifiedSourceName()
        + " is not assignable to "
        + subType.getParameterizedQualifiedSourceName();

    for (JClassType supertype : subType.getFlattenedSupertypeHierarchy()) {
      JParameterizedType parameterized = supertype.isParameterized();
      if (parameterized != null) {
        // Found the desired supertype
        if (intfType.equals(parameterized.getBaseType())) {
          return parameterized.getTypeArgs();
        }
      }
    }
    return null;
  }
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JParameterizedType

    if (paramAsClass == null) {
      return false;
    }

    // Check using base types to account for erasure semantics
    JParameterizedType expectedFirst = oracle.getParameterizedType(
        autoBeanInterface,
        new JClassType[] {ModelUtils.ensureBaseType(beanType)});
    return expectedFirst.isAssignableTo(paramAsClass);
  }
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JParameterizedType

  /*
   * This method returns the real type name. Currently, it only affects
   * JParameterizedType since their names are not legal Java names.
   */
  private static String getJavaTypeName(JType type) {
    JParameterizedType parameterizedType = type.isParameterized();
    if (parameterizedType != null) {
      return parameterizedType.getRawType().getQualifiedSourceName();
    }

    return type.getQualifiedSourceName();
  }
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JParameterizedType

      } else {
        return "[" + getSerializedTypeName(arrayType.getComponentType());
      }
    }

    JParameterizedType parameterizedType = type.isParameterized();
    if (parameterizedType != null) {
      return getSerializedTypeName(parameterizedType.getRawType());
    }

    JClassType classType = type.isClassOrInterface();
    assert (classType != null);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.