com.legstar.codegen
Class CodeGenMake

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by com.legstar.codegen.CodeGenMake

public class CodeGenMake
extends org.apache.tools.ant.Task

This Ant task iteratively calls the Velocity template engine to create a list of artifacts described in an xml file. The xml file typically describes a target as a sequential list of steps. Each step is associated with a velocity template and produces an artifact. TODO describe the format of xml make in an xsd


Field Summary
static String CODEGEN_STEP_XML_E
          XML element representing a code generation step with a template.
static String CODEGEN_TARGET_DIR_XML_A
          XML attribute representing a code generation target directory.
static String CODEGEN_TARGET_NAME_XML_A
          XML attribute representing a code generation target name.
static String CODEGEN_TARGET_XML_E
          XML element representing a code generation target.
static String CODEGEN_TEMPLATE_NAME_XML_A
          XML attribute representing a code generation template name.
static String CODEGEN_TEMPLATE_TARGET_CHARSETNAME_XML_A
          XML attribute representing a code generation target character set.
static String CODEGEN_TEMPLATE_TARGET_FILE_XML_A
          XML attribute representing a code generation target file.
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
CodeGenMake()
           
 
Method Summary
 void execute()
           
 String getCodeGenMakeFileName()
           
 String getGeneratorName()
           
 Object getModel()
           
 String getModelName()
           
 void init()
           
 Document load(File makeFile)
          Loads code generation make file from a serialized XML.
 void setCodeGenMakeFileName(String codeGenMakeFileName)
           
 void setGeneratorName(String generatorName)
           
 void setModel(Object model)
           
 void setModelName(String modelName)
           
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CODEGEN_TARGET_XML_E

public static final String CODEGEN_TARGET_XML_E
XML element representing a code generation target.

See Also:
Constant Field Values

CODEGEN_TARGET_NAME_XML_A

public static final String CODEGEN_TARGET_NAME_XML_A
XML attribute representing a code generation target name.

See Also:
Constant Field Values

CODEGEN_TARGET_DIR_XML_A

public static final String CODEGEN_TARGET_DIR_XML_A
XML attribute representing a code generation target directory.

See Also:
Constant Field Values

CODEGEN_STEP_XML_E

public static final String CODEGEN_STEP_XML_E
XML element representing a code generation step with a template.

See Also:
Constant Field Values

CODEGEN_TEMPLATE_NAME_XML_A

public static final String CODEGEN_TEMPLATE_NAME_XML_A
XML attribute representing a code generation template name.

See Also:
Constant Field Values

CODEGEN_TEMPLATE_TARGET_FILE_XML_A

public static final String CODEGEN_TEMPLATE_TARGET_FILE_XML_A
XML attribute representing a code generation target file.

See Also:
Constant Field Values

CODEGEN_TEMPLATE_TARGET_CHARSETNAME_XML_A

public static final String CODEGEN_TEMPLATE_TARGET_CHARSETNAME_XML_A
XML attribute representing a code generation target character set.

See Also:
Constant Field Values
Constructor Detail

CodeGenMake

public CodeGenMake()
Method Detail

init

public void init()
Overrides:
init in class org.apache.tools.ant.Task

execute

public void execute()
Overrides:
execute in class org.apache.tools.ant.Task

load

public Document load(File makeFile)
              throws CodeGenMakeException
Loads code generation make file from a serialized XML.

Parameters:
makeFile - the serialized file
Returns:
an in-memory DOM code generation make
Throws:
CodeGenMakeException - if load fails

getCodeGenMakeFileName

public String getCodeGenMakeFileName()
Returns:
the code generation Make File name

setCodeGenMakeFileName

public void setCodeGenMakeFileName(String codeGenMakeFileName)
Parameters:
codeGenMakeFileName - the code generation Make File name to set

getModelName

public String getModelName()
Returns:
the model name

setModelName

public void setModelName(String modelName)
Parameters:
modelName - the model name to set

getModel

public Object getModel()
Returns:
the model used to apply templates to

setModel

public void setModel(Object model)
Parameters:
model - the model to set

getGeneratorName

public String getGeneratorName()
Returns:
the name of the calling generator

setGeneratorName

public void setGeneratorName(String generatorName)
Parameters:
generatorName - the name of the calling generator to set


Copyright © 2015 LegSem. All Rights Reserved.