Package com.squareup.javawriter

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


    JavaWriter writer = new JavaWriter(sourceFile.openWriter());
    String packageName = getPackage(descriptor.name()).toString();
    writer.emitPackage(packageName)
        .emitImports("javax.annotation.Generated");

    writer.emitImports("javax.inject.Inject");
    if (!descriptor.providerNames().isEmpty()) {
      writer.emitImports("javax.inject.Provider");
    }

    for (String implementingType : descriptor.implementingTypes()) {
View Full Code Here


    writer.emitPackage(packageName)
        .emitImports("javax.annotation.Generated");

    writer.emitImports("javax.inject.Inject");
    if (!descriptor.providerNames().isEmpty()) {
      writer.emitImports("javax.inject.Provider");
    }

    for (String implementingType : descriptor.implementingTypes()) {
      String implementingPackageName = getPackage(implementingType).toString();
      if (!"java.lang".equals(implementingPackageName)
View Full Code Here

    for (String implementingType : descriptor.implementingTypes()) {
      String implementingPackageName = getPackage(implementingType).toString();
      if (!"java.lang".equals(implementingPackageName)
          && !packageName.equals(implementingPackageName)) {
        writer.emitImports(implementingType);
      }
    }

    String[] implementedClasses = FluentIterable.from(descriptor.implementingTypes())
        .transform(new Function<String, String>() {
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.