Package com.squareup.javawriter

Examples of com.squareup.javawriter.JavaWriter.emitStatement()


    writer.beginMethod(null, factoryName,
        descriptor.publicType() ? EnumSet.of(PUBLIC) : EnumSet.noneOf(Modifier.class),
        constructorTokens.build().toArray(new String[0]));

    for (String providerName : descriptor.providerNames().values()) {
      writer.emitStatement("this.%1$s = %1$s", providerName);
    }

    writer.endMethod();

    for (final FactoryMethodDescriptor methodDescriptor : descriptor.methodDescriptors()) {
View Full Code Here


                  return methodDescriptor.passedParameters().contains(parameter)
                      ? parameter.name()
                      : descriptor.providerNames().get(parameter.asKey()) + ".get()";
                }
              });
      writer.emitStatement("return new %s(%s)", writer.compressType(methodDescriptor.returnType()),
          argumentJoiner.join(creationParameterNames));
      writer.endMethod();
    }

    for (ImplemetationMethodDescriptor methodDescriptor
View Full Code Here

              .transform(new Function<Parameter, String>() {
                @Override public String apply(Parameter parameter) {
                  return parameter.name();
                }
              });
      writer.emitStatement("return create(%s)", argumentJoiner.join(creationParameterNames));
      writer.endMethod();
    }

    writer.endType();
    writer.close();
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.