Class AbstractProjectCreator
- java.lang.Object
-
- net.ssehub.easy.producer.eclipse.persistency.project_creation.AbstractProjectCreator
-
- Direct Known Subclasses:
DerivedProjectCreator,NewProjectCreator
abstract class AbstractProjectCreator extends java.lang.ObjectSuper class for creating new EASy projects.- Author:
- El-Sharkawy
-
-
Field Summary
Fields Modifier and Type Field Description private IEASyProjectConfigurator[]configuratorsConfigurators to configure the project during creation.private booleanlazyprivate static EASyLoggerFactory.EASyLoggerLOGGERprivate ProductLineProjectnewPLPprivate EclipsePersistencerpersistencerprivate org.eclipse.core.resources.IProjectprojectprivate java.lang.StringprojectName
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractProjectCreator(java.lang.String projectName, boolean lazy, IEASyProjectConfigurator... configurators)Sole constructor for creating new EASy projects.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description private voidconfigureProject()Configures the newly created project.protected abstract voidconfigureProject(org.eclipse.core.resources.IProject createdProject, IEASyProjectConfigurator configurator)Configures the newly created Eclipse project.(package private) abstract ProductLineProjectcreateEASyProject()Creates the newProductLineProjectwith the specified parameters.private voidcreateNewEASyProject()Create the project related information, i.e., the PLP instance, possibly including the containing project.protected voidcreateProject()Creates the (empty)ProductLineProject, which may needs further configuration.protected ProductLineProjectgetCreatedProject()Returns the newly createdProductLineProject.protected booleanisLazyCreation()Returns whether the project should be created lazy.protected voidsetPersistenceProperties()Sets persistence properties for the newly created project and refreshes the workspace/models.
-
-
-
Field Detail
-
LOGGER
private static final EASyLoggerFactory.EASyLogger LOGGER
-
newPLP
private ProductLineProject newPLP
-
projectName
private java.lang.String projectName
-
persistencer
private EclipsePersistencer persistencer
-
project
private org.eclipse.core.resources.IProject project
-
lazy
private boolean lazy
-
configurators
private IEASyProjectConfigurator[] configurators
Configurators to configure the project during creation. Maybe null.
-
-
Constructor Detail
-
AbstractProjectCreator
protected AbstractProjectCreator(java.lang.String projectName, boolean lazy, IEASyProjectConfigurator... configurators)Sole constructor for creating new EASy projects.- Parameters:
projectName- The name of the new project (should already be checked, whether the name is valid).lazy- iftrue, create only required parts, else assume that project does not exist beforeconfigurators- Optional list of configurators to configure the newly created project, maybe null. The configurators whill be applied in the ordering of the array.
-
-
Method Detail
-
getCreatedProject
protected final ProductLineProject getCreatedProject()
Returns the newly createdProductLineProject.- Returns:
- The newly created
ProductLineProjector null if this method was called before the creation was finished.
-
isLazyCreation
protected final boolean isLazyCreation()
Returns whether the project should be created lazy.- Returns:
trueif only required parts should be created, else assume that project does not exist before
-
createProject
protected final void createProject()
Creates the (empty)ProductLineProject, which may needs further configuration. This is the first step while creating a derived or not derived project. This project will also be configured with the givenIEASyProjectConfigurators.
-
configureProject
private void configureProject()
Configures the newly created project. For instance, this may include to change the project to a Java project. Part of thecreateProject()method.
-
configureProject
protected abstract void configureProject(org.eclipse.core.resources.IProject createdProject, IEASyProjectConfigurator configurator)Configures the newly created Eclipse project.- Parameters:
createdProject- The newly created EASy (Eclipse) project.configurator- The configurator to use for configuring the project.
-
createNewEASyProject
private void createNewEASyProject()
Create the project related information, i.e., the PLP instance, possibly including the containing project. This project needs further configuration. Part of thecreateProject()method.
-
setPersistenceProperties
protected final void setPersistenceProperties()
Sets persistence properties for the newly created project and refreshes the workspace/models.
-
createEASyProject
abstract ProductLineProject createEASyProject()
Creates the newProductLineProjectwith the specified parameters.- Returns:
- The newly created
ProductLineProject.
-
-