org.eclipse.ocl.examples.pivot.utilities
Class ASSaver

java.lang.Object
  extended by org.eclipse.ocl.examples.pivot.utilities.ASSaver

public class ASSaver
extends java.lang.Object

ASSaver ensures that all references to synthesized types are terminated by local copies of the synthesized types.


Field Summary
protected  org.eclipse.emf.ecore.resource.Resource resource
           
 
Constructor Summary
ASSaver(org.eclipse.emf.ecore.resource.Resource resource)
           
 
Method Summary
 void addSpecializingElement(Element object)
           
 boolean addSpecializingElement(Element object, Operation referredOperation)
           
 boolean addSpecializingElement(Element object, Type referredType)
           
protected  ASSaverLocateVisitor getLocateVisitor(org.eclipse.emf.ecore.EObject eObject)
           
protected  ASSaverNormalizeVisitor getNormalizeVisitor(org.eclipse.emf.ecore.EObject eObject)
           
protected  Type getOrphanClass(Package orphanagePackage)
           
protected  Package getOrphanPackage(org.eclipse.emf.ecore.resource.Resource resource)
           
protected  ASSaverResolveVisitor getResolveVisitor(org.eclipse.emf.ecore.EObject eObject)
           
protected  boolean isOrphanOperation(Operation operation)
           
protected  void loadOrphanage(org.eclipse.emf.ecore.resource.Resource resource)
           
 void localizeSpecializations()
          Prepare a pivot resource for save by redirecting all type references to specializations to local copies of the specializations.
protected  void locateSpecializations(java.util.List<? extends org.eclipse.emf.ecore.EObject> eObjects)
           
 void normalizeContents()
           
<T extends Operation>
T
resolveOperation(T referredOperation)
          Return the resolved variant of referredType, which may require creation of a local copy of a specialization.
<T extends Type>
T
resolveType(T referredType)
          Return the resolved variant of referredType, which may require creation of a local copy of a specialization.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

resource

@NonNull
protected final org.eclipse.emf.ecore.resource.Resource resource
Constructor Detail

ASSaver

public ASSaver(@NonNull
               org.eclipse.emf.ecore.resource.Resource resource)
Method Detail

addSpecializingElement

public void addSpecializingElement(@NonNull
                                   Element object)

addSpecializingElement

public boolean addSpecializingElement(@NonNull
                                      Element object,
                                      @NonNull
                                      Operation referredOperation)

addSpecializingElement

public boolean addSpecializingElement(@NonNull
                                      Element object,
                                      @NonNull
                                      Type referredType)

getLocateVisitor

@NonNull
protected ASSaverLocateVisitor getLocateVisitor(@NonNull
                                                        org.eclipse.emf.ecore.EObject eObject)

getNormalizeVisitor

@NonNull
protected ASSaverNormalizeVisitor getNormalizeVisitor(@NonNull
                                                              org.eclipse.emf.ecore.EObject eObject)

getOrphanClass

@NonNull
protected Type getOrphanClass(@NonNull
                                      Package orphanagePackage)

getOrphanPackage

@NonNull
protected Package getOrphanPackage(@NonNull
                                           org.eclipse.emf.ecore.resource.Resource resource)

getResolveVisitor

@NonNull
protected ASSaverResolveVisitor getResolveVisitor(@NonNull
                                                          org.eclipse.emf.ecore.EObject eObject)

isOrphanOperation

protected boolean isOrphanOperation(@NonNull
                                    Operation operation)

localizeSpecializations

public void localizeSpecializations()
Prepare a pivot resource for save by redirecting all type references to specializations to local copies of the specializations.


loadOrphanage

protected void loadOrphanage(@NonNull
                             org.eclipse.emf.ecore.resource.Resource resource)

locateSpecializations

protected void locateSpecializations(java.util.List<? extends org.eclipse.emf.ecore.EObject> eObjects)

normalizeContents

public void normalizeContents()

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.


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.