public TerminalWriter(final JavaFileInfo javaFileInfo) { Preconditions.checkNotNull(javaFileInfo, "Missing 'javaFileInfo'."); this.javaFileInfo = javaFileInfo; packageName = javaFileInfo.packageName(); terminalName = javaFileInfo.entityName(); prime = javaFileInfo.prime(); tag = CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_CAMEL, terminalName); simpleName = CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, terminalName).replace('_', ' '); terminalTypeName = ClassName.get(packageName, terminalName); }
public void create() { final JavaFile javaFile = JavaFile.builder(packageName, createTerminalType()) .indent(" ") .skipJavaLangImports(true) .build(); Misc.writeJavaFile(javaFile, javaFileInfo.projectInfo().srcMainJavaDir()); final TerminalTestWriter terminalTestWriter = new TerminalTestWriter(javaFileInfo); terminalTestWriter.create(); }