Package com.google.gwt.user.rebind

Examples of com.google.gwt.user.rebind.SourceWriter.commit()


      if (needComma) {
        writer.println();
      }
      writer.println("  };");
      writer.println("}-*/;");
      writer.commit(logger);
    }
    GwtLocale locale = localeUtils.getCompileLocale();
    String className = targetClass.getName().replace('.', '_') + "_"
        + locale.getAsString();
    Set<GwtLocale> runtimeLocales = localeUtils.getRuntimeLocales();
View Full Code Here


      writer.println("public NumberConstants getNumberConstants() {");
      generateConstantsLookup(logger, subContext, writer, localizableGenerator,
          runtimeLocales, locale,
          "com.google.gwt.i18n.client.constants.NumberConstantsImpl");
      writer.println("}");
      writer.commit(logger);
    }
    return packageName + "." + className;
  }

  /**
 
View Full Code Here

       * name, but should not include any sub-bundles.
       */
      taskList.remove(BundleResourceGenerator.class);
      writeMapMethods(logger, createdClassName, sw, taskList);

      sw.commit(logger);
    }

    finish(logger, resourceContext, generators.keySet());
    doFinish(logger);

View Full Code Here

    if (elideTypeNames) {
      generateStreamWriterOverride(srcWriter);
    }

    srcWriter.commit(logger);

    // Create an artifact explaining STOB's decisions. It will be emitted by
    // RpcLogLinker
    context.commitArtifact(logger, new RpcLogArtifact(
        serviceIntf.getQualifiedSourceName(), serializationPolicyStrongName,
View Full Code Here

        // TODO is the SERIALIZER required for DE RPC?
        SourceWriter sourceWriter = composerFactory.createSourceWriter(context, printWriter);
        sourceWriter.print("private Serializer SERIALIZER = new " + realize + "();");
        sourceWriter.print("protected Serializer getSerializer() {return SERIALIZER;}");
        sourceWriter.print("public SerialMode getMode() {return SerialMode." + annotation.mode().name() + ";}");
        sourceWriter.commit(logger);
       
        if (annotation.mode() == SerialMode.DE_RPC) {
          RpcDataArtifact data = new RpcDataArtifact(type.getQualifiedSourceName());
          for (JType t : typesSentToBrowser.getSerializableTypes()) {
            if (!(t instanceof JClassType)) {
View Full Code Here

        sw.println("return m.get(n);");
        sw.outdent();
        sw.println("}");

        sw.println(sb.toString());
        sw.commit(logger);
      }

      return composer.getCreatedClassName();

    } catch (Exception e) {
View Full Code Here

    if (pw != null) {
      SourceWriter sw = composer.createSourceWriter(context, pw);
      sw.println("public BeanModel newInstance() {");
      sw.println("return new " + beanModelName + "();");
      sw.println("}");
      sw.commit(logger);
    }
    return composer.getCreatedClassName();
  }

  protected String createBean(JClassType bean, TreeLogger logger, GeneratorContext context) throws Exception {
View Full Code Here

      // delegate hashCode to bean
      sw.println("public int hashCode(){");
      sw.println("  return bean.hashCode();");
      sw.println("}");

      sw.commit(logger);
    }
    return composer.getCreatedClassName();
  }

  protected JClassType getMarkerBean(JClassType type) throws NotFoundException {
View Full Code Here

      safeHtml.create();
    }

    // Save the file and return its type name
    sw.commit(logger);
    return factory.getCreatedClassName();
  }

  protected InputStream getTemplateResource(GeneratorContext context, JClassType toGenerate, TreeLogger l,
      String markerPath) throws UnableToCompleteException {
View Full Code Here

      sw.indentln("return %1$b;", val.value().equals(value));

      sw.println("}");
    }

    sw.commit(logger);

    return factory.getCreatedClassName();
  }

}
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.