Examples of JGenericType


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

    }
  }

  private JType resolveGeneric(JType type, JClassType outer,
      JClassType[] typeArgs) {
    JGenericType genericType = type.isGenericType();
    if (genericType != null) {
      int actual = typeArgs.length;
      JTypeParameter[] typeParams = genericType.getTypeParameters();
      int expected = typeParams.length;
      if (actual == 0 && expected > 0) {
        // If no type parameters were supplied, this is a raw type usage.
        type = genericType.getRawType();
      } else {
        if (actual != expected) {
          throw new IllegalStateException("Incorrect # of type parameters to "
            + genericType.getQualifiedBinaryName() + ": expected " + expected
            + ", actual=" + actual);
        }
        JClassType genericEnc = genericType.getEnclosingType();
        if (outer == null && genericEnc != null) {
          // Sometimes the signature is like Foo$Bar<H> even if Foo is a
          // generic class.  The cases I have seen are where Foo's type
          // parameter is also named H and has the same bounds.  That
          // manifests itself as getting visitClassType("Foo$Bar") and
          // then VisitTypeArgument/etc, rather than the usual
          // visitClassType("Foo"), visitTypeArgument/etc,
          // visitInnerClass("Bar"), visitTypeArgument/etc.
          //
          // So, in this case we have to build our own chain of enclosing
          // classes here, properly parameterizing any generics along the
          // way.
          // TODO(jat): more testing to validate this assumption
          JClassType[] outerArgs = null;
          JGenericType genericEncGeneric = genericEnc.isGenericType();
          if (genericEncGeneric != null) {
            JTypeParameter[] encTypeParams = genericEncGeneric.getTypeParameters();
            int n = encTypeParams.length;
            outerArgs = new JClassType[n];
            for (int i = 0; i < n; ++i) {
              outerArgs[i] = lookup.lookup(encTypeParams[i].getName());
              if (outerArgs[i] == null) {
View Full Code Here

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

    }
    return type;
  }

  private void resolveGenerics() {
    JGenericType genericType = returnTypeRef[0].isGenericType();
    if (genericType != null) {
      int actual = args.size();
      JClassType[] typeArgs = new JClassType[actual];
      for (int i = 0; i < actual; ++i) {
        JType type = args.get(i)[0];
View Full Code Here

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

    } else if (maybeGeneric(typeDecl, enclosingType)) {
      // Go through and create declarations for each of the type parameters on
      // the generic class or method
      JTypeParameter[] jtypeParameters = declareTypeParameters(typeDecl.typeParameters);

      JGenericType jgenericType = new JGenericType(typeOracle, pkg,
          enclosingType, isLocalType, className, isIntf, jtypeParameters);

      resultType = jgenericType;
    } else if (binding.isEnum()) {
      resultType = new JEnumType(typeOracle, pkg, enclosingType, isLocalType,
View Full Code Here

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

      }

      if (resolvedType != null) {
        if (binding instanceof RawTypeBinding) {
          // Use the raw type instead of the generic type.
          JGenericType genericType = (JGenericType) resolvedType;
          resolvedType = genericType.getRawType();
        }
        return resolvedType;
      }
    }
View Full Code Here

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

    jtype.addAnnotations(declaredAnnotations);

    // Resolve bounds for type parameters on generic types. Note that this
    // step does not apply to type parameters on generic methods; that
    // occurs during the method resolution stage.
    JGenericType jGenericType = jtype.isGenericType();
    if (jGenericType != null
        && !resolveBoundsForTypeParameters(logger, jtype.isGenericType(),
            clazz.typeParameters)) {
      // Failed to resolve
      return false;
View Full Code Here

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

  public void pushEnclosingScopes(JClassType type) {
    if (type == null) {
      return;
    }
    pushEnclosingScopes(type.getEnclosingType());
    JGenericType genericType = type.isGenericType();
    if (genericType != null) {
      pushScope(genericType.getTypeParameters());
    }
  }
View Full Code Here

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

    } else if (maybeGeneric(typeDecl, enclosingType)) {
      // Go through and create declarations for each of the type parameters on
      // the generic class or method
      JTypeParameter[] jtypeParameters = declareTypeParameters(typeDecl.typeParameters);

      JGenericType jgenericType = new JGenericType(typeOracle, pkg,
          enclosingType, isLocalType, className, isIntf, jtypeParameters);

      resultType = jgenericType;
    } else if (binding.isEnum()) {
      resultType = new JEnumType(typeOracle, pkg, enclosingType, isLocalType,
View Full Code Here

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

      }

      if (resolvedType != null) {
        if (binding instanceof RawTypeBinding) {
          // Use the raw type instead of the generic type.
          JGenericType genericType = (JGenericType) resolvedType;
          resolvedType = genericType.getRawType();
        }
        return resolvedType;
      }
    }
View Full Code Here

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

    jtype.addAnnotations(declaredAnnotations);

    // Resolve bounds for type parameters on generic types. Note that this
    // step does not apply to type parameters on generic methods; that
    // occurs during the method resolution stage.
    JGenericType jGenericType = jtype.isGenericType();
    if (jGenericType != null
        && !resolveBoundsForTypeParameters(logger, jtype.isGenericType(),
            clazz.typeParameters)) {
      // Failed to resolve
      return false;
View Full Code Here

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

    }
  }

  private JType resolveGeneric(JType type, JClassType outer,
      JClassType[] typeArgs) {
    JGenericType genericType = type.isGenericType();
    if (genericType != null) {
      int actual = typeArgs.length;
      JTypeParameter[] typeParams = genericType.getTypeParameters();
      int expected = typeParams.length;
      if (actual == 0 && expected > 0) {
        // If no type parameters were supplied, this is a raw type usage.
        type = genericType.getRawType();
      } else {
        if (actual != expected) {
          throw new IllegalStateException("Incorrect # of type parameters to "
            + genericType.getQualifiedBinaryName() + ": expected " + expected
            + ", actual=" + actual);
        }
        JClassType genericEnc = genericType.getEnclosingType();
        if (outer == null && genericEnc != null) {
          // Sometimes the signature is like Foo$Bar<H> even if Foo is a
          // generic class.  The cases I have seen are where Foo's type
          // parameter is also named H and has the same bounds.  That
          // manifests itself as getting visitClassType("Foo$Bar") and
          // then VisitTypeArgument/etc, rather than the usual
          // visitClassType("Foo"), visitTypeArgument/etc,
          // visitInnerClass("Bar"), visitTypeArgument/etc.
          //
          // So, in this case we have to build our own chain of enclosing
          // classes here, properly parameterizing any generics along the
          // way.
          // TODO(jat): more testing to validate this assumption
          JClassType[] outerArgs = null;
          JGenericType genericEncGeneric = genericEnc.isGenericType();
          if (genericEncGeneric != null) {
            JTypeParameter[] encTypeParams = genericEncGeneric.getTypeParameters();
            int n = encTypeParams.length;
            outerArgs = new JClassType[n];
            for (int i = 0; i < n; ++i) {
              outerArgs[i] = lookup.lookup(encTypeParams[i].getName());
              if (outerArgs[i] == 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.