Package com.google.gwt.core.ext.typeinfo

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


    }

    TreeLogger localLogger = logger.branch(TreeLogger.DEBUG,
        classType.getParameterizedQualifiedSourceName(), null);

    JTypeParameter isTypeParameter = classType.isTypeParameter();
    if (isTypeParameter != null) {
      if (typeParametersInRootTypes.contains(isTypeParameter)) {
        return computeTypeInstantiability(localLogger,
            isTypeParameter.getFirstBound(),
            TypePaths.createTypeParameterInRootPath(path, isTypeParameter),
            problems);
      }

      /*
 
View Full Code Here


          leafWild.getUpperBound());
      return checkArrayInstantiable(logger, arrayType, path, problems);
    }

    JClassType leafClass = leafType.isClassOrInterface();
    JTypeParameter isLeafTypeParameter = leafType.isTypeParameter();
    if (isLeafTypeParameter != null
        && !typeParametersInRootTypes.contains(isLeafTypeParameter)) {
      // Don't deal with non root type parameters, but make a TIC entry to
      // save time if it recurs. We assume they're indirectly instantiable.
      TypeInfoComputed tic = getTypeInfoComputed(array, path, true);
View Full Code Here

          isWildcard.getUpperBound(), parent, problems);
    }

    JArrayType typeArgAsArray = typeArg.isArray();
    if (typeArgAsArray != null) {
      JTypeParameter parameterOfTypeArgArray = typeArgAsArray.getLeafType().isTypeParameter();
      if (parameterOfTypeArgArray != null) {
        JGenericType declaringClass = parameterOfTypeArgArray.getDeclaringClass();
        if (declaringClass != null) {
          TypeParameterFlowInfo flowInfoForArrayParam = getFlowInfo(
              declaringClass, parameterOfTypeArgArray.getOrdinal());
          TypeParameterFlowInfo otherFlowInfo = getFlowInfo(baseType,
              paramIndex);
          if (otherFlowInfo.getExposure() >= 0
              && otherFlowInfo.isTransitivelyAffectedBy(flowInfoForArrayParam)) {
            problems.add(baseType, "Cannot serialize type '"
View Full Code Here

    if (type1 == type2) {
      return true;
    }

    if (constraints.containsKey(type1)) {
      JTypeParameter type1Parameter = (JTypeParameter) type1;
      JClassType type2Class = type2;
      JClassType type1Bound = constraints.get(type1Parameter);
      assert (!occurs(type1Parameter, type1Bound));
      if (!typesMatch(type1Bound, type2, constraints)) {
        return false;
      }

      if (type1Bound.isAssignableFrom(type2Class)) {
        constraints.put(type1Parameter, type2Class);
      }
    }

    if (type1 == typeOracle.getJavaLangObject()) {
      return true;
    }

    if (type2 == typeOracle.getJavaLangObject()) {
      return true;
    }

    JTypeParameter type1Param = type1.isTypeParameter();
    if (type1Param != null) {
      // It would be nice to check that type1Param's bound is a match
      // for type2, but that can introduce infinite recursions.
      return true;
    }

    JTypeParameter type2Param = type2.isTypeParameter();
    if (type2Param != null) {
      // It would be nice to check that type1Param's bound is a match
      // for type2, but that can introduce infinite recursions.
      return true;
    }
View Full Code Here

      final Map<JTypeParameter, JClassType> constraints) {

    JModTypeVisitor replacer = new JModTypeVisitor() {
      @Override
      public void endVisit(JWildcardType wildcardType) {
        JTypeParameter newParam = new JTypeParameter("TP$"
            + freshTypeVariableCounter++, -1);
        newParam.setBounds(makeArray(typeOracle.getJavaLangObject()));
        constraints.put(newParam, wildcardType.getUpperBound());
        replacement = newParam;
      }
    };
View Full Code Here

    if (typeRaw != null) {
      endVisit(typeRaw);
      return;
    }

    JTypeParameter typeParam = type.isTypeParameter();
    if (typeParam != null) {
      endVisit(typeParam);
      return;
    }
View Full Code Here

  public TypeParameterFlowInfo computeTypeParameterExposure(JGenericType type,
      int index) {
    // check if it has already been computed
    JTypeParameter[] typeParameters = type.getTypeParameters();
    assert (index < typeParameters.length);
    JTypeParameter typeParameter = typeParameters[index];
    TypeParameterFlowInfo queryFlow = typeParameterToFlowInfo.get(typeParameter);
    if (queryFlow != null) {
      return queryFlow;
    }
View Full Code Here

   * Return the parameter flow info for a type parameter specified by class and
   * index. If the flow info did not previously exist, create it and add it to
   * the work list.
   */
  private TypeParameterFlowInfo getFlowInfo(JGenericType type, int index) {
    JTypeParameter typeParameter = type.getTypeParameters()[index];
    TypeParameterFlowInfo info = typeParameterToFlowInfo.get(typeParameter);
    if (info == null) {
      info = new TypeParameterFlowInfo(type, index);
      typeParameterToFlowInfo.put(typeParameter, info);
      worklist.add(info);
View Full Code Here

    return GWTClass.newInstance(oracle, method.getEnclosingType());
  }

  @Override
  public MetaType getGenericReturnType() {
    JTypeParameter type = method.getReturnType().isTypeParameter();
    if (type != null) {
      return new GWTTypeVariable(oracle, type);
    }
    return null;
  }
View Full Code Here

  public boolean isElementAssignableTo(XMLElement elem, JClassType possibleSupertype)
      throws UnableToCompleteException {
    /*
     * Things like <W extends IsWidget & IsPlaid>
     */
    JTypeParameter typeParameter = possibleSupertype.isTypeParameter();
    if (typeParameter != null) {
      JClassType[] bounds = typeParameter.getBounds();
      for (JClassType bound : bounds) {
        if (!isElementAssignableTo(elem, bound)) {
          return false;
        }
      }
View Full Code Here

TOP

Related Classes of com.google.gwt.core.ext.typeinfo.JTypeParameter

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.