|
Generators | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.topcased.generator.AbstractGenerator
public abstract class AbstractGenerator
An abstract implementation of a generator using JET and JMerge to generate code for EMF projects.
Creation : 9 nov. 2005
Field Summary | |
---|---|
static java.lang.String |
JAVA_BUILDER
The Java builder id |
static java.lang.String |
JCONTROL_MODEL_NAME
The name of the JControl model |
static java.lang.String |
MANIFEST_BUILDER
The Manifest builder id |
static java.lang.String |
PDE_NATURE
The PDE nature id |
protected static java.lang.String |
PROPERTIES_ENCODING
Encoding for properties file |
static java.lang.String |
SCHEMA_BUILDER
The Schema builder id |
static java.lang.String |
SOURCE_DIRECTORY
The name of the src directory |
Constructor Summary | |
---|---|
AbstractGenerator()
|
Method Summary | |
---|---|
protected static org.eclipse.core.resources.ICommand[] |
addDefaultBuilders(org.eclipse.core.resources.IProjectDescription projectDescription)
Add the default builders if they are not already present in the given IProjectDescription. |
protected static java.lang.String[] |
addDefaultNatures(org.eclipse.core.resources.IProjectDescription projectDescription)
Add the default natures if they are not already present in the given IProjectDescription. |
protected void |
applyTemplate(java.lang.Object input,
java.lang.String templateURI,
org.eclipse.core.runtime.IPath outputFile,
boolean isOverwrite)
Apply a JET template to an object. |
protected static org.eclipse.core.resources.IProject |
createEMFProject(java.lang.String projectName)
Create an empty EMF Project with default values. |
protected abstract JETEmitter |
createJETEmitter(java.lang.String templateURI)
Creates the JET Emitter to use for the generation. |
protected void |
createPackage(java.lang.String packageName,
org.eclipse.core.resources.IProject project)
Creates the given package on the project |
abstract org.eclipse.core.resources.IProject |
generate(org.eclipse.core.runtime.IProgressMonitor monitor)
Launch the generation. |
protected java.lang.String |
getTemplateURI(org.osgi.framework.Bundle bundle,
java.lang.String relativePath)
Returns a template URI for the given bundle and path relative to this bundle. |
static void |
organizeImports(org.eclipse.core.resources.IProject project)
Performs an Organize imports on the generated project. |
protected static boolean |
validateEdit(org.eclipse.core.resources.IFile file)
Check whether the file can be modified |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String JCONTROL_MODEL_NAME
public static final java.lang.String PDE_NATURE
public static final java.lang.String JAVA_BUILDER
public static final java.lang.String MANIFEST_BUILDER
public static final java.lang.String SCHEMA_BUILDER
public static final java.lang.String SOURCE_DIRECTORY
protected static final java.lang.String PROPERTIES_ENCODING
Constructor Detail |
---|
public AbstractGenerator()
Method Detail |
---|
public abstract org.eclipse.core.resources.IProject generate(org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
monitor
- the monitor for the work progression
org.eclipse.core.runtime.CoreException
- if the generation failsprotected static java.lang.String[] addDefaultNatures(org.eclipse.core.resources.IProjectDescription projectDescription)
projectDescription
- an existing project description
protected static org.eclipse.core.resources.ICommand[] addDefaultBuilders(org.eclipse.core.resources.IProjectDescription projectDescription)
projectDescription
- an existing project description
protected static org.eclipse.core.resources.IProject createEMFProject(java.lang.String projectName)
projectName
- the name of the project to create.
public static void organizeImports(org.eclipse.core.resources.IProject project)
project
- the generated projectprotected static boolean validateEdit(org.eclipse.core.resources.IFile file)
file
-
protected void applyTemplate(java.lang.Object input, java.lang.String templateURI, org.eclipse.core.runtime.IPath outputFile, boolean isOverwrite) throws JETException, org.eclipse.core.runtime.CoreException
input
- the input objecttemplateURI
- outputFile
- isOverwrite
- whether the file should be overwritten
JETException
org.eclipse.core.runtime.CoreException
protected abstract JETEmitter createJETEmitter(java.lang.String templateURI)
templateURI
- the template URI.
protected java.lang.String getTemplateURI(org.osgi.framework.Bundle bundle, java.lang.String relativePath)
bundle
- relativePath
-
protected void createPackage(java.lang.String packageName, org.eclipse.core.resources.IProject project) throws org.eclipse.core.runtime.CoreException
packageName
- the name of the package to create if not existsproject
- the project where generates
org.eclipse.core.runtime.CoreException
- if the generation failed
|
Generators | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) 2005 TOPCASED Contributors 2005 - 2007. All rights reserved.