org.eclipse.ocl.examples.pivot.utilities
Class PivotSaver
java.lang.Object
org.eclipse.ocl.examples.pivot.utilities.AbstractPivotSaver
org.eclipse.ocl.examples.pivot.utilities.PivotSaver
public class PivotSaver
- extends AbstractPivotSaver
PivotSaver ensures that all references to specialized types are terminated
by local copies of the specialization.
Nested Class Summary |
static class |
PivotSaver.LocateVisitor
LocateVisitor locates references to shared specializations, so that
local copies can be created and then replaced by the ResolveVisitor. |
static class |
PivotSaver.ResolveVisitor
ResolveVisitor converts references to shared specializations
to references to local copies. |
Constructor Summary |
PivotSaver(org.eclipse.emf.ecore.resource.Resource resource)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FACTORY
public static AbstractPivotSaver.Factory FACTORY
resource
protected final org.eclipse.emf.ecore.resource.Resource resource
PivotSaver
public PivotSaver(org.eclipse.emf.ecore.resource.Resource resource)
addSpecializingElement
public void addSpecializingElement(@NonNull
Element object)
- Specified by:
addSpecializingElement
in class AbstractPivotSaver
addSpecializingElement
public boolean addSpecializingElement(@NonNull
Element object,
@NonNull
Operation referredOperation)
- Specified by:
addSpecializingElement
in class AbstractPivotSaver
addSpecializingElement
public boolean addSpecializingElement(@NonNull
Element object,
@NonNull
Type referredType)
- Specified by:
addSpecializingElement
in class AbstractPivotSaver
getOrphanPackage
protected Package getOrphanPackage(org.eclipse.emf.ecore.resource.Resource resource)
isOrphanOperation
protected boolean isOrphanOperation(Operation operation)
localizeSpecializations
public Package localizeSpecializations()
- Prepare a pivot resource for save by redirecting all type references to
specializations to local copies of the specializations.
locateSpecializations
protected void locateSpecializations(java.util.List<? extends org.eclipse.emf.ecore.EObject> eObjects)
resolveOperation
@NonNull
public <T extends Operation> T resolveOperation(@NonNull
T referredOperation)
- Return the resolved variant of referredType, which may require creation
of a local copy of a specialization.
- Specified by:
resolveOperation
in class AbstractPivotSaver
resolveType
@NonNull
public <T extends Type> T resolveType(@NonNull
T referredType)
- Return the resolved variant of referredType, which may require creation
of a local copy of a specialization.
- Specified by:
resolveType
in class AbstractPivotSaver