public abstract class AbstractGenerator extends java.lang.Object implements Generator
Link to the corresponding slide in the tutorial on slideshare.
Copyright (C) 2012-2015 JIOWA Business Solutions GmbH, Bettinastr. 30 , 60325 Frankfurt am Main, Germany
Homepage: www.jiowa.de
All rights reserved.
Download: www.jiowa.de/download.html
License: www.jiowa.de/license.html
Modifier and Type | Field and Description |
---|---|
protected JiowaCodeGenConfig |
config
configuration class for code generation
|
protected java.lang.String |
destinationDirectory
destination directory for the generated source code
|
Constructor and Description |
---|
AbstractGenerator(JiowaCodeGenConfig config)
Each generator carries a config class which contains all necessary information
for a generator
from a given property file
|
Modifier and Type | Method and Description |
---|---|
abstract void |
generate()
Starts the generation process of this code generator.
|
protected JiowaCodeGenConfig |
getConfig()
Returns the application configuration class for this class.
|
protected java.lang.String |
getDestinationDirectory()
Returns the destination directory for the generated source code.
|
protected java.lang.String |
updateSourceFile(java.lang.String relativePathAndFilename,
java.lang.String source)
Updates an existing source file (protected regions are also considered)
and additionally returns the source text as result (for possible further computations).
|
protected java.lang.String |
updateSourceFile(java.lang.String relativePathAndFilename,
TemplateBean t)
Updates an existing source file (protected regions are also considered)
and additionally returns the source text as result (for possible further computations).
|
protected java.lang.String destinationDirectory
protected JiowaCodeGenConfig config
public AbstractGenerator(JiowaCodeGenConfig config)
config
- the codegen configprotected JiowaCodeGenConfig getConfig()
public abstract void generate()
protected java.lang.String getDestinationDirectory()
protected java.lang.String updateSourceFile(java.lang.String relativePathAndFilename, TemplateBean t)
relativePathAndFilename
- filepath relative to the given destination directory which is defined in JiowaCodeGenConfig
via the property file (usually jiowa.codegen.properties).t
- the template beanprotected java.lang.String updateSourceFile(java.lang.String relativePathAndFilename, java.lang.String source)
relativePathAndFilename
- filepath relative to the given destination directory which is defined in JiowaCodeGenConfig
via the property file (usually jiowa.codegen.properties).source
- new text source