Package rocket.generator.rebind.gwt

Examples of rocket.generator.rebind.gwt.TypeOracleGeneratorContext


    this.setSuperClassUponClassSourceFileComposerFactory(composerFactory);
    this.addImplementedInterfacesToClassSourceFileComposerFactory(composerFactory);
    this.setClassJavaDoc(composerFactory);

    final TypeOracleGeneratorContext context = (TypeOracleGeneratorContext) this.getGeneratorContext();
    final PrintWriter printWriter = this.getPrintWriter();
    final SourceWriter writer = context.createSourceWriter(composerFactory, printWriter);

    try {
      context.branch();
      this.log();

      this.writeInitializers(writer);
      this.writeConstructors(writer);
      this.writeFields(writer);
      this.writeMethods(writer);
      this.writeNestedTypes(writer);
      context.unbranch();

    } catch (final GeneratorException caught) {
      this.handleWriteFailure(writer, caught);

      throw caught;
View Full Code Here


   * @return
   */
  public String generateFailedGenerateAttempt(final TreeLogger logger,
      final com.google.gwt.core.ext.GeneratorContext generatorContext, final String typeName, final Throwable cause) {

    final TypeOracleGeneratorContext context = new TypeOracleGeneratorContext() {

      @Override
      public NewConcreteType newConcreteType(final String name) {
        throw new UnsupportedOperationException();
      }

      @Override
      public NewInterfaceType newInterfaceType(final String name) {
        throw new UnsupportedOperationException();
      }

      @Override
      protected Package createPackage(String name) {
        throw new UnsupportedOperationException();
      }

      @Override
      protected void preloadTypes() {
      }
    };
    context.setGeneratorContext(generatorContext);
    context.setRootTreeLogger(logger);

    final String generatedClassName = context.getGeneratedTypeName(typeName, this.getGeneratedTypeNameSuffix());
    final PrintWriter printWriter = context.tryCreateTypePrintWriter(generatedClassName);
    if (printWriter != null) {

      final String packageName = context.getPackageName(generatedClassName);
      final String simpleClassName = context.getSimpleClassName(generatedClassName);
      final ClassSourceFileComposerFactory composerFactory = new ClassSourceFileComposerFactory(packageName, simpleClassName);
      composerFactory.setSuperclass(FailedGenerateAttemptException.class.getName());

      final SourceWriter sourceWriter = context.createSourceWriter(composerFactory, printWriter);

      Throwable cause0 = cause;
      while (true) {
        final Throwable cause1 = cause0.getCause();
        if (null == cause1) {
View Full Code Here

   *
   * @return
   */
  protected GeneratorContext createGeneratorContext(final com.google.gwt.core.ext.GeneratorContext generatorContext,
      final TreeLogger logger) {
    final TypeOracleGeneratorContext context = new TypeOracleGeneratorContext();
    context.setGenerator(this);
    context.setGeneratorContext(generatorContext);
    context.setRootTreeLogger(logger);
    return context;
  }
View Full Code Here

TOP

Related Classes of rocket.generator.rebind.gwt.TypeOracleGeneratorContext

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.