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

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


                elemType = paramType.getTypeArgs()[0];
              } else {
                elemType = classType.getOracle().getJavaLangObject();
              }
            } else {
              JArrayType arrayType = listType.isArray();
              if (arrayType != null) {
                elemType = arrayType.getComponentType();
                listAccessor = new ListAccessorArray(listArgNum);
              }
            }
            generateListFormattingCode(logger, locale, argChunk,
                elemType, isSafeHtml, listAccessor, paramsAccessor);
View Full Code Here


    JTypeParameter isTypeParameter = type.isTypeParameter();
    if (isTypeParameter != null) {
      params.add(isTypeParameter);
    }

    JArrayType isArray = type.isArray();
    if (isArray != null) {
      recordTypeParametersIn(isArray.getComponentType(), params);
    }

    JWildcardType isWildcard = type.isWildcard();
    if (isWildcard != null) {
      for (JClassType bound : isWildcard.getUpperBounds()) {
View Full Code Here

  }

  private static JArrayType getArrayType(TypeOracle typeOracle, int rank, JType component) {
    assert (rank > 0);

    JArrayType array = null;
    JType currentComponent = component;
    for (int i = 0; i < rank; ++i) {
      array = typeOracle.getArrayType(currentComponent);
      currentComponent = array;
    }
View Full Code Here

    // and all of the leaf's subtypes are ready.
    // (Copy values to avoid concurrent modification.)
    List<TypeInfoComputed> ticsToCheck = new ArrayList<TypeInfoComputed>();
    ticsToCheck.addAll(typeToTypeInfoComputed.values());
    for (TypeInfoComputed tic : ticsToCheck) {
      JArrayType type = tic.getType().isArray();
      if (type != null && tic.instantiable) {
        ProblemReport problems = new ProblemReport();
        problems.setContextType(type);

        markArrayTypes(logger, type, tic.getPath(), problems);

        maybeReport(logger, problems);
        allSucceeded &= !problems.hasFatalProblems();
      }
    }

    if (!allSucceeded) {
      throw new UnableToCompleteException();
    }
    assertNothingPending();

    pruneUnreachableTypes();

    logReachableTypes(logger);

    Set<JClassType> possiblyInstantiatedTypes = new TreeSet<JClassType>(JTYPE_COMPARATOR);

    Set<JClassType> fieldSerializableTypes = new TreeSet<JClassType>(JTYPE_COMPARATOR);

    for (TypeInfoComputed tic : typeToTypeInfoComputed.values()) {
      if (!(tic.getType() instanceof JClassType)) {
        continue;
      }
      JClassType type = (JClassType) tic.getType();

      type = type.getErasedType();

      if (tic.isInstantiable()) {
        assert (!type.isAbstract() || type.isEnum() != null);

        possiblyInstantiatedTypes.add(type);
      }

      if (tic.isFieldSerializable()) {
        assert (type.isInterface() == null);

        fieldSerializableTypes.add(type);
      }

      if (tic.maybeEnhanced()
          || (enhancedClasses != null && enhancedClasses.contains(type.getQualifiedSourceName()))) {
        type.setEnhanced();
      }
    }

    logSerializableTypes(logger, fieldSerializableTypes);
View Full Code Here

    sourceWriter.print("public static void serialize(SerializationStreamWriter streamWriter, ");
    sourceWriter.print(serializableClass.getQualifiedSourceName());
    sourceWriter.println(" instance) throws SerializationException {");
    sourceWriter.indent();

    JArrayType isArray = serializableClass.isArray();
    if (isArray != null) {
      writeArraySerializationStatements(isArray);
    } else if (serializableClass.isEnum() != null) {
      writeEnumSerializationStatements();
    } else {
View Full Code Here

               */
              markExposedAsArray(0);
              mightNotBeExposed = false;
              didChange = true;

              JArrayType fieldTypeAsArray = field.getType().isArray();
              if (fieldTypeAsArray != null) {
                markExposedAsArray(fieldTypeAsArray.getRank());
              }
            }
          }
        }

View Full Code Here

            JClassType[] typeArgs = isParameterized.getTypeArgs();
            for (int i = 0; i < typeArgs.length; ++i) {
              if (referencesTypeParameter(typeArgs[i], getTypeParameter())) {
                JGenericType genericFieldType = isParameterized.getBaseType();
                recordCausesExposure(genericFieldType, i, 0);
                JArrayType typeArgIsArray = typeArgs[i].isArray();
                if (typeArgIsArray != null && typeArgIsArray.getLeafType() == getTypeParameter()) {
                  int dims = typeArgIsArray.getRank();
                  recordCausesExposure(genericFieldType, i, dims);
                }
              }
            }
          }
View Full Code Here

      tic.setInstantiableSubtypes(success);
      tic.setInstantiable(false);
      return tic;
    }

    JArrayType isArray = classType.isArray();
    if (isArray != null) {
      TypeInfoComputed arrayTic = checkArrayInstantiable(localLogger, isArray, path, problems);
      assert typeToTypeInfoComputed.get(classType) != null;
      return arrayTic;
    }
View Full Code Here

      TypePath path, ProblemReport problems) {

    JType leafType = array.getLeafType();
    JWildcardType leafWild = leafType.isWildcard();
    if (leafWild != null) {
      JArrayType arrayType = getArrayType(typeOracle, array.getRank(), leafWild.getUpperBound());
      return checkArrayInstantiable(logger, arrayType, path, problems);
    }

    TypeInfoComputed tic = ensureTypeInfoComputed(array, path);
    if (tic.isDone() || tic.isPendingInstantiable()) {
View Full Code Here

    if (isWildcard != null) {
      return checkTypeArgument(logger, baseType, paramIndex, 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());
View Full Code Here

TOP

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

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.