Class AbstractRefactoring
- java.lang.Object
-
- org.contextmapper.dsl.refactoring.AbstractRefactoring
-
- All Implemented Interfaces:
SemanticCMLRefactoring
- Direct Known Subclasses:
AbstractExtractSymmetricRelationshipRefactoring
,AbstractHenshinRefactoring
,AbstractToggleSymmetricRelationshipRefactoring
,ChangePartnershipToUpstreamDownstreamRefactoring
,DeriveBoundedContextFromSubdomains
,DeriveFrontendAndBackendSystemsFromFeature
,DeriveSubdomainFromUserRequirements
,ExtractAggregatesByCohesion
,ExtractAggregatesByVolatility
,ExtractSuggestedService
,MergeAggregatesRefactoring
,MergeBoundedContextsRefactoring
,SplitBoundedContextByAggregateAttribute
,SplitSystemIntoSubsystems
public abstract class AbstractRefactoring extends java.lang.Object implements SemanticCMLRefactoring
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Set<CMLResource>
additionalResourcesToCheck
protected org.eclipse.emf.ecore.resource.ResourceSet
consistencyCheckResources
protected java.util.Set<CMLResource>
importedResources
protected ContextMappingModel
model
protected CMLResource
rootResource
-
Constructor Summary
Constructors Constructor Description AbstractRefactoring()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected <T> void
addElementsToEList(org.eclipse.emf.common.util.EList<T> list, java.util.List<T> elementsToAdd)
protected <T> void
addElementToEList(org.eclipse.emf.common.util.EList<T> list, T elementToAdd)
protected abstract void
doRefactor()
protected java.util.Set<BoundedContext>
getAllBoundedContexts()
protected java.util.Set<ContextMap>
getAllContextMaps()
protected java.util.Set<Domain>
getAllDomains()
protected java.util.Set<UserRequirement>
getAllUserRequirements()
protected CMLResource
getResource(BoundedContext bc)
void
persistChanges(org.eclipse.xtext.serializer.ISerializer serializer)
Can be called after the 'refactor' method, in case one wants to save/persist the changes to the CML files.void
refactor(CMLResource resource)
Applies the refactoring to the CML model in the given resource.void
refactor(CMLResource resource, org.eclipse.emf.ecore.resource.ResourceSet consistencyCheckResources)
Applies the refactoring to the CML model in the given resource.protected <T> void
removeElementFromEList(org.eclipse.emf.common.util.EList<T> list, T object)
-
-
-
Field Detail
-
model
protected ContextMappingModel model
-
rootResource
protected CMLResource rootResource
-
importedResources
protected java.util.Set<CMLResource> importedResources
-
consistencyCheckResources
protected org.eclipse.emf.ecore.resource.ResourceSet consistencyCheckResources
-
additionalResourcesToCheck
protected java.util.Set<CMLResource> additionalResourcesToCheck
-
-
Method Detail
-
refactor
public void refactor(CMLResource resource)
Description copied from interface:SemanticCMLRefactoring
Applies the refactoring to the CML model in the given resource.- Specified by:
refactor
in interfaceSemanticCMLRefactoring
- Parameters:
resource
- the resource with the CML model that shall be refactored
-
refactor
public void refactor(CMLResource resource, org.eclipse.emf.ecore.resource.ResourceSet consistencyCheckResources)
Description copied from interface:SemanticCMLRefactoring
Applies the refactoring to the CML model in the given resource. Additionally ensures consistency in Context Maps in all resources of the additional ResourceSet.- Specified by:
refactor
in interfaceSemanticCMLRefactoring
- Parameters:
resource
- the resource with the CML model that shall be refactored.consistencyCheckResources
- the resources that contain Context Maps which potentially have to be corrected after refactoring. For example: if you have other models in your workspace that have referenes to the refactored one. If you provide them here as s ResourceSet, the refactoring can correct the references.
-
persistChanges
public void persistChanges(org.eclipse.xtext.serializer.ISerializer serializer)
Description copied from interface:SemanticCMLRefactoring
Can be called after the 'refactor' method, in case one wants to save/persist the changes to the CML files.- Specified by:
persistChanges
in interfaceSemanticCMLRefactoring
- Parameters:
serializer
- the serializer that will be used to check whether the model can be persisted.
-
doRefactor
protected abstract void doRefactor()
-
getAllBoundedContexts
protected java.util.Set<BoundedContext> getAllBoundedContexts()
-
getAllContextMaps
protected java.util.Set<ContextMap> getAllContextMaps()
-
getAllDomains
protected java.util.Set<Domain> getAllDomains()
-
getAllUserRequirements
protected java.util.Set<UserRequirement> getAllUserRequirements()
-
getResource
protected CMLResource getResource(BoundedContext bc)
-
addElementsToEList
protected <T> void addElementsToEList(org.eclipse.emf.common.util.EList<T> list, java.util.List<T> elementsToAdd)
-
addElementToEList
protected <T> void addElementToEList(org.eclipse.emf.common.util.EList<T> list, T elementToAdd)
-
removeElementFromEList
protected <T> void removeElementFromEList(org.eclipse.emf.common.util.EList<T> list, T object)
-
-