public class TemplateBasedCodegenRunner extends java.lang.Object implements CodegenRunner
CodegenRunner
generates
source code by replacing tags in a given template with various versions of
the names and types of the elements of the configuration tree and their
children. OPERATION_MODE__ONE_TO_ONE
- one source code item will be generated, using
the same provided template, for each one of the elements in the configuration
treeOPERATION_MODE__ALL_IN_ONE
- will generate only one source code item, which
will contain many occurrences of the processed template (one occurrence for
each element in the configuration tree)PRIMITIVE_POLICY__IGNORE
- The source code generation process will not run
for configuration nodes having primitive data typesPRIMITIVE_POLICY__ACCEPT
- The source code generation process will run for
all nodes of the configuration tree, including those which resolve to
primitive typesTemplateEngineAbstraction
. There are stock template engine abstractions
available. For a list of what's available, See the package
fx.codegen.runner.stock.abstraction.templateengineabstraction
Modifier and Type | Field and Description |
---|---|
static int |
LEAF_POLICY__ACCEPT |
static int |
LEAF_POLICY__IGNORE |
static int |
OPERATION_MODE__ALL_IN_ONE |
static int |
OPERATION_MODE__ONE_TO_ONE |
Constructor and Description |
---|
TemplateBasedCodegenRunner() |
Modifier and Type | Method and Description |
---|---|
int |
getLeafPolicy() |
int |
getOperationMode() |
java.lang.String |
getResultNamePattern() |
java.lang.String |
getTemplateContent() |
TemplateEngineAbstraction |
getTemplateEngineAbstraction() |
java.util.Map<java.lang.String,java.lang.String> |
runConfig(ConfigRoot config) |
void |
setLeafPolicy(int leafPolicy) |
void |
setOperationMode(int operationMode) |
void |
setResultNamePattern(java.lang.String resultNamePattern) |
void |
setTemplateContent(java.lang.String templateContent) |
void |
setTemplateEngineAbstraction(TemplateEngineAbstraction templateEngineAbstraction) |
public static final int OPERATION_MODE__ONE_TO_ONE
public static final int OPERATION_MODE__ALL_IN_ONE
public static final int LEAF_POLICY__ACCEPT
public static final int LEAF_POLICY__IGNORE
public java.lang.String getTemplateContent()
public void setTemplateContent(java.lang.String templateContent)
public int getOperationMode()
public void setOperationMode(int operationMode)
public int getLeafPolicy()
public void setLeafPolicy(int leafPolicy)
public TemplateEngineAbstraction getTemplateEngineAbstraction()
public void setTemplateEngineAbstraction(TemplateEngineAbstraction templateEngineAbstraction)
public java.lang.String getResultNamePattern()
public void setResultNamePattern(java.lang.String resultNamePattern)
public java.util.Map<java.lang.String,java.lang.String> runConfig(ConfigRoot config)
runConfig
in interface CodegenRunner