Examples of emitStatement()


Examples of com.hannesdorfmann.fragmentargs.repacked.com.squareup.javawriter.JavaWriter.emitStatement()

      jw.emitEmptyLine();
      // The mapping Method
      jw.beginMethod("void", "inject", EnumSet.of(Modifier.PUBLIC), "Object", "target");

      jw.emitEmptyLine();
      jw.emitStatement("Class<?> targetClass = target.getClass()");
      jw.emitStatement("String targetName = targetClass.getCanonicalName()");

      for (Map.Entry<String, String> entry : mapping.entrySet()) {

        jw.emitEmptyLine();
View Full Code Here

Examples of com.hannesdorfmann.fragmentargs.repacked.com.squareup.javawriter.JavaWriter.emitStatement()

      // The mapping Method
      jw.beginMethod("void", "inject", EnumSet.of(Modifier.PUBLIC), "Object", "target");

      jw.emitEmptyLine();
      jw.emitStatement("Class<?> targetClass = target.getClass()");
      jw.emitStatement("String targetName = targetClass.getCanonicalName()");

      for (Map.Entry<String, String> entry : mapping.entrySet()) {

        jw.emitEmptyLine();
        jw.beginControlFlow("if ( \"%s\".equals(targetName) )", entry.getKey());
View Full Code Here

Examples of com.hannesdorfmann.fragmentargs.repacked.com.squareup.javawriter.JavaWriter.emitStatement()

      for (Map.Entry<String, String> entry : mapping.entrySet()) {

        jw.emitEmptyLine();
        jw.beginControlFlow("if ( \"%s\".equals(targetName) )", entry.getKey());
        jw.emitStatement("%s.injectArguments( ( %s ) target)", entry.getValue(), entry.getKey());
        jw.emitStatement("return");
        jw.endControlFlow();
      }

      // End Mapping method
View Full Code Here

Examples of com.hannesdorfmann.fragmentargs.repacked.com.squareup.javawriter.JavaWriter.emitStatement()

      for (Map.Entry<String, String> entry : mapping.entrySet()) {

        jw.emitEmptyLine();
        jw.beginControlFlow("if ( \"%s\".equals(targetName) )", entry.getKey());
        jw.emitStatement("%s.injectArguments( ( %s ) target)", entry.getValue(), entry.getKey());
        jw.emitStatement("return");
        jw.endControlFlow();
      }

      // End Mapping method
      jw.endMethod();
View Full Code Here

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

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

                  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

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

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