Package org.fugerit.java.core.javagen
Class BasicJavaGenerator
- java.lang.Object
-
- org.fugerit.java.core.javagen.BasicJavaGenerator
-
- All Implemented Interfaces:
JavaGenerator
- Direct Known Subclasses:
SimpleJavaGenerator
public abstract class BasicJavaGenerator extends Object implements JavaGenerator
Basic implementation of JavaGenerator fix of importList (now keep order of elements)- Author:
- Daneel
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.slf4j.Logger
logger
-
Constructor Summary
Constructors Constructor Description BasicJavaGenerator()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static void
customPartWorker(File file, PrintWriter writer, String startTag, String endTag, String indent)
static void
customPartWorker(File file, PrintWriter writer, String startTag, String endTag, String indent, String addIfEmpty)
abstract void
generate()
String
getContent()
Collection<String>
getImportList()
File
getJavaFile()
String
getJavaName()
String
getPackageName()
CustomPrintWriter
getWriter()
void
init(File sourceFolder, String fullObjectBName)
void
init(File sourceFolder, String fullObjectBName, String lineSeparator)
void
println()
void
println(String s)
void
printlnWithTabs(int n, String s)
protected void
setJavaFile(File javaFile)
void
write()
-
-
-
Method Detail
-
init
public void init(File sourceFolder, String fullObjectBName, String lineSeparator) throws ConfigException
- Throws:
ConfigException
-
init
public void init(File sourceFolder, String fullObjectBName) throws ConfigException
- Throws:
ConfigException
-
setJavaFile
protected void setJavaFile(File javaFile)
-
getWriter
public CustomPrintWriter getWriter()
-
getContent
public String getContent()
- Specified by:
getContent
in interfaceJavaGenerator
-
getPackageName
public String getPackageName()
-
getJavaName
public String getJavaName()
-
getJavaFile
public File getJavaFile()
-
getImportList
public Collection<String> getImportList()
-
write
public void write() throws IOException
- Specified by:
write
in interfaceJavaGenerator
- Throws:
IOException
-
generate
public abstract void generate() throws IOException
- Specified by:
generate
in interfaceJavaGenerator
- Throws:
IOException
-
customPartWorker
public static void customPartWorker(File file, PrintWriter writer, String startTag, String endTag, String indent) throws FileNotFoundException, IOException
- Throws:
FileNotFoundException
IOException
-
customPartWorker
public static void customPartWorker(File file, PrintWriter writer, String startTag, String endTag, String indent, String addIfEmpty) throws FileNotFoundException, IOException
- Throws:
FileNotFoundException
IOException
-
println
public void println()
-
println
public void println(String s)
-
printlnWithTabs
public void printlnWithTabs(int n, String s)
-
-