public abstract class IlrFileGenerator
extends java.lang.Object
implements org.eclipse.jface.wizard.IWizardNode
| Modifier and Type | Class and Description |
|---|---|
class |
IlrFileGenerator.Parameter
Stores a ruleset parameter name and type.
|
class |
IlrFileGenerator.RuleApp
Provides some useful methods on a RuleApp project.
|
class |
IlrFileGenerator.RulesetArchive
Stores a ruleset archive name and version with two lists of
ruleset parameters: a list of input parameters (the IN and INOUT
parameters) and a list of output parameters (the INOUT and OUT
parameters).
|
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
contentCreated |
protected static java.lang.String |
JAR_EXTENSION |
| Modifier | Constructor and Description |
|---|---|
protected |
IlrFileGenerator()
Constructs a new generator.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addContainerEntryInClasspath(java.lang.String container)
Adds to the Java project build path the specified container.
|
protected void |
addLibraryEntryInClasspath(java.lang.String path)
Adds to the Java project build path the path specified as
an absolute path.
|
protected void |
addProjectEntryInClasspath(java.lang.String path)
Adds to the Java project build path the path specified as
<projectName>.
|
protected void |
addVariableEntryInClasspath(java.lang.String path)
Adds to the Java project build path the path specified as
<EclipseVariable>/<relativePath>.
|
protected java.lang.String |
changeInClassName(java.lang.String name)
Gets the name specified, with a capital letter as the first letter.
|
protected java.lang.String |
changeInMethodName(java.lang.String name)
Gets the name specified, with a lower case letter as the first letter.
|
org.eclipse.core.resources.IProject |
completeProjectFromTemplate(org.eclipse.core.resources.IProject iproject,
IlrRuleAppProject sourceRuleAppProject,
org.eclipse.core.runtime.IProgressMonitor monitor)
Completes the specified project with the required files by calling the
generateProjectContent(org.eclipse.jdt.core.IJavaProject, org.eclipse.core.runtime.IProgressMonitor) method. |
protected void |
copyFile(java.lang.String source,
java.lang.String destination)
Copies a file from a location (absolute path) in the generated Java
project to a destination directory with a specific file name.
|
protected java.lang.String |
createPackage(org.eclipse.core.resources.IProject project,
java.lang.String root,
java.lang.String name)
Creates a package in the root directory (relative to the project)
of the destination project.
|
org.eclipse.core.resources.IProject |
createProjectFromTemplate(java.lang.String projectname,
org.eclipse.core.runtime.IPath location,
IlrRuleAppProject sourceRuleAppProject,
org.eclipse.core.runtime.IProgressMonitor monitor)
Creates the destination project and calls the
generateProjectContent(org.eclipse.jdt.core.IJavaProject, org.eclipse.core.runtime.IProgressMonitor)
method on the new project. |
java.lang.String |
generateLaunchConfigurationFile(java.lang.String main)
Generates and saves a launch configuration file with the references to
the Rule Project from the RuleApp project.
|
void |
generateProjectContent(org.eclipse.jdt.core.IJavaProject javaProject)
Generates the content of the Java project.
|
void |
generateProjectContent(org.eclipse.jdt.core.IJavaProject javaProject,
org.eclipse.core.runtime.IProgressMonitor monitor)
Generates the content of the Java project.
|
void |
generateProjectContent(org.eclipse.core.resources.IProject project)
Generates the content of the simple project.
|
void |
generateProjectContent(org.eclipse.core.resources.IProject project,
org.eclipse.core.runtime.IProgressMonitor monitor)
Generates the content of the simple project.
|
org.eclipse.jface.wizard.IWizard |
getCompletionWizard()
Returns the completion wizard.
|
org.eclipse.jface.wizard.IWizard |
getCreationWizard()
Returns the creation wizard.
|
protected java.lang.String |
getExecutionServerHome()
Gets the location of the ILOG_EXECUTION_SERVER_HOME Eclipse variable.
|
protected java.util.List<IlrFileGenerator.Parameter> |
getInParameters()
Gets a list of the in/inout ruleset parameters for the RuleApp project.
|
protected java.util.List<IlrFileGenerator.Parameter> |
getInParameters(java.util.Collection<IlrRulesetParameter> rulesetParameters)
Returns a list of input ruleset parameters as
IlrFileGenerator.Parameter instances extracted from a collection of ilog.rules.res.model.IlrRulesetParameter objects |
protected java.util.List<IlrFileGenerator.Parameter> |
getInParameters(IlrRulesetArchiveDescriptor desc)
Gets a list of the in/inout ruleset parameters for a ruleset archive of the
RuleApp project.
|
protected java.util.List<IlrFileGenerator.Parameter> |
getInParameters(ilog.rules.engine.IlrRulesetParameter[] params)
Deprecated.
As of ODM 8.5.1, replaced by
getInParameters(Collection rulesetParameters). |
protected java.util.Set<java.lang.String> |
getInParametersImports()
Deprecated.
As of ODM 8.5.1.
|
protected java.util.Set<java.lang.String> |
getInParametersImports(IlrRulesetArchiveDescriptor archive)
Deprecated.
As of ODM 8.5.1.
|
protected org.eclipse.jdt.core.IJavaProject |
getJavaProject()
Gets the generated destination Java project.
|
protected java.lang.String |
getJavaProjectNameAsClassName()
Gets the Java project name as a valid Java class name, with a capital
letter as the first letter.
|
protected java.lang.String |
getLaunchConfigurationName()
Gets the launch configuration name that was set during the execution of the
generateLaunchConfigurationFile(String) method. |
protected IlrFileGenerator.Parameter |
getNewParameter(java.lang.String name,
java.lang.String type)
Returns a new object of type Parameter.
|
protected IlrFileGenerator.RulesetArchive |
getNewRulesetArchive()
Returns a new object of type
RulesetArchive. |
java.lang.String |
getNotAllowedDescription()
Returns the message to display in the 'Client Project for RuleApps' wizard if the generator is not allowed
to run to return the reason why.
|
protected java.util.List<IlrFileGenerator.Parameter> |
getOutParameters(java.util.Collection<IlrRulesetParameter> rulesetParameters)
Returns a list of output ruleset parameters as
IlrFileGenerator.Parameter instances extracted from a collection of ilog.rules.res.model.IlrRulesetParameter objects. |
protected java.util.List<IlrFileGenerator.Parameter> |
getOutParameters(ilog.rules.engine.IlrRulesetParameter[] params)
Deprecated.
As of ODM 8.5.1, replaced by
getInParameters(Collection rulesetParameters). |
protected java.util.Set<java.lang.String> |
getOutParametersImports()
Deprecated.
As of ODM 8.5.1.
|
protected java.util.List<IlrFileGenerator.Parameter> |
getParameters(java.util.Collection<IlrRulesetParameter> rulesetParameters)
Transforms a collection of
ilog.rules.res.model.IlrRulesetParameter objects into a list of IlrFileGenerator.Parameter instances. |
protected java.util.List<IlrFileGenerator.Parameter> |
getParameters(ilog.rules.engine.IlrRulesetParameter[] params)
Deprecated.
As of ODM 8.5.1, replaced by
getParameters(Collection rulesetParameters). |
protected java.util.Set<java.lang.String> |
getParametersImports()
Deprecated.
As of ODM 8.5.1.
|
protected org.eclipse.core.resources.IProject |
getProject()
Gets the generated destination project if the destination project is not
a Java project.
|
IlrRuleAppProject |
getRuleAppProject()
Gets the RuleApp project selected in the wizard.
|
protected java.util.List<IlrFileGenerator.RulesetArchive> |
getRulesetArchives()
Gets a list of ruleset archives.
|
protected java.util.List<IlrFileGenerator.RulesetArchive> |
getRulesetArchives(IlrRulesetArchiveDescriptor archive)
Gets a list of ruleset archives.
|
protected java.lang.String |
getRuleStudioHome()
Gets the location of the ILOG_BR_STUDIO_HOME Eclipse variable.
|
IlrSignature[] |
getSignatures()
Gets the
in and inout ruleset parameter names and values set
in the wizard. |
protected java.lang.String |
getUTF8CharsetAsString() |
org.eclipse.jface.wizard.IWizard |
getWizard()
Returns the wizard that this node stands for.
|
protected java.util.List<java.lang.String> |
getXOMPath()
Gets a list of paths (String) for all the necessary XOMs, for all rulesets in the RuleApp.
|
void |
initialize(IlrRuleAppProject ruleappProject)
Initializes the generator with the data specified in the wizard.
|
boolean |
isAllowed()
Returns
true if the environment is correctly set to allow the generator to be run correctly. |
boolean |
isJavaProject()
Tests if the project is a Java or a simple project.
|
protected void |
setJavaNature(org.eclipse.core.resources.IProject ijProject) |
void |
setSignatures(IlrSignature[] signatures)
Sets the
in and inout ruleset parameter names and values
in the wizard. |
protected static final java.lang.String JAR_EXTENSION
protected boolean contentCreated
protected IlrFileGenerator()
public boolean isAllowed()
true if the environment is correctly set to allow the generator to be run correctly.
Return false otherwise. If false is returned, the getNotAllowedDescription() method
is called to get the description to display instead of the generator's description. The default
returned value is true.true if the generator is allowed to run, otherwise return false.public java.lang.String getNotAllowedDescription()
isAllowed() is used to control whether or not this message is
displayed. The message will be displayed instead of the generator description.public void initialize(IlrRuleAppProject ruleappProject)
ruleappProject - The RuleApp project selected in the wizard.public IlrRuleAppProject getRuleAppProject()
public void setSignatures(IlrSignature[] signatures)
in and inout ruleset parameter names and values
in the wizard.signatures - The in parameter names and values.public IlrSignature[] getSignatures()
in and inout ruleset parameter names and values set
in the wizard.public boolean isJavaProject()
true, the new project will be a Java project and
src and bin directories will be created. The JRE and
Rule Execution Server JARs will be included in the classpath.
The method called is generateProjectContent(IJavaProject).
If the method returns false, a simple project is created without
anything else.
The method called is generateProjectContent(IProject).
true is returned.protected org.eclipse.jdt.core.IJavaProject getJavaProject()
protected java.lang.String getLaunchConfigurationName()
generateLaunchConfigurationFile(String) method.protected java.lang.String getJavaProjectNameAsClassName()
protected org.eclipse.core.resources.IProject getProject()
protected java.lang.String changeInClassName(java.lang.String name)
name - The name to change.protected java.lang.String changeInMethodName(java.lang.String name)
name - The name to change.public void generateProjectContent(org.eclipse.jdt.core.IJavaProject javaProject,
org.eclipse.core.runtime.IProgressMonitor monitor)
generateProjectContent(IJavaProject)
method for compatibility reasons.javaProject - The destination of the Java project files.monitor - The progress monitor.public void generateProjectContent(org.eclipse.jdt.core.IJavaProject javaProject)
getJavaProject() method.javaProject - The destination of the Java project files.public void generateProjectContent(org.eclipse.core.resources.IProject project,
org.eclipse.core.runtime.IProgressMonitor monitor)
generateProjectContent(IProject)
method for compatibility reasons.project - The destination of the project files.monitor - The progress monitor.public void generateProjectContent(org.eclipse.core.resources.IProject project)
project - The destination of the project files.protected java.lang.String getRuleStudioHome()
protected java.lang.String getExecutionServerHome()
protected void addVariableEntryInClasspath(java.lang.String path)
protected void addLibraryEntryInClasspath(java.lang.String path)
protected void addProjectEntryInClasspath(java.lang.String path)
protected void addContainerEntryInClasspath(java.lang.String container)
protected java.util.Set<java.lang.String> getParametersImports()
protected java.util.Set<java.lang.String> getInParametersImports()
protected java.util.Set<java.lang.String> getInParametersImports(IlrRulesetArchiveDescriptor archive)
archive input ruleset parameters that require import statements to be added in the generated code.protected java.util.Set<java.lang.String> getOutParametersImports()
protected java.util.List<IlrFileGenerator.Parameter> getParameters(java.util.Collection<IlrRulesetParameter> rulesetParameters)
ilog.rules.res.model.IlrRulesetParameter objects into a list of IlrFileGenerator.Parameter instances.protected java.util.List<IlrFileGenerator.Parameter> getParameters(ilog.rules.engine.IlrRulesetParameter[] params)
getParameters(Collection rulesetParameters).ilog.rules.engine.IlrRulesetParameter objects into a list of IlrFileGenerator.Parameter instances.protected java.util.List<IlrFileGenerator.Parameter> getInParameters(java.util.Collection<IlrRulesetParameter> rulesetParameters)
IlrFileGenerator.Parameter instances extracted from a collection of ilog.rules.res.model.IlrRulesetParameter objectsprotected java.util.List<IlrFileGenerator.Parameter> getInParameters(ilog.rules.engine.IlrRulesetParameter[] params)
getInParameters(Collection rulesetParameters).IlrFileGenerator.Parameter instances extracted from an array of ilog.rules.engine.IlrRulesetParameter objects.protected java.util.List<IlrFileGenerator.Parameter> getInParameters()
protected java.util.List<IlrFileGenerator.Parameter> getInParameters(IlrRulesetArchiveDescriptor desc)
protected java.util.List<IlrFileGenerator.Parameter> getOutParameters(java.util.Collection<IlrRulesetParameter> rulesetParameters)
IlrFileGenerator.Parameter instances extracted from a collection of ilog.rules.res.model.IlrRulesetParameter objects.protected java.util.List<IlrFileGenerator.Parameter> getOutParameters(ilog.rules.engine.IlrRulesetParameter[] params)
getInParameters(Collection rulesetParameters).IlrFileGenerator.Parameter instances extracted from an array of ilog.rules.engine.IlrRulesetParameter objects.protected java.util.List<java.lang.String> getXOMPath()
protected java.util.List<IlrFileGenerator.RulesetArchive> getRulesetArchives()
protected java.util.List<IlrFileGenerator.RulesetArchive> getRulesetArchives(IlrRulesetArchiveDescriptor archive)
protected void copyFile(java.lang.String source,
java.lang.String destination)
source - The location of the file to copy.destination - The full path in the generated Java project.public java.lang.String generateLaunchConfigurationFile(java.lang.String main)
main - The main class to execute.protected java.lang.String createPackage(org.eclipse.core.resources.IProject project,
java.lang.String root,
java.lang.String name)
project - The project where the package is created.root - The relative path where the package is created.name - The new package name.protected IlrFileGenerator.RulesetArchive getNewRulesetArchive()
RulesetArchive. Redefine this method if you
extend the RulesetArchive class and you want your class to be created instead
of IlrFileGenerator.RulesetArchive.protected IlrFileGenerator.Parameter getNewParameter(java.lang.String name, java.lang.String type)
IlrFileGenerator.Parameter.public org.eclipse.jface.wizard.IWizard getWizard()
If no wizard is specified in the extension, this method returns null.
getWizard in interface org.eclipse.jface.wizard.IWizardNodepublic org.eclipse.jface.wizard.IWizard getCompletionWizard()
If no wizard is specified in the extension, this method returns the
IlrDefaultCompletionWizard class.
public org.eclipse.jface.wizard.IWizard getCreationWizard()
If no wizard is specified in the extension, this method will return the
IlrDefaultCreationWizard class.
public org.eclipse.core.resources.IProject createProjectFromTemplate(java.lang.String projectname,
org.eclipse.core.runtime.IPath location,
IlrRuleAppProject sourceRuleAppProject,
org.eclipse.core.runtime.IProgressMonitor monitor)
generateProjectContent(org.eclipse.jdt.core.IJavaProject, org.eclipse.core.runtime.IProgressMonitor)
method on the new project.
Before the generateProjectContent(org.eclipse.jdt.core.IJavaProject, org.eclipse.core.runtime.IProgressMonitor) method is called, the class path is completed
and the RuleApp archive is generated.projectname - The name of the new project.location - The location of the new project.sourceRuleAppProject - The RuleApp project used to generate the files.monitor - The progress monitor.public org.eclipse.core.resources.IProject completeProjectFromTemplate(org.eclipse.core.resources.IProject iproject,
IlrRuleAppProject sourceRuleAppProject,
org.eclipse.core.runtime.IProgressMonitor monitor)
generateProjectContent(org.eclipse.jdt.core.IJavaProject, org.eclipse.core.runtime.IProgressMonitor) method.
If the project does not exist on disk, it is created.
Before the generateProjectContent(org.eclipse.jdt.core.IJavaProject, org.eclipse.core.runtime.IProgressMonitor) method is called, the class path is completed
and the RuleApp archive is generated.iproject - The project to complete.sourceRuleAppProject - The RuleApp project used to generate the files.monitor - The progress monitor.protected void setJavaNature(org.eclipse.core.resources.IProject ijProject)
throws org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.CoreExceptionprotected java.lang.String getUTF8CharsetAsString()
© Copyright IBM Corp. 1987, 2017