Package com.google.gwt.dev.jjs.ast

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


      }
      return jlabel;
    }

    private JStringLiteral getStringLiteral(SourceInfo info, char[] chars) {
      return new JStringLiteral(info, intern(chars), javaLangString);
    }
View Full Code Here


    private JStringLiteral getStringLiteral(SourceInfo info, char[] chars) {
      return new JStringLiteral(info, intern(chars), javaLangString);
    }

    private JStringLiteral getStringLiteral(SourceInfo info, String string) {
      return new JStringLiteral(info, intern(string), javaLangString);
    }
View Full Code Here

    }

    assert method != null;

    JMethodCall call = new JMethodCall(info, null, method);
    JStringLiteral packageName = program.getStringLiteral(info, getPackageName(typeName));
    JStringLiteral className = program.getStringLiteral(info, getClassName(typeName));
    call.addArgs(packageName, className);

    if (type instanceof JArrayType || type instanceof JClassType) {
      // Add a runtime type reference.
      call.addArg(new JRuntimeTypeReference(info, program.getTypeJavaLangObject(),
View Full Code Here

   * Predictably creates String type ids for castable and instantiable types.
   */
  public static class IntoStringLiterals extends ResolveRuntimeTypeReferences {

    private void assignId(JType type) {
      JStringLiteral stringLiteral = program.getStringLiteral(type.getSourceInfo(), type.getName());
      typeIdLiteralsByType.put(type, stringLiteral);
    }
View Full Code Here

      JExpression arg = x.getArgs().get(0);
      if (!(arg instanceof JStringLiteral)) {
        error(x, "Only string literals may be used as arguments to Impl.getNameOf()");
        return null;
      }
      JStringLiteral stringLiteral = (JStringLiteral) arg;
      String stringValue = stringLiteral.getValue();
      JNode node = null;

      JsniRef ref = JsniRef.parse(stringValue);
      if (ref != null) {
        node = JsniRefLookup.findJsniRefTarget(ref, program, new JsniRefLookup.ErrorReporter() {
View Full Code Here

    super();
  }

  @Override
  protected void adjustMethod(final JMethodCall methodCall, final Context context) {
    final JStringLiteral stringLiteral = (JStringLiteral) methodCall.getArgs().get(0);
    final String name = stringLiteral.getValue();

    final JClassType logger = this.getLevelLogger(name);
    if (null == logger) {
      throw new IllegalStateException("Unable to fetch logger for \"" + name + "\".");
    }
View Full Code Here

      SourceInfo sourceInfo = type.getSourceInfo().makeChild(
          JavaASTGenerationVisitor.class, "enum value lookup map");
      JsonObject map = new JsonObject(sourceInfo, program.getJavaScriptObject());
      for (JEnumField field : type.getEnumList()) {
        // JSON maps require leading underscores to prevent collisions.
        JStringLiteral key = program.getLiteralString(field.getSourceInfo(),
            "_" + field.getName());
        JFieldRef value = new JFieldRef(sourceInfo, null, field, type);
        map.propInits.add(new JsonObject.JsonPropInit(sourceInfo, key, value));
      }
      JField mapField = program.createField(sourceInfo,
View Full Code Here

TOP

Related Classes of com.google.gwt.dev.jjs.ast.JStringLiteral

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.