Examples of JClassLiteral


Examples of com.google.gwt.dev.jjs.ast.JClassLiteral

          JMethodCall staticOnModuleLoadCall =
              new JMethodCall(origin, null, specificOnModuleLoadMethod);
          initMethodBlock.addStmt(staticOnModuleLoadCall.makeStatement());
        } else {
          // Synthesize ((EntryPoint)GWT.create(FooEntryPoint.class)).onModuleLoad();
          JClassLiteral entryPointTypeClassLiteral =
              new JClassLiteral(origin, specificEntryPointType);
          JMethodCall createInstanceCall =
              new JMethodCall(origin, null, gwtCreateMethod, entryPointTypeClassLiteral);
          JCastOperation castToEntryPoint =
              new JCastOperation(origin, entryPointType, createInstanceCall);
          JMethodCall instanceOnModuleLoadCall =
View Full Code Here

Examples of com.google.gwt.dev.jjs.ast.JClassLiteral

    return createDependentClassLiteral(info, classType.getSuperClass());
  }

  private JClassLiteral createDependentClassLiteral(SourceInfo info, JType type) {
    JClassLiteral classLiteral = new JClassLiteral(info.makeChild(), type);
    classLiteral.setField(resolveClassLiteralField(classLiteral.getRefType()));
    return classLiteral;
  }
View Full Code Here

Examples of com.google.gwt.dev.jjs.ast.JClassLiteral

      JType type = x.getRefType();
      if (type instanceof JArrayType) {
        // Replace array class literals by an expression to obtain the class literal from the
        // leaf type of the array.
        JArrayType arrayType = (JArrayType) type;
        JClassLiteral leafTypeClassLiteral =
            new JClassLiteral(x.getSourceInfo(), arrayType.getLeafType());
        resolveClassLiteral(leafTypeClassLiteral);

        JExpression arrayClassLiteralExpression = program.createArrayClassLiteralExpression(
            x.getSourceInfo(), leafTypeClassLiteral, arrayType.getDims());
        ctx.replaceMe(arrayClassLiteralExpression);
View Full Code Here

Examples of com.google.gwt.dev.jjs.ast.JClassLiteral

        JExpression arg0 = x.getArgs().get(0);
        if (!(arg0 instanceof JClassLiteral)) {
          error(arg0.getSourceInfo(), "Only a class literal may be passed to runAsyncCode");
          return;
        }
        JClassLiteral lit = (JClassLiteral) arg0;
        String name = nameFromClassLiteral(lit);
        List<JRunAsync> matches = replacementsByName.get(name);
        SourceInfo info = x.getSourceInfo();
        if (matches == null || matches.size() == 0) {
          error(info, "No runAsync call is named " + name);
View Full Code Here

Examples of com.google.gwt.dev.jjs.ast.JClassLiteral

      JExpression arg = gwtCreateCall.getArgs().get(0);
      if (!(arg instanceof JClassLiteral)) {
        error(gwtCreateCall, "Only class literals may be used as arguments to GWT.create()");
        return null;
      }
      JClassLiteral classLiteral = (JClassLiteral) arg;
      if (!(classLiteral.getRefType() instanceof JDeclaredType)) {
        error(gwtCreateCall,
            "Only classes and interfaces may be used as arguments to GWT.create()");
        return null;
      }

      if (compilerContext.shouldCompileMonolithic()) {
        Event event = SpeedTracerLogger.start(CompilerEventType.VISIT_GWT_CREATE,
            "argument",
            classLiteral.getRefType().getName(),
            "caller",
            gwtCreateCall.getSourceInfo().getFileName());
        try {
          return createStaticRebindExpression(gwtCreateCall, classLiteral);
        } finally {
View Full Code Here

Examples of com.google.gwt.dev.jjs.ast.JClassLiteral

          node = findJsniRefTarget(info, ident);
          if (node == null) {
            return; // already reported error
          }
          if (node instanceof JType) {
            node = new JClassLiteral(info.makeChild(), (JType) node);
          }
          program.jsniMap.put(ident, node);
        }

        if (node instanceof JField) {
View Full Code Here

Examples of com.google.gwt.dev.jjs.ast.JClassLiteral

        call.addArg(JNullLiteral.INSTANCE);
        call.addArg(JNullLiteral.INSTANCE);
      }
    } else if (type instanceof JArrayType) {
      JArrayType arrayType = (JArrayType) type;
      JClassLiteral componentLiteral =
          createDependentClassLiteral(info, arrayType.getElementType());
      call.addArg(componentLiteral);
    } else {
      assert (type instanceof JInterfaceType || type instanceof JPrimitiveType);
    }
View Full Code Here

Examples of com.google.gwt.dev.jjs.ast.JClassLiteral

        + call.toString() + " versus " + method.toString();
    return call;
  }

  private JClassLiteral createDependentClassLiteral(SourceInfo info, JType type) {
    JClassLiteral classLiteral = new JClassLiteral(info.makeChild(), type);
    JField field = resolveClassLiteralField(classLiteral);
    classLiteral.setField(field);
    return classLiteral;
  }
View Full Code Here

Examples of com.google.gwt.dev.jjs.ast.JClassLiteral

    @Override
    public void endVisit(ClassLiteralAccess x, BlockScope scope) {
      try {
        SourceInfo info = makeSourceInfo(x);
        JType type = typeMap.get(x.targetType);
        push(new JClassLiteral(info, type));
      } catch (Throwable e) {
        throw translateException(x, e);
      }
    }
View Full Code Here

Examples of com.google.gwt.dev.jjs.ast.JClassLiteral

          }
        }
        assert arrayClassField != null;
        implementMethod(method, new JFieldRef(info, makeThisRef(info), arrayClassField, type));
      } else {
        implementMethod(method, new JClassLiteral(info, type));
      }
    }
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.