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

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


          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,
View Full Code Here


      if (root.isTypeParameter() != null) {
        return MetaClassFactory.get(Object.class);
      }
    }
    if (t.isTypeParameter() != null) {
      JTypeParameter tp = t.isTypeParameter();
      return MetaClassFactory.get(tp.getErasedType().getQualifiedBinaryName());
    }
    return GWTClass.newInstance(oracle, t);
  }
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

        if ( null != type.isRawType() ) {
            type = type.isRawType().getBaseType();
        }

        JTypeParameter typeParameter = type.isTypeParameter();
        if ( null != typeParameter ) {
            if ( !subtype || typeParameter.getDeclaringClass() == getMapperInfo().get().getType() ) {
                return builder.instance( String.format( TYPE_PARAMETER_SERIALIZER_FIELD_NAME, typeParameter.getOrdinal() ) ).build();
            } else {
                type = typeParameter.getBaseType();
            }
        }

        Optional<MapperInstance> configuredSerializer = configuration.getSerializer( type );
        if ( configuredSerializer.isPresent() ) {
View Full Code Here

        if ( null != type.isRawType() ) {
            type = type.isRawType().getBaseType();
        }

        JTypeParameter typeParameter = type.isTypeParameter();
        if ( null != typeParameter ) {
            if ( !subtype || typeParameter.getDeclaringClass() == getMapperInfo().get().getType() ) {
                return builder.instance( String.format( TYPE_PARAMETER_DESERIALIZER_FIELD_NAME, typeParameter.getOrdinal() ) ).build();
            } else {
                type = typeParameter.getBaseType();
            }
        }

        Optional<MapperInstance> configuredDeserializer = configuration.getDeserializer( type );
        if ( configuredDeserializer.isPresent() ) {
View Full Code Here

    return false;
  }

  static void recordTypeParametersIn(JType type, Set<JTypeParameter> params) {
    JTypeParameter isTypeParameter = type.isTypeParameter();
    if (isTypeParameter != null) {
      params.add(isTypeParameter);
    }

    JArrayType isArray = type.isArray();
View Full Code Here

    }

    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

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.