public class DeltaGenerator
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
DeltaGenerator.CompareException |
protected class |
DeltaGenerator.Context |
static class |
DeltaGenerator.Direction |
static class |
DeltaGenerator.EDataTypeComparator |
static class |
DeltaGenerator.EObjectComparator |
Modifier and Type | Field and Description |
---|---|
protected java.util.List |
addedEAnnotationLocations |
protected java.util.List |
addedLocations |
protected Adder |
adder |
protected java.util.List |
compositeDeltaStrategies |
protected java.util.List |
containmentReferenceAddDeltas |
protected DeltaGenerator.Context |
context |
protected java.util.List |
crossReferenceAddDeltas |
protected DeltaContainer |
deltaContainer |
protected DeltaGenerator.Direction |
direction |
protected FeatureFilter |
featureFilter |
protected org.eclipse.emf.common.notify.AdapterFactory |
itemLabelAdapterFactory |
protected com.ibm.xtools.comparemerge.emf.delta.deltagenerator.matcher.Matcher |
matcher |
protected java.util.List |
noncontainmentReferenceAddDeltas |
protected java.lang.String |
resourceType |
protected java.util.List |
separationReferenceDeltas |
protected java.util.Stack |
stack |
Constructor and Description |
---|
DeltaGenerator(java.lang.String resourceType,
com.ibm.xtools.comparemerge.emf.delta.deltagenerator.matcher.Matcher matcher,
org.eclipse.emf.common.notify.AdapterFactory itemLabelAdapterFactory)
Construct a delta generator with a new target and source resources.
|
Modifier and Type | Method and Description |
---|---|
void |
addAllCompositeStrategies(java.util.Collection newCompositeStrategies) |
boolean |
addCompositeStrategy(CompositeDeltaStrategy strategy) |
protected void |
addDelta(Delta delta) |
protected boolean |
comparable() |
void |
compare(org.eclipse.emf.ecore.EObject targetEObject,
org.eclipse.emf.ecore.EObject sourceEObject,
org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature)
Compare two eObject features.
|
void |
compare(org.eclipse.emf.ecore.EObject targetEObject,
org.eclipse.emf.ecore.EObject sourceEObject,
org.eclipse.emf.ecore.resource.Resource targetResource,
org.eclipse.emf.ecore.resource.Resource sourceResource)
This method assumes that targetEObject and sourceEObject
has the same matching id.
|
void |
compare(org.eclipse.emf.ecore.resource.Resource target,
org.eclipse.emf.ecore.resource.Resource source)
Compare two resources.
|
protected void |
compareAttribute()
Compare a many or single attribute.
|
protected void |
compareEContainer() |
protected void |
compareEListContainmentReference() |
protected void |
compareEListNoncontainmentReference() |
protected void |
compareEObjects() |
protected void |
compareEStructuralFeature() |
protected void |
compareEStructuralFeatures() |
protected void |
compareFeatureMap()
Compare a feature map attribute.
|
protected void |
compareManyAttribute()
Compare a many, unique or non-unique attribute.
|
protected void |
compareManyContainmentReference() |
protected void |
compareManyNoncontainmentReference() |
protected void |
compareManyNonuniqueAttribute()
Compare a many non-unique attribute, looking for adds and deletes.
|
protected void |
compareManyUniqueAttribute()
Compare a many, unique attribute looking for adds or deletes.
|
protected void |
compareMetaclass() |
protected void |
compareOrder() |
protected void |
compareReference() |
protected void |
compareResourceMove() |
protected void |
compareResourceOrder() |
protected void |
compareResources() |
protected void |
compareSingleAttribute()
Compare a single attribute, looking for changes.
|
protected void |
compareSingleContainmentReference() |
protected void |
compareSingleNoncontainmentReference() |
protected void |
copyAddedObjects(org.eclipse.emf.ecore.resource.Resource target) |
protected Adder |
createAdder(com.ibm.xtools.comparemerge.emf.delta.deltagenerator.matcher.Matcher matcher,
org.eclipse.emf.ecore.resource.Resource target,
org.eclipse.emf.ecore.resource.Resource source) |
protected void |
createAttributeListDelta()
Creates attribute add or delete delta based on compare direction.
|
protected ChangeDelta |
createChangeDelta() |
protected Location |
createContainmentLocation(org.eclipse.emf.ecore.resource.Resource resource,
java.lang.String objectId) |
protected void |
createContainmentMoveDelta() |
protected DeltaGenerator.Context |
createContext(DeltaGenerator.Context parent) |
protected void |
createCrossResourceChangeDelta() |
protected Location |
createCrossResourceReferenceLocation(org.eclipse.emf.ecore.resource.Resource resource,
org.eclipse.emf.ecore.resource.Resource sourceResource,
org.eclipse.emf.ecore.resource.Resource destinationResource,
org.eclipse.emf.ecore.EObject eContainer,
org.eclipse.emf.ecore.EReference reference,
java.lang.String objectId) |
protected DeltaContainer |
createDeltaContainer(org.eclipse.emf.ecore.resource.Resource target,
org.eclipse.emf.ecore.resource.Resource source,
com.ibm.xtools.comparemerge.emf.delta.deltagenerator.matcher.Matcher matcher) |
protected Location |
createEAnnotationLocation(org.eclipse.emf.ecore.resource.Resource resource,
org.eclipse.emf.ecore.EAnnotation eAnnotation,
java.lang.String eAnnotationSource,
org.eclipse.emf.ecore.EReference reference,
java.lang.String objectId) |
protected java.util.Iterator |
createFeatureIterator() |
com.ibm.xtools.comparemerge.emf.delta.deltagenerator.hierarchicalcompositestrategy.HierarchicalCompositeStrategyBuilder |
createHierarchicalCompositeStrategyBuilder() |
protected MorphDelta |
createMorphDelta() |
com.ibm.xtools.comparemerge.emf.delta.deltagenerator.prerequisites.PrerequisiteBuilder |
createPrerequisiteBuilder() |
protected void |
createReferenceListDelta() |
protected Location |
createReferenceLocation(org.eclipse.emf.ecore.resource.Resource resource,
org.eclipse.emf.ecore.EObject eContainer,
org.eclipse.emf.ecore.EReference reference,
java.lang.String objectId) |
protected void |
createReorderDelta() |
protected ListDelta |
createResourceListDelta() |
protected Location |
createResourceLocation(org.eclipse.emf.ecore.resource.Resource resource,
org.eclipse.emf.ecore.EObject eObject) |
protected void |
createResourceReorderDelta() |
protected Location |
createUniqueAttributeLocation(org.eclipse.emf.ecore.resource.Resource resource,
org.eclipse.emf.ecore.EObject eContainer,
org.eclipse.emf.ecore.EAttribute eAttribute,
int index,
java.lang.String serializedLocatedObject) |
protected boolean |
deltaObjectNeedsToBeAdded(AddDelta delta) |
protected boolean |
doesAncestorHaveDelta(java.lang.String objectId,
DeltaType type) |
protected void |
findFeatureMatch() |
protected java.lang.Object |
findMatchingObjectInEListContainmentReference() |
protected void |
generateComposites() |
protected Delta |
getAncestorDelta(java.lang.String objectId,
DeltaType type) |
protected java.util.List |
getAttributeIds(org.eclipse.emf.ecore.resource.Resource resource,
org.eclipse.emf.ecore.EObject container,
org.eclipse.emf.ecore.EAttribute attribute,
java.util.List objects,
java.util.Map idToObject) |
protected int |
getAttributeIndex(org.eclipse.emf.ecore.EObject container,
org.eclipse.emf.ecore.EAttribute attribute,
java.lang.Object object) |
protected java.util.List |
getContainmentIds(org.eclipse.emf.ecore.resource.Resource resource,
java.util.List objects,
java.util.Map idToObject) |
DeltaContainer |
getDeltaContainer()
Returns the generated deltas.
|
protected java.util.List |
getDisjointFeaturesForMorph(org.eclipse.emf.ecore.EClass class1,
org.eclipse.emf.ecore.EClass class2)
Return list of structural features, which exist in class1, but not in class2
|
protected java.util.Iterator |
getIterator(java.util.List list) |
protected java.util.List |
getNoncontainmentIds(org.eclipse.emf.ecore.resource.Resource resource,
org.eclipse.emf.ecore.EObject container,
org.eclipse.emf.ecore.EReference reference,
java.util.List objects,
java.util.Map idToObject) |
protected java.util.List |
getReferenceIds(org.eclipse.emf.ecore.resource.Resource resource,
org.eclipse.emf.ecore.EObject container,
org.eclipse.emf.ecore.EReference reference,
java.util.List objects,
java.util.Map idToObject) |
protected int |
getReferenceIndex(org.eclipse.emf.ecore.EObject eContainer,
org.eclipse.emf.ecore.EReference eReference) |
protected int |
getReferenceIndex(org.eclipse.emf.ecore.EObject eContainer,
org.eclipse.emf.ecore.EReference eReference,
org.eclipse.emf.ecore.EObject eObj) |
protected int |
getResourceIndex(org.eclipse.emf.ecore.resource.Resource resource,
org.eclipse.emf.ecore.EObject eObj) |
protected int |
getResourceIndex(org.eclipse.emf.ecore.resource.Resource resource,
java.util.List siblings,
org.eclipse.emf.ecore.EObject eObject) |
protected org.eclipse.emf.ecore.resource.Resource |
getResourcePhysicalResource(org.eclipse.emf.ecore.resource.Resource resource,
org.eclipse.emf.ecore.EObject eObj) |
protected void |
initialize(org.eclipse.emf.ecore.resource.Resource target,
org.eclipse.emf.ecore.resource.Resource source) |
protected boolean |
isEAnnotation(org.eclipse.emf.ecore.EObject eObject) |
boolean |
isIgnoreDeltaJoinAndSeparation() |
protected boolean |
isMetaclassCompatibleForMorph(org.eclipse.emf.ecore.EObject eObject1,
org.eclipse.emf.ecore.EObject eObject2)
Test for compatibility change in object's metaclasses.
|
protected boolean |
isOrdered()
Return whether or not the current feature is ordered.
|
protected boolean |
isProcessTransient(org.eclipse.emf.ecore.EStructuralFeature feature) |
protected DeltaGenerator.Context |
popContext() |
protected DeltaGenerator.Context |
pushContext() |
void |
setDirection(DeltaGenerator.Direction dir) |
void |
setFeatureFilter(FeatureFilter filter) |
void |
setIgnoreDeltaJoinAndSeparation(boolean ignoreDeltaJoinAndSeparation) |
protected boolean |
skipReferenceListDelta(org.eclipse.emf.ecore.EObject object) |
protected DeltaGenerator.Direction direction
protected java.lang.String resourceType
protected com.ibm.xtools.comparemerge.emf.delta.deltagenerator.matcher.Matcher matcher
protected org.eclipse.emf.common.notify.AdapterFactory itemLabelAdapterFactory
protected DeltaContainer deltaContainer
protected FeatureFilter featureFilter
protected java.util.List compositeDeltaStrategies
protected Adder adder
protected java.util.List containmentReferenceAddDeltas
protected java.util.List noncontainmentReferenceAddDeltas
protected java.util.List crossReferenceAddDeltas
protected java.util.List addedLocations
protected java.util.List addedEAnnotationLocations
protected java.util.Stack stack
protected DeltaGenerator.Context context
protected java.util.List separationReferenceDeltas
public DeltaGenerator(java.lang.String resourceType, com.ibm.xtools.comparemerge.emf.delta.deltagenerator.matcher.Matcher matcher, org.eclipse.emf.common.notify.AdapterFactory itemLabelAdapterFactory)
resourceType
- type of resourcesmatcher
- a matcherpublic boolean addCompositeStrategy(CompositeDeltaStrategy strategy)
public void addAllCompositeStrategies(java.util.Collection newCompositeStrategies)
protected DeltaGenerator.Context pushContext()
protected DeltaGenerator.Context createContext(DeltaGenerator.Context parent)
protected DeltaGenerator.Context popContext()
public void compare(org.eclipse.emf.ecore.resource.Resource target, org.eclipse.emf.ecore.resource.Resource source)
public void compare(org.eclipse.emf.ecore.EObject targetEObject, org.eclipse.emf.ecore.EObject sourceEObject, org.eclipse.emf.ecore.resource.Resource targetResource, org.eclipse.emf.ecore.resource.Resource sourceResource)
public void compare(org.eclipse.emf.ecore.EObject targetEObject, org.eclipse.emf.ecore.EObject sourceEObject, org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature)
protected void initialize(org.eclipse.emf.ecore.resource.Resource target, org.eclipse.emf.ecore.resource.Resource source)
protected Adder createAdder(com.ibm.xtools.comparemerge.emf.delta.deltagenerator.matcher.Matcher matcher, org.eclipse.emf.ecore.resource.Resource target, org.eclipse.emf.ecore.resource.Resource source)
protected DeltaContainer createDeltaContainer(org.eclipse.emf.ecore.resource.Resource target, org.eclipse.emf.ecore.resource.Resource source, com.ibm.xtools.comparemerge.emf.delta.deltagenerator.matcher.Matcher matcher)
public com.ibm.xtools.comparemerge.emf.delta.deltagenerator.prerequisites.PrerequisiteBuilder createPrerequisiteBuilder()
public com.ibm.xtools.comparemerge.emf.delta.deltagenerator.hierarchicalcompositestrategy.HierarchicalCompositeStrategyBuilder createHierarchicalCompositeStrategyBuilder()
protected void generateComposites()
protected void copyAddedObjects(org.eclipse.emf.ecore.resource.Resource target)
public DeltaContainer getDeltaContainer()
protected void addDelta(Delta delta)
protected boolean deltaObjectNeedsToBeAdded(AddDelta delta)
protected void compareResources()
protected void compareMetaclass()
protected boolean isMetaclassCompatibleForMorph(org.eclipse.emf.ecore.EObject eObject1, org.eclipse.emf.ecore.EObject eObject2)
eObject1
- - metaclass (eClass) of object1 in the contexteObject2
- - metaclass (eClass) of object2 in the contextprotected void compareResourceMove()
protected void compareEObjects()
protected boolean comparable()
protected void compareEContainer()
protected void compareEStructuralFeatures()
protected boolean isProcessTransient(org.eclipse.emf.ecore.EStructuralFeature feature)
protected java.util.Iterator createFeatureIterator()
public void setFeatureFilter(FeatureFilter filter)
protected void compareEStructuralFeature()
protected void compareReference()
protected void compareAttribute()
protected void compareManyContainmentReference()
protected void compareEListContainmentReference()
protected java.lang.Object findMatchingObjectInEListContainmentReference()
protected void compareSingleContainmentReference()
protected void compareManyNoncontainmentReference()
protected void compareEListNoncontainmentReference()
protected void compareSingleNoncontainmentReference()
protected void compareFeatureMap()
protected void findFeatureMatch()
protected void compareManyAttribute()
protected void compareManyUniqueAttribute()
protected void compareManyNonuniqueAttribute()
protected void compareSingleAttribute()
protected void compareOrder()
protected boolean isOrdered()
protected void compareResourceOrder()
protected java.util.List getReferenceIds(org.eclipse.emf.ecore.resource.Resource resource, org.eclipse.emf.ecore.EObject container, org.eclipse.emf.ecore.EReference reference, java.util.List objects, java.util.Map idToObject)
protected java.util.List getContainmentIds(org.eclipse.emf.ecore.resource.Resource resource, java.util.List objects, java.util.Map idToObject)
protected java.util.List getNoncontainmentIds(org.eclipse.emf.ecore.resource.Resource resource, org.eclipse.emf.ecore.EObject container, org.eclipse.emf.ecore.EReference reference, java.util.List objects, java.util.Map idToObject)
protected java.util.List getAttributeIds(org.eclipse.emf.ecore.resource.Resource resource, org.eclipse.emf.ecore.EObject container, org.eclipse.emf.ecore.EAttribute attribute, java.util.List objects, java.util.Map idToObject)
protected ListDelta createResourceListDelta()
protected void createCrossResourceChangeDelta()
protected void createReferenceListDelta()
protected boolean skipReferenceListDelta(org.eclipse.emf.ecore.EObject object)
protected boolean doesAncestorHaveDelta(java.lang.String objectId, DeltaType type)
protected void createAttributeListDelta()
protected void createContainmentMoveDelta()
protected void createReorderDelta()
protected void createResourceReorderDelta()
protected MorphDelta createMorphDelta()
protected java.util.List getDisjointFeaturesForMorph(org.eclipse.emf.ecore.EClass class1, org.eclipse.emf.ecore.EClass class2)
class1
- class2
- protected ChangeDelta createChangeDelta()
protected Location createResourceLocation(org.eclipse.emf.ecore.resource.Resource resource, org.eclipse.emf.ecore.EObject eObject)
protected Location createContainmentLocation(org.eclipse.emf.ecore.resource.Resource resource, java.lang.String objectId)
protected Location createReferenceLocation(org.eclipse.emf.ecore.resource.Resource resource, org.eclipse.emf.ecore.EObject eContainer, org.eclipse.emf.ecore.EReference reference, java.lang.String objectId)
protected Location createCrossResourceReferenceLocation(org.eclipse.emf.ecore.resource.Resource resource, org.eclipse.emf.ecore.resource.Resource sourceResource, org.eclipse.emf.ecore.resource.Resource destinationResource, org.eclipse.emf.ecore.EObject eContainer, org.eclipse.emf.ecore.EReference reference, java.lang.String objectId)
protected Location createEAnnotationLocation(org.eclipse.emf.ecore.resource.Resource resource, org.eclipse.emf.ecore.EAnnotation eAnnotation, java.lang.String eAnnotationSource, org.eclipse.emf.ecore.EReference reference, java.lang.String objectId)
protected Location createUniqueAttributeLocation(org.eclipse.emf.ecore.resource.Resource resource, org.eclipse.emf.ecore.EObject eContainer, org.eclipse.emf.ecore.EAttribute eAttribute, int index, java.lang.String serializedLocatedObject)
protected int getReferenceIndex(org.eclipse.emf.ecore.EObject eContainer, org.eclipse.emf.ecore.EReference eReference)
protected int getReferenceIndex(org.eclipse.emf.ecore.EObject eContainer, org.eclipse.emf.ecore.EReference eReference, org.eclipse.emf.ecore.EObject eObj)
protected int getResourceIndex(org.eclipse.emf.ecore.resource.Resource resource, java.util.List siblings, org.eclipse.emf.ecore.EObject eObject)
protected int getResourceIndex(org.eclipse.emf.ecore.resource.Resource resource, org.eclipse.emf.ecore.EObject eObj)
protected org.eclipse.emf.ecore.resource.Resource getResourcePhysicalResource(org.eclipse.emf.ecore.resource.Resource resource, org.eclipse.emf.ecore.EObject eObj)
protected int getAttributeIndex(org.eclipse.emf.ecore.EObject container, org.eclipse.emf.ecore.EAttribute attribute, java.lang.Object object)
public boolean isIgnoreDeltaJoinAndSeparation()
public void setIgnoreDeltaJoinAndSeparation(boolean ignoreDeltaJoinAndSeparation)
protected boolean isEAnnotation(org.eclipse.emf.ecore.EObject eObject)
protected java.util.Iterator getIterator(java.util.List list)
public final void setDirection(DeltaGenerator.Direction dir)