Class RefactoringHelper
- java.lang.Object
-
- org.contextmapper.dsl.refactoring.RefactoringHelper
-
public class RefactoringHelper extends java.lang.Object
Some common logic that is used in multiple ARs to ensure model validity.
-
-
Constructor Summary
Constructors Constructor Description RefactoringHelper(AbstractRefactoring ar)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
adjustAggregateAndModuleNames(BoundedContext bc, java.lang.String suffix)
If we create a deep-copy of a Bounded Context, we have to rename all Aggregates, Modules, and domain objects.void
adjustDomainObjectNames(java.util.List<SimpleDomainObject> domainObjects, java.lang.String suffix)
If we create a deep-copy of a Bounded Context, we have to rename all domain objects.java.util.List<Aggregate>
collectAggregates(BoundedContext bc)
Collects all Aggregates in the current CML model.java.util.Set<java.lang.String>
collectAllAggregateNames()
Collects all Aggregate names of the current model.java.util.Set<java.lang.String>
collectAllModuleNames()
Collects all module names of the current CML model.java.lang.String
getUniqueName(java.lang.String initialName, java.util.Set<java.lang.String> givenNames)
Creates a unique name using a counter.
-
-
-
Constructor Detail
-
RefactoringHelper
public RefactoringHelper(AbstractRefactoring ar)
-
-
Method Detail
-
adjustAggregateAndModuleNames
public void adjustAggregateAndModuleNames(BoundedContext bc, java.lang.String suffix)
If we create a deep-copy of a Bounded Context, we have to rename all Aggregates, Modules, and domain objects. (to avoid validation errors regarding uniqueness)
-
adjustDomainObjectNames
public void adjustDomainObjectNames(java.util.List<SimpleDomainObject> domainObjects, java.lang.String suffix)
If we create a deep-copy of a Bounded Context, we have to rename all domain objects. (to avoid validation errors regarding uniqueness)
-
collectAllAggregateNames
public java.util.Set<java.lang.String> collectAllAggregateNames()
Collects all Aggregate names of the current model.
-
collectAggregates
public java.util.List<Aggregate> collectAggregates(BoundedContext bc)
Collects all Aggregates in the current CML model.
-
collectAllModuleNames
public java.util.Set<java.lang.String> collectAllModuleNames()
Collects all module names of the current CML model.
-
getUniqueName
public java.lang.String getUniqueName(java.lang.String initialName, java.util.Set<java.lang.String> givenNames)
Creates a unique name using a counter. Given a set of already existing domain object names, this method searches for a name that is not already used (simple method with counter as suffix).
-
-