Examples of JClassLiteral


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 (type == null) {
          // Indicates a binary-only class literal
          type = getOrCreateExternalType(info,
              ((ReferenceBinding) value).compoundName);
        }
        return Lists.<JAnnotationArgument> create(new JClassLiteral(
            info.makeChild(), type));

      } else if (value instanceof Constant) {
        return Lists.create((JAnnotationArgument) dispatch("processConstant",
            value));
View Full Code Here

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

        }
      }

      private void processClassLiteral(JType type, SourceInfo info, JsContext ctx) {
        assert !ctx.isLvalue();
        JClassLiteral classLiteral = new JClassLiteral(info, type);
        nativeMethodBody.addClassRef(classLiteral);
      }
View Full Code Here

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

                  method,
                  new JFieldRef(info, new JThisRef(info,
                      (JClassType) currentClass),
                      program.getIndexedField("Array.arrayClass"), currentClass));
            } else {
              implementMethod(method, new JClassLiteral(info.makeChild(),
                  currentClass));
            }
          }
        }
View Full Code Here

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

    }

    JExpression processExpression(ClassLiteralAccess x) {
      SourceInfo info = makeSourceInfo(x);
      JType type = (JType) typeMap.get(x.targetType);
      return new JClassLiteral(info, type);
    }
View Full Code Here

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(), currentClass);
      if (allRebindResults.size() == 1) {
        // Just replace with the instantiation expression.
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

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.getRefType());
    classLiteral.setField(field);
    return classLiteral;
  }
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.