Examples of NewInstanceTemplatedFile


Examples of rocket.serialization.rebind.newinstance.NewInstanceTemplatedFile

        parameters);
    final NewMethod newMethod = method.copy(reader);
    newMethod.setAbstract(false);

    final Constructor constructor = type.getConstructor(Collections.EMPTY_LIST);
    final NewInstanceTemplatedFile newInstanceStatement = new NewInstanceTemplatedFile();
    newInstanceStatement.setConstructor(constructor);

    final CodeBlock returnStatement = new CodeBlock() {
      public boolean isEmpty() {
        return false;
      }

      public void write(final SourceWriter writer) {
        writer.print("return ");
        newInstanceStatement.write(writer);
      }
    };

    newMethod.setBody(returnStatement);
View Full Code Here

Examples of rocket.serialization.rebind.newinstance.NewInstanceTemplatedFile

  protected void addSingletonField(final NewConcreteType type) {
    Checker.notNull("parameter:type", type);

    final NewField singleton = type.newField();

    final NewInstanceTemplatedFile body = new NewInstanceTemplatedFile();
    final Constructor constructor = type.getConstructor(Collections.<Type>emptyList());
    body.setConstructor(constructor);

    singleton.setValue(body);

    singleton.setFinal(true);
    singleton.setName(SerializationConstants.SINGLETON);
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.