org.fisco.bcos.web3j.codegen.Generator Maven / Gradle / Ivy
package org.fisco.bcos.web3j.codegen;
import com.squareup.javapoet.JavaFile;
import com.squareup.javapoet.TypeSpec;
import java.io.File;
import java.io.IOException;
/** Common code generator methods. */
class Generator {
void write(String packageName, TypeSpec typeSpec, String destinationDir) throws IOException {
JavaFile javaFile =
JavaFile.builder(packageName, typeSpec).indent(" ").skipJavaLangImports(true).build();
javaFile.writeTo(new File(destinationDir));
}
static String buildWarning(Class cls) {
return "Auto generated code.\n"
+ "Do not modifiy!\n"
+ "
Please use "
+ cls.getName()
+ " in the \n"
+ ""
+ "codegen module to update.\n";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy