|
Rule Execution Server API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ilog.rules.studio.res.generator.IlrFileGenerator ilog.rules.studio.res.generator.IlrVelocityGenerator
public abstract class IlrVelocityGenerator
Adds a generator to the generator list in the
New Client Project for RuleApps wizard. Contrary to the
IlrFileGenerator
, when you extend this class you will use
velocity as the template generator.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class ilog.rules.studio.res.generator.IlrFileGenerator |
---|
IlrFileGenerator.Parameter, IlrFileGenerator.RuleApp, IlrFileGenerator.RulesetArchive |
Field Summary |
---|
Fields inherited from class ilog.rules.studio.res.generator.IlrFileGenerator |
---|
contentCreated |
Constructor Summary | |
---|---|
IlrVelocityGenerator()
Constructs a new generator. |
Method Summary | |
---|---|
void |
generateProjectContent(org.eclipse.jdt.core.IJavaProject javaProject)
Generates the content of the Java project. |
protected void |
generateVelocityFile(String path,
String filePrefix,
String templatePath,
String newFilename,
String extension,
Object userData)
Manages the velocity generator in the generateProjectContent(IJavaProject) method. |
protected void |
generateVelocityFile(String path,
String filePrefix,
String templateDirectory,
String templatePath,
String newFilename,
String extension,
Object userData)
Manages the velocity generator in the generateProjectContent(IJavaProject) method. |
protected void |
generateVelocityFileInSrc(String packagePrefix,
String filePrefix,
String templatePath,
String newFilename,
String extension,
Object userData)
Manages the velocity generator in the generateProjectContent(IJavaProject) method. |
protected void |
generateVelocityFileInSrc(String packagePrefix,
String filePrefix,
String templateDirectory,
String templatePath,
String newFilename,
String extension,
Object userData)
Manages the velocity generator in the generateProjectContent(IJavaProject) method. |
protected String |
getGeneratedExtension()
Gets the name (name and extension) of the file that will be created by the generateVelocityFile(String,String,String,String,String,Object) method. |
protected String |
getGeneratedFileName()
Gets the name (without extension) of the file that will be created by the generateVelocityFile(String,String,String,String,String,Object) method. |
protected String |
getGeneratedName()
Gets the extension of the file that will be created by the generateVelocityFile(String,String,String,String,String,Object) method. |
protected abstract String |
getTemplateDirectory()
Gets the location (an absolute path) the template paths will be relative to. |
protected abstract org.apache.velocity.VelocityContext |
initializeContext(Object userData,
org.apache.velocity.VelocityContext context)
Initializes a velocity context. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.jface.wizard.IWizardNode |
---|
dispose, getExtent, isContentCreated |
Constructor Detail |
---|
public IlrVelocityGenerator()
Method Detail |
---|
protected abstract String getTemplateDirectory()
public void generateProjectContent(org.eclipse.jdt.core.IJavaProject javaProject)
The default implementation creates a src directory in the Java project.
generateProjectContent
in class IlrFileGenerator
javaProject
- The destination of the Java project files.IlrFileGenerator.generateProjectContent(IJavaProject)
protected void generateVelocityFileInSrc(String packagePrefix, String filePrefix, String templatePath, String newFilename, String extension, Object userData)
generateProjectContent(IJavaProject)
method.
This method uses the getTemplateDirectory()
method
to know where to look for the template files specified by templatePath parameter.
The initializeContext(Object,VelocityContext)
method is called to get the parameter values to put
in the template file.
packagePrefix
- The relative path to the src directory to
create the file. If the package does not exist, it is created.
If the path is null, the file will be generated in the project
root directory.filePrefix
- The prefix that will be added to the template file
to compute the generated file name.templatePath
- The relative path of the .vm file. The path is relative
to the path specified by the getTemplateDirectory()
method.
The path separator is '/' even on Windows.newFilename
- The generated file name. If the value is null, the
generated file name will be computed replacing the ".vm" extension
in the template file name by the extension specified in the extension
parameter.extension
- The extension to use to compute the generated file name
using the template file name. It is used only if the newFilename
parameter is null.userData
- An object that will be transmitted to the initializeContext(Object,VelocityContext)
method.protected void generateVelocityFileInSrc(String packagePrefix, String filePrefix, String templateDirectory, String templatePath, String newFilename, String extension, Object userData)
generateProjectContent(IJavaProject)
method.
The template file specified by templatePath
parameter is relative to the
templateDirectory
parameter.
The initializeContext(Object,VelocityContext)
method is called to get the parameter
values to put in the template file.
packagePrefix
- The relative path to the src directory to
create the file. If the package does not exist, it is created.
If the path is null, the file will be generated in the project
root directory.filePrefix
- The prefix that will be added to the template file
to compute the generated file name.templateDirectory
- The location (an absolute path) where the template path will
be relative to.templatePath
- The relative path of the .vm file. The path is relative
to the path specified by the templateDirectory
parameter.
The path separator is '/' even on Windows.newFilename
- The generated file name. If the value is null, the
generated file name will be computed replacing the ".vm" extension
in the template file name by the extension specified in the extension
parameter.extension
- The extension to use to compute the generated file name
using the template file name. It is used only if the newFilename
parameter is null.userData
- An object that will be transmitted to the initializeContext(Object,VelocityContext)
method.protected void generateVelocityFile(String path, String filePrefix, String templatePath, String newFilename, String extension, Object userData)
generateProjectContent(IJavaProject)
method.
This method uses the getTemplateDirectory()
method
to know where to look for the template files specified by templatePath parameter.
The initializeContext(Object,VelocityContext)
method is called
to get the parameter values to put in the template file.
path
- The relative path to the project directory to
create the file. If the path does not exist, it is created.
If the path is null, the file will be generated in the project
root directory (it is equivalent to set the path to "").filePrefix
- The prefix that will be added to the template file
to compute the generated file name.templatePath
- The relative path of the .vm file. The path is relative
to the path specified by the getTemplateDirectory()
method.
The path separator is '/' even on Windows.newFilename
- The generated file name. If the value is null, the
generated file name will be computed replacing the ".vm" extension
in the template file name by the extension specified in the extension
parameter.extension
- The extension to use to compute the generated file name
using the template file name. It is used only if the newFilename
parameter is null.userData
- An object that will be transmitted to the initializeContext(Object,VelocityContext)
method.protected void generateVelocityFile(String path, String filePrefix, String templateDirectory, String templatePath, String newFilename, String extension, Object userData)
generateProjectContent(IJavaProject)
method.
The template file specified by templatePath
parameter is relative to the
templateDirectory
parameter.
The initializeContext(Object,VelocityContext)
method is called
to get the parameter values to put in the template file.
path
- The relative path to the project directory to
create the file. If the path does not exist, it is created.
If the path is null, the file will be generated in the project
root directory (it is equivalent to set the path to "").filePrefix
- The prefix that will be added to the template file
to compute the generated file name.templateDirectory
- The location (an absolute path) where the template path will
be relative to.templatePath
- The relative path of the .vm file. The path is relative
to the path specified by the templateDirectory
parameter.
The path separator is '/' even on Windows.newFilename
- The generated file name. If the value is null, the
generated file name will be computed replacing the ".vm" extension
in the template file name by the extension specified in the extension
parameter.extension
- The extension to use to compute the generated file name
using the template file name. It is used only if the newFilename
parameter is null.userData
- An object that will be transmitted to the initializeContext(Object,VelocityContext)
method.protected abstract org.apache.velocity.VelocityContext initializeContext(Object userData, org.apache.velocity.VelocityContext context)
generateVelocityFile(String,String,String,String,String,Object)
method. It gets the parameters to put in the velocity template.
userData
- The object specified in the
generateVelocityFile(String,String,String,String,String,Object)
method.context
- The velocity context to fill.
protected String getGeneratedExtension()
generateVelocityFile(String,String,String,String,String,Object)
method.
protected String getGeneratedFileName()
generateVelocityFile(String,String,String,String,String,Object)
method.
protected String getGeneratedName()
generateVelocityFile(String,String,String,String,String,Object)
method.
|
Rule Execution Server API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |