Examples of NewConcreteType


Examples of rocket.generator.rebind.type.NewConcreteType

    this.createObjectWriters(serializableWritableTypes, typesToWriters);

    // nows the time to create the SerializationFactory
    final GeneratorContext context = this.getGeneratorContext();
    context.branch();
    final NewConcreteType serializationFactory = this.createSerializableFactory(newTypeName);

    this.overrideSerializationFactoryGetObjectReader(serializationFactory, typesToReaders);
    this.overrideSerializationFactoryGetObjectWriter(serializationFactory, typesToWriters);
    context.unbranch();
View Full Code Here

Examples of rocket.generator.rebind.type.NewConcreteType

        skippedGeneratingCount++;
        continue;
      }

      context.branch();
      final NewConcreteType newReader = this.createObjectReader(type, typesToReaders);
      typesToReaders.put(type, newReader);

      context.branch();
      this.overrideObjectReaderNewInstanceMethod(type, newReader);
View Full Code Here

Examples of rocket.generator.rebind.type.NewConcreteType

    final GeneratorContext context = this.getGeneratorContext();
    context.debug(type.getName());

    final String newTypeName = this.getGeneratedTypeName(type, SerializationConstants.OBJECT_READER_GENERATED_TYPE_SUFFIX,
        "rocket.serialization.client.reader");
    final NewConcreteType newConcreteType = context.newConcreteType(newTypeName);
    newConcreteType.setAbstract(false);
    newConcreteType.setFinal(false);

    context.debug(newTypeName);

    // pick the right super type.
    Type objectReaderSuperType = null;

    while (true) {
      // if its an array simply extend ObjectArrayReader
      if (type.isArray()) {
        objectReaderSuperType = this.getArrayReader();
        break;
      }

      // if super type is object extend ObjectReaderImpl
      Type superType = type.getSuperType();
      if (superType.equals(context.getObject())) {
        objectReaderSuperType = this.getObjectReaderImpl();
        break;
      }

      // find the super types object reader and extend that...
      objectReaderSuperType = (Type) typesToReaders.get(superType);

      if (null == objectReaderSuperType) {
        throw new IllegalStateException("Unable to fetch the reader for the super type \"" + superType
            + "\" whilst processing \"" + type.getName() + "\".");
      }
      break;
    }

    newConcreteType.setSuperType(objectReaderSuperType);
    context.debug("extends " + objectReaderSuperType);

    // add an annotation that marks the type being handled by this
    // ObjectReader
    newConcreteType.addMetaData(SerializationConstants.SERIALIZABLE_TYPE, type.getName());

    // create a public no arguments constructor.
    final NewConstructor constructor = newConcreteType.newConstructor();
    constructor.setBody(EmptyCodeBlock.INSTANCE);
    constructor.setVisibility(Visibility.PUBLIC);

    return newConcreteType;
  }
View Full Code Here

Examples of rocket.generator.rebind.type.NewConcreteType

        skippedGeneratingCount++;
        continue;
      }

      context.branch();
      final NewConcreteType newWriter = this.createObjectWriter(type, typesToWriters);
      typesToWriters.put(type, newWriter);

      context.branch();
      this.overrideObjectWriterWrite0Method(newWriter, type);
      this.addSingletonField(newWriter);
View Full Code Here

Examples of rocket.generator.rebind.type.NewConcreteType

    final GeneratorContext context = this.getGeneratorContext();
    context.debug(type.getName());

    final String newTypeName = this.getGeneratedTypeName(type, SerializationConstants.OBJECT_WRITER_GENERATED_TYPE_SUFFIX,
        "rocket.serialization.client.writer");
    final NewConcreteType newConcreteType = context.newConcreteType(newTypeName);
    newConcreteType.setAbstract(false);
    newConcreteType.setFinal(false);

    context.debug(newTypeName);

    // check super class of type. if its not object extend its object writer
    // rather than cowi.
    Type objectWriterSuperType = null;

    while (true) {
      if (type.isArray()) {
        objectWriterSuperType = this.getArrayWriter();
        break;
      }
      final Type superType = type.getSuperType();
      if (superType.equals(context.getObject())) {
        objectWriterSuperType = this.getObjectWriterImpl();
        break;
      }

      objectWriterSuperType = (Type) serializables.get(type.getSuperType());
      if (null == objectWriterSuperType) {
        throw new IllegalStateException("Unable to fetch the writer for the super type \"" + superType
            + "\" whilst processing \"" + type.getName() + "\".");
      }
      break;
    }

    newConcreteType.setSuperType(objectWriterSuperType);
    context.debug("extends " + objectWriterSuperType);

    newConcreteType.addMetaData(SerializationConstants.SERIALIZABLE_TYPE, type.getName());

    final NewConstructor constructor = newConcreteType.newConstructor();
    constructor.setBody(EmptyCodeBlock.INSTANCE);
    constructor.setVisibility(Visibility.PUBLIC);
    return newConcreteType;
  }
View Full Code Here

Examples of rocket.generator.rebind.type.NewConcreteType

    Checker.notEmpty("parameter:newTypeName", newTypeName);

    final GeneratorContext context = this.getGeneratorContext();
    context.info("Creating serialization factory " + newTypeName);

    final NewConcreteType serializationFactory = context.newConcreteType(newTypeName);
    serializationFactory.setAbstract(false);
    serializationFactory.setFinal(true);
    serializationFactory.setSuperType(this.getSerializationFactory());
    return serializationFactory;
  }
View Full Code Here

Examples of rocket.generator.rebind.type.NewConcreteType

  protected void writeTypes(final Collection types) {
    Checker.notNull("parameter:newTypes", types);

    final Iterator iterator = types.iterator();
    while (iterator.hasNext()) {
      final NewConcreteType newConcreteType = (NewConcreteType) iterator.next();
      newConcreteType.write();
    }
  }
View Full Code Here

Examples of rocket.generator.rebind.type.NewConcreteType

* @author Miroslav Pokorny
*/
public class TestBuilderGenerator extends Generator {

  protected NewConcreteType assembleNewType(final Type type, final String newTypeName) {
    final NewConcreteType testBuilder = this.createTestBuilder(newTypeName);
    final Type webPageTestRunner = this.getTestRunner(type);
    this.addBuildCandidates(testBuilder, webPageTestRunner);
    return testBuilder;
  }
View Full Code Here

Examples of rocket.generator.rebind.type.NewConcreteType

   *
   * @param newTypeName
   * @return
   */
  protected NewConcreteType createTestBuilder(final String newTypeName) {
    final NewConcreteType testBuilder = this.getGeneratorContext().newConcreteType(newTypeName);
    testBuilder.setAbstract(false);
    testBuilder.setFinal(true);
    testBuilder.setSuperType(this.getTestMethodTestBuilder());
    testBuilder.addInterface(this.getTestBuilder());

    return testBuilder;
  }
View Full Code Here

Examples of rocket.generator.rebind.type.NewConcreteType

public class GwtCometGenerator extends Generator {

  protected NewConcreteType assembleNewType(final Type cometClient, final String newTypeName) {
    this.verifyEnvironment();

    final NewConcreteType generated = this.subClassCometClient(newTypeName, cometClient);

    final Type serviceInterface = this.createRpcServiceInterface(generated);
    this.createRpcAsyncServiceInterface(generated);

    this.implementCreateGwtRpcProxy(generated, serviceInterface);
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.