Examples of JParameterizedType


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

  static JClassType getUserPrefsType(TreeLogger logger, TypeOracle typeOracle,
      JClassType extendsGadget) throws UnableToCompleteException {
    JGenericType gadgetType = typeOracle.findType(Gadget.class.getName()).isGenericType();
    assert gadgetType != null;

    JParameterizedType paramType = null;

    while (true) {
      paramType = extendsGadget.isParameterized();

      if (paramType != null && gadgetType.equals(paramType.getBaseType())) {
        break;
      }

      extendsGadget = extendsGadget.getSuperclass();

      if (extendsGadget == null) {
        logger.log(TreeLogger.ERROR, "Unable to find Gadget in type hierarchy",
            null);
        throw new UnableToCompleteException();
      }
    }

    JClassType[] typeArgs = paramType.getTypeArgs();

    assert typeArgs.length == 1;
    JClassType toReturn = typeArgs[0].isClassOrInterface();
    if (toReturn == null) {
      logger.log(TreeLogger.ERROR,
View Full Code Here

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

    sw.print(" ");
    sw.print(constructor.getName());
    sw.print("(");
    for (int i = 0; i < parameters.length; i++) {
      JType returnType = parameters[i].getType();
      JParameterizedType pType = returnType.isParameterized();

      if (pType != null) {
        sw.print(pType.getRawType().getQualifiedSourceName());
      } else {
        sw.print(returnType.getQualifiedSourceName());
      }

      sw.print(" ");
View Full Code Here

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

      return null;
    }

    // Are we looking at JSWrapper<T>; if so, return it's parameterization
    JClassType rawJSWrapper = oracle.findType(JSWrapper.class.getName()).getErasedType();
    JParameterizedType asParam = extendsJSWrapper.isParameterized();
    if (asParam != null && asParam.getErasedType().equals(rawJSWrapper)) {
      return asParam.getTypeArgs()[0].getErasedType();
    }

    // Try the supertype
    JClassType toReturn = findJSWrapperParameterization(oracle,
        extendsJSWrapper.getSuperclass());
View Full Code Here

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

    sw.print(" ");
    sw.print(constructor.getName());
    sw.print("(");
    for (int i = 0; i < parameters.length; i++) {
      JType returnType = parameters[i].getType();
      JParameterizedType pType = returnType.isParameterized();

      if (pType != null) {
        sw.print(pType.getRawType().getQualifiedSourceName());
      } else {
        sw.print(returnType.getQualifiedSourceName());
      }

      sw.print(" ");
View Full Code Here

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

      SourceWriter sw, Set<JClassType> creatorFixups)
      throws UnableToCompleteException {
    for (JClassType asClass : creatorFixups) {
      // If the type is parameterized, we want to replace it with the raw type
      // so that no angle-brackets are used.
      JParameterizedType pType = asClass.isParameterized();
      if (pType != null) {
        asClass = pType.getRawType();
      }

      sw.print("private static ");
      sw.print(asClass.getQualifiedSourceName());
      sw.print(" __create__");
View Full Code Here

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

    sw.print(" ");
    sw.print(imported.getName());
    sw.print("(");
    for (int i = 0; i < parameters.length; i++) {
      JType returnType = parameters[i].getType();
      JParameterizedType pType = returnType.isParameterized();

      if (pType != null) {
        sw.print(pType.getRawType().getQualifiedSourceName());
      } else {
        sw.print(returnType.getQualifiedSourceName());
      }

      sw.print(" ");
View Full Code Here

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

    if (fragmentGenerator == null) {
      throw new UnableToCompleteException();
    }

    // Ensure that there will be no angle-bracket in the output
    JParameterizedType pType = parameterType.isParameterized();
    if (pType != null) {
      parameterType = pType.getRawType();
    }

    sw.print("public native void ");
    sw.print(setter.getName());
    sw.print("(");
View Full Code Here

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

  protected void writeJSNIObjectCreator(FragmentGeneratorContext context)
      throws UnableToCompleteException {

    TypeOracle typeOracle = context.typeOracle;
    SourceWriter sw = context.sw;
    JParameterizedType listType = context.returnType.isParameterized();
    JType argumentType = listType.getTypeArgs()[0];
    TreeLogger logger = context.parentLogger.branch(TreeLogger.DEBUG,
        "Writing JSNI object creator for "
            + argumentType.getQualifiedSourceName(), null);

    sw.print("@com.google.gwt.jsio.client.impl.JSListWrapper::create(Lcom/google/gwt/jsio/client/impl/Extractor;)(");
View Full Code Here

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

    sw.print(")");
  }

  @Override
  boolean accepts(TypeOracle oracle, JType type) {
    JParameterizedType asInterface = type.isParameterized();

    if (asInterface == null) {
      return false;
    } else {
      return isAssignable(oracle, asInterface.getRawType(), JSList.class);
      // return oracle.findType(JSList.class.getName()).equals(asInterface);
    }
  }
View Full Code Here

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

      throws UnableToCompleteException {
    TreeLogger logger = context.parentLogger.branch(TreeLogger.DEBUG,
        "Writing JSNI reference to Extractor", null);
    TypeOracle typeOracle = context.typeOracle;
    SourceWriter sw = context.sw;
    JParameterizedType listType = context.returnType.isParameterized();
    JType argumentType = listType.getTypeArgs()[0];

    sw.print("@com.google.gwt.jsio.client.impl.JSListWrapper::createExtractor(Lcom/google/gwt/jsio/client/impl/Extractor;)(");

    FragmentGenerator fragmentGenerator = context.fragmentGeneratorOracle.findFragmentGenerator(
        logger, typeOracle, argumentType.isClassOrInterface());
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.