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

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


    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

      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

    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

    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

    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

  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

    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

      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;)(");
    sw.print("@" + JSListWrapper.class.getName() + "::createExtractor(L" + Extractor.class.getName().replace('.', '/') + ";)(");

    FragmentGenerator fragmentGenerator = context.fragmentGeneratorOracle.findFragmentGenerator(
View Full Code Here

        @Override
        protected void generateClassBody() throws UnableToCompleteException {
            // Find the interface to implement
            JClassType[] implementedInterfaces = baseType.getImplementedInterfaces();
            for(JClassType iface : implementedInterfaces) {
                JParameterizedType parameterizedType = iface.isParameterized();
                if(parameterizedType == null)
                    continue;
                if(iface.getErasedType().getQualifiedSourceName().equals(ServiceRetryingAdapter.class.getName())) {
                    JClassType[] typeArgs = parameterizedType.getTypeArgs();
                    if(typeArgs.length != 1) {
                        logger.log(TreeLogger.ERROR, "ServiceRetryingAdapter interface must be parameterized to the type of object to clone", null);
                        throw new UnableToCompleteException();
                    }
                    generateInterface(typeArgs[0]);
View Full Code Here

TOP

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

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.