Examples of JClassLiteral


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

    private void replaceGwtCreate(JMethodCall x, Context ctx) {
      assert (x.getArgs().size() == 1);
      JExpression arg = x.getArgs().get(0);
      assert (arg instanceof JClassLiteral);
      JClassLiteral classLiteral = (JClassLiteral) arg;
      JReferenceType sourceType = (JReferenceType) classLiteral.getRefType();
      List<JClassType> allRebindResults = getAllPossibleRebindResults(sourceType);
      JGwtCreate gwtCreate = new JGwtCreate(x.getSourceInfo(), sourceType,
          allRebindResults, program.getTypeJavaLangObject());
      if (allRebindResults.size() == 1) {
        // Just replace with the instantiation expression.
View Full Code Here

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

  private void fixUpLoadOrderDependenciesForClassLiterals(
      ExclusivityMap fragmentMap) {
    int numClassLitStrings = 0;
    int numFixups = 0;
    for (JField field : fragmentMap.fields.keySet()) {
      JClassLiteral classLit = fieldToLiteralOfClass.get(field);
      if (classLit != null) {
        int classLitFrag = fragmentMap.fields.get(field);
        for (String string : stringsIn(field.getInitializer())) {
          numClassLitStrings++;
          int stringFrag = getOrZero(fragmentMap.strings, string);
View Full Code Here

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

        if (fieldName.equals("nullField")) {
          return program.getNullField();
        }

      } else if (fieldName.equals("class")) {
        JClassLiteral lit = program.getLiteralClass(type);
        return lit.getField();

      } else if (type instanceof JPrimitiveType) {
        errorReporter.reportError("May not refer to fields on primitive types");
        return null;
View Full Code Here

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

      JMethod method = x.getTarget();
      if (method == rebindCreateMethod) {
        assert (x.getArgs().size() == 1);
        JExpression arg = x.getArgs().get(0);
        assert (arg instanceof JClassLiteral);
        JClassLiteral classLiteral = (JClassLiteral) arg;
        JClassType classType = program.rebind(classLiteral.getRefType());

        /*
         * Find the appropriate (noArg) constructor. In our AST, constructors
         * are instance methods that should be qualified with a new expression.
         */
 
View Full Code Here

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

      JMethod method = x.getTarget();
      if (method == rebindCreateMethod) {
        assert (x.getArgs().size() == 1);
        JExpression arg = x.getArgs().get(0);
        assert (arg instanceof JClassLiteral);
        JClassLiteral classLiteral = (JClassLiteral) arg;
        JReferenceType sourceType = (JReferenceType) classLiteral.getRefType();
        List<JClassType> allRebindResults = getAllPossibleRebindResults(sourceType);
        JGwtCreate gwtCreate = new JGwtCreate(program, x.getSourceInfo(),
            sourceType, allRebindResults);
        if (allRebindResults.size() == 1) {
          // Just replace with the instantiation expression.
View Full Code Here

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

  private void fixUpLoadOrderDependenciesForClassLiterals(
      ExclusivityMap fragmentMap) {
    int numClassLitStrings = 0;
    int numFixups = 0;
    for (JField field : fragmentMap.fields.keySet()) {
      JClassLiteral classLit = fieldToLiteralOfClass.get(field);
      if (classLit != null) {
        int classLitFrag = fragmentMap.fields.get(field);
        for (String string : stringsIn(field.getInitializer())) {
          numClassLitStrings++;
          int stringFrag = getOrZero(fragmentMap.strings, string);
View Full Code Here

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

    }

    @Override
    public void endVisit(JMethodCall x, Context ctx) {
      if (x.getTarget() == program.getIndexedMethod("RunAsyncCode.runAsyncCode")) {
        JClassLiteral lit = (JClassLiteral) x.getArgs().get(0);
        String name = nameFromClassLiteral(lit);
        List<RunAsyncReplacement> matches = replacementsByName.get(name);
        if (matches == null || matches.size() == 0) {
          error("No runAsync call is named " + name);
          return;
View Full Code Here

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

        if (fieldName.equals("nullField")) {
          return program.getNullField();
        }

      } else if (fieldName.equals(JsniRef.CLASS)) {
        JClassLiteral lit = program.getLiteralClass(type);
        return lit.getField();

      } else if (type instanceof JPrimitiveType) {
        errorReporter.reportError("May not refer to fields on primitive types");
        return null;
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

         * class literal for the actual runtime type of the array (e.g. Foo[].class) and
         * not Array.class.
         */
        type.getMethods().remove(2);
      } 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.