Package com.opencloud.sce.fsmtool.ant
Class StringTemplateBasedTask
- java.lang.Object
-
- org.apache.tools.ant.ProjectComponent
-
- org.apache.tools.ant.Task
-
- com.opencloud.sce.fsmtool.ant.StringTemplateBasedTask
-
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
MakeMultiFsmSbbTask
public abstract class StringTemplateBasedTask extends org.apache.tools.ant.Task
This class defines common behaviour for tasks that uses a String template group to generate some code
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.apache.log4j.Logger
log
-
Constructor Summary
Constructors Constructor Description StringTemplateBasedTask()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
execute(String taskDescription)
protected abstract String
getDefaultTemplate()
protected File
getDestinationDirectory(String destination)
protected PrintWriter
getDestinationPrintWriter(File destDir, String fileName)
protected PrintWriter
getDestinationPrintWriter(String fileName)
protected File
getFile(String fileName, String description)
protected void
getFiniteStateMachineModels(List<StateMachineWrapper> stateMachines)
protected String
getPackageName()
protected org.stringtemplate.v4.STGroup
getStringTemplateGroup()
protected void
logMessages(Collection<com.opencloud.sce.fsmtool.fsm.BuilderMessage> messages)
void
setDestDir(String destDir)
void
setPackage(String packageName)
void
setTemplate(String pathToTemplate)
-
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, execute, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
-
-
-
-
Method Detail
-
setTemplate
public void setTemplate(String pathToTemplate)
-
setDestDir
public void setDestDir(String destDir)
-
setPackage
public void setPackage(String packageName)
-
execute
protected final void execute(String taskDescription) throws org.apache.tools.ant.BuildException
- Throws:
org.apache.tools.ant.BuildException
-
getStringTemplateGroup
protected final org.stringtemplate.v4.STGroup getStringTemplateGroup() throws FileNotFoundException
- Throws:
FileNotFoundException
-
getDestinationDirectory
protected final File getDestinationDirectory(String destination) throws org.apache.tools.ant.BuildException
- Throws:
org.apache.tools.ant.BuildException
-
getFile
protected final File getFile(String fileName, String description) throws org.apache.tools.ant.BuildException
- Throws:
org.apache.tools.ant.BuildException
-
getDefaultTemplate
protected abstract String getDefaultTemplate()
-
getPackageName
protected final String getPackageName()
-
getFiniteStateMachineModels
protected final void getFiniteStateMachineModels(List<StateMachineWrapper> stateMachines) throws org.antlr.runtime.RecognitionException, ParseException
- Throws:
org.antlr.runtime.RecognitionException
ParseException
-
logMessages
protected void logMessages(Collection<com.opencloud.sce.fsmtool.fsm.BuilderMessage> messages)
-
getDestinationPrintWriter
protected final PrintWriter getDestinationPrintWriter(String fileName) throws IOException
- Throws:
IOException
-
getDestinationPrintWriter
protected final PrintWriter getDestinationPrintWriter(File destDir, String fileName) throws IOException
- Throws:
IOException
-
-