diff options
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo')
36 files changed, 13625 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/Change.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/Change.java new file mode 100644 index 0000000000..7492053477 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/Change.java @@ -0,0 +1,116 @@ +/** + */ +package org.eclipse.emf.cdo.evolution; + +import org.eclipse.emf.cdo.CDOObject; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EModelElement; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Change</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * </p> + * <ul> + * <li>{@link org.eclipse.emf.cdo.evolution.Change#getParent <em>Parent</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.Change#getChildren <em>Children</em>}</li> + * </ul> + * + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getChange() + * @model abstract="true" + * @extends CDOObject + * @generated + */ +public interface Change extends CDOObject +{ + /** + * Returns the value of the '<em><b>Parent</b></em>' container reference. + * It is bidirectional and its opposite is '{@link org.eclipse.emf.cdo.evolution.Change#getChildren <em>Children</em>}'. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Parent</em>' container reference isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Parent</em>' container reference. + * @see #setParent(Change) + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getChange_Parent() + * @see org.eclipse.emf.cdo.evolution.Change#getChildren + * @model opposite="children" resolveProxies="false" transient="false" + * @generated + */ + Change getParent(); + + /** + * Sets the value of the '{@link org.eclipse.emf.cdo.evolution.Change#getParent <em>Parent</em>}' container reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Parent</em>' container reference. + * @see #getParent() + * @generated + */ + void setParent(Change value); + + /** + * Returns the value of the '<em><b>Children</b></em>' containment reference list. + * The list contents are of type {@link org.eclipse.emf.cdo.evolution.Change}. + * It is bidirectional and its opposite is '{@link org.eclipse.emf.cdo.evolution.Change#getParent <em>Parent</em>}'. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Children</em>' containment reference list isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Children</em>' containment reference list. + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getChange_Children() + * @see org.eclipse.emf.cdo.evolution.Change#getParent + * @model opposite="parent" containment="true" + * @generated + */ + EList<Change> getChildren(); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model kind="operation" + * @generated + */ + ModelSet getOldModelSet(); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model kind="operation" + * @generated + */ + ModelSet getNewModelSet(); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model kind="operation" + * @generated + */ + ModelSetChange getModelSetChange(); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model + * @generated + */ + EModelElement getOldElementFor(EModelElement newElement); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model + * @generated + */ + EList<EModelElement> getNewElementsFor(EModelElement oldElement); + +} // Change diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/ChangeKind.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/ChangeKind.java new file mode 100644 index 0000000000..d77d774386 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/ChangeKind.java @@ -0,0 +1,330 @@ +/** + */ +package org.eclipse.emf.cdo.evolution; + +import org.eclipse.emf.common.util.Enumerator; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +/** + * <!-- begin-user-doc --> + * A representation of the literals of the enumeration '<em><b>Change Kind</b></em>', + * and utility methods for working with them. + * <!-- end-user-doc --> + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getChangeKind() + * @model + * @generated + */ +public enum ChangeKind implements Enumerator +{ + /** + * The '<em><b>NONE</b></em>' literal object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #NONE_VALUE + * @generated + * @ordered + */ + NONE(0, "NONE", "NONE"), + + /** + * The '<em><b>CHANGED</b></em>' literal object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #CHANGED_VALUE + * @generated + * @ordered + */ + CHANGED(1, "CHANGED", "CHANGED"), + /** + * The '<em><b>REMOVED</b></em>' literal object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #REMOVED_VALUE + * @generated + * @ordered + */ + REMOVED(2, "REMOVED", "REMOVED"), + /** + * The '<em><b>ADDED</b></em>' literal object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #ADDED_VALUE + * @generated + * @ordered + */ + ADDED(3, "ADDED", "ADDED"), + /** + * The '<em><b>COPIED</b></em>' literal object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #COPIED_VALUE + * @generated + * @ordered + */ + COPIED(4, "COPIED", "COPIED"), + /** + * The '<em><b>MOVED</b></em>' literal object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #MOVED_VALUE + * @generated + * @ordered + */ + MOVED(5, "MOVED", "MOVED"); + + /** + * The '<em><b>NONE</b></em>' literal value. + * <!-- begin-user-doc --> + * <p> + * If the meaning of '<em><b>NONE</b></em>' literal object isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @see #NONE + * @model + * @generated + * @ordered + */ + public static final int NONE_VALUE = 0; + + /** + * The '<em><b>CHANGED</b></em>' literal value. + * <!-- begin-user-doc --> + * <p> + * If the meaning of '<em><b>CHANGED</b></em>' literal object isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @see #CHANGED + * @model + * @generated + * @ordered + */ + public static final int CHANGED_VALUE = 1; + + /** + * The '<em><b>REMOVED</b></em>' literal value. + * <!-- begin-user-doc --> + * <p> + * If the meaning of '<em><b>REMOVED</b></em>' literal object isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @see #REMOVED + * @model + * @generated + * @ordered + */ + public static final int REMOVED_VALUE = 2; + + /** + * The '<em><b>ADDED</b></em>' literal value. + * <!-- begin-user-doc --> + * <p> + * If the meaning of '<em><b>ADDED</b></em>' literal object isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @see #ADDED + * @model + * @generated + * @ordered + */ + public static final int ADDED_VALUE = 3; + + /** + * The '<em><b>COPIED</b></em>' literal value. + * <!-- begin-user-doc --> + * <p> + * If the meaning of '<em><b>COPIED</b></em>' literal object isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @see #COPIED + * @model + * @generated + * @ordered + */ + public static final int COPIED_VALUE = 4; + + /** + * The '<em><b>MOVED</b></em>' literal value. + * <!-- begin-user-doc --> + * <p> + * If the meaning of '<em><b>MOVED</b></em>' literal object isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @see #MOVED + * @model + * @generated + * @ordered + */ + public static final int MOVED_VALUE = 5; + + /** + * An array of all the '<em><b>Change Kind</b></em>' enumerators. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private static final ChangeKind[] VALUES_ARRAY = new ChangeKind[] { NONE, CHANGED, REMOVED, ADDED, COPIED, MOVED, }; + + /** + * A public read-only list of all the '<em><b>Change Kind</b></em>' enumerators. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static final List<ChangeKind> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); + + /** + * Returns the '<em><b>Change Kind</b></em>' literal with the specified literal value. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param literal the literal. + * @return the matching enumerator or <code>null</code>. + * @generated + */ + public static ChangeKind get(String literal) + { + for (int i = 0; i < VALUES_ARRAY.length; ++i) + { + ChangeKind result = VALUES_ARRAY[i]; + if (result.toString().equals(literal)) + { + return result; + } + } + return null; + } + + /** + * Returns the '<em><b>Change Kind</b></em>' literal with the specified name. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param name the name. + * @return the matching enumerator or <code>null</code>. + * @generated + */ + public static ChangeKind getByName(String name) + { + for (int i = 0; i < VALUES_ARRAY.length; ++i) + { + ChangeKind result = VALUES_ARRAY[i]; + if (result.getName().equals(name)) + { + return result; + } + } + return null; + } + + /** + * Returns the '<em><b>Change Kind</b></em>' literal with the specified integer value. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the integer value. + * @return the matching enumerator or <code>null</code>. + * @generated + */ + public static ChangeKind get(int value) + { + switch (value) + { + case NONE_VALUE: + return NONE; + case CHANGED_VALUE: + return CHANGED; + case REMOVED_VALUE: + return REMOVED; + case ADDED_VALUE: + return ADDED; + case COPIED_VALUE: + return COPIED; + case MOVED_VALUE: + return MOVED; + } + return null; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private final int value; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private final String name; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private final String literal; + + /** + * Only this class can construct instances. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private ChangeKind(int value, String name, String literal) + { + this.value = value; + this.name = name; + this.literal = literal; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public int getValue() + { + return value; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String getName() + { + return name; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String getLiteral() + { + return literal; + } + + /** + * Returns the literal value of the enumerator, which is its string representation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public String toString() + { + return literal; + } + +} // ChangeKind diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/ElementChange.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/ElementChange.java new file mode 100644 index 0000000000..5daa1bf5a5 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/ElementChange.java @@ -0,0 +1,82 @@ +/** + */ +package org.eclipse.emf.cdo.evolution; + +import org.eclipse.emf.ecore.EModelElement; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Element Change</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * </p> + * <ul> + * <li>{@link org.eclipse.emf.cdo.evolution.ElementChange#getOldElement <em>Old Element</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.ElementChange#getNewElement <em>New Element</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.ElementChange#getKind <em>Kind</em>}</li> + * </ul> + * + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getElementChange() + * @model annotation="http://www.eclipse.org/emf/2002/Ecore constraints='FeaturePathIsKnown'" + * @generated + */ +public interface ElementChange extends Change +{ + /** + * Returns the value of the '<em><b>Old Element</b></em>' reference. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Old Element</em>' reference isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Old Element</em>' reference. + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getElementChange_OldElement() + * @model suppressedSetVisibility="true" + * @generated + */ + EModelElement getOldElement(); + + /** + * Returns the value of the '<em><b>New Element</b></em>' reference. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>New Element</em>' reference isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>New Element</em>' reference. + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getElementChange_NewElement() + * @model suppressedSetVisibility="true" + * @generated + */ + EModelElement getNewElement(); + + /** + * Returns the value of the '<em><b>Kind</b></em>' attribute. + * The literals are from the enumeration {@link org.eclipse.emf.cdo.evolution.ChangeKind}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Kind</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Kind</em>' attribute. + * @see org.eclipse.emf.cdo.evolution.ChangeKind + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getElementChange_Kind() + * @model suppressedSetVisibility="true" + * @generated + */ + ChangeKind getKind(); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model kind="operation" + * @generated + */ + EModelElement getElement(); + +} // ElementChange diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/Evolution.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/Evolution.java new file mode 100644 index 0000000000..528cbb50d5 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/Evolution.java @@ -0,0 +1,286 @@ +/** + */ +package org.eclipse.emf.cdo.evolution; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EPackage; + +import java.util.Map; +import java.util.Set; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Evolution</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * </p> + * <ul> + * <li>{@link org.eclipse.emf.cdo.evolution.Evolution#isUseEcorePackage <em>Use Ecore Package</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.Evolution#isUseEresourcePackage <em>Use Eresource Package</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.Evolution#isUseEtypesPackage <em>Use Etypes Package</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.Evolution#isUniqueNamespaces <em>Unique Namespaces</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.Evolution#getModels <em>Models</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.Evolution#getRootPackages <em>Root Packages</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.Evolution#getAllPackages <em>All Packages</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.Evolution#getMissingPackages <em>Missing Packages</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.Evolution#getReleases <em>Releases</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.Evolution#getOrderedReleases <em>Ordered Releases</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.Evolution#getLatestRelease <em>Latest Release</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.Evolution#getNextReleaseVersion <em>Next Release Version</em>}</li> + * </ul> + * + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getEvolution() + * @model annotation="http://www.eclipse.org/emf/2002/Ecore constraints='NotEmpty PackagesUnique NoMissingPackages IDsUnique'" + * @generated + */ +public interface Evolution extends ModelSet +{ + /** + * Returns the value of the '<em><b>Models</b></em>' containment reference list. + * The list contents are of type {@link org.eclipse.emf.cdo.evolution.Model}. + * It is bidirectional and its opposite is '{@link org.eclipse.emf.cdo.evolution.Model#getEvolution <em>Evolution</em>}'. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Models</em>' containment reference list isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Models</em>' containment reference list. + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getEvolution_Models() + * @see org.eclipse.emf.cdo.evolution.Model#getEvolution + * @model opposite="evolution" containment="true" + * @generated + */ + EList<Model> getModels(); + + /** + * Returns the value of the '<em><b>Use Ecore Package</b></em>' attribute. + * The default value is <code>"true"</code>. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Use Ecore Package</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Use Ecore Package</em>' attribute. + * @see #setUseEcorePackage(boolean) + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getEvolution_UseEcorePackage() + * @model default="true" + * @generated + */ + boolean isUseEcorePackage(); + + /** + * Sets the value of the '{@link org.eclipse.emf.cdo.evolution.Evolution#isUseEcorePackage <em>Use Ecore Package</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Use Ecore Package</em>' attribute. + * @see #isUseEcorePackage() + * @generated + */ + void setUseEcorePackage(boolean value); + + /** + * Returns the value of the '<em><b>Use Eresource Package</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Use Eresource Package</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Use Eresource Package</em>' attribute. + * @see #setUseEresourcePackage(boolean) + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getEvolution_UseEresourcePackage() + * @model + * @generated + */ + boolean isUseEresourcePackage(); + + /** + * Sets the value of the '{@link org.eclipse.emf.cdo.evolution.Evolution#isUseEresourcePackage <em>Use Eresource Package</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Use Eresource Package</em>' attribute. + * @see #isUseEresourcePackage() + * @generated + */ + void setUseEresourcePackage(boolean value); + + /** + * Returns the value of the '<em><b>Use Etypes Package</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Use Etypes Package</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Use Etypes Package</em>' attribute. + * @see #setUseEtypesPackage(boolean) + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getEvolution_UseEtypesPackage() + * @model + * @generated + */ + boolean isUseEtypesPackage(); + + /** + * Sets the value of the '{@link org.eclipse.emf.cdo.evolution.Evolution#isUseEtypesPackage <em>Use Etypes Package</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Use Etypes Package</em>' attribute. + * @see #isUseEtypesPackage() + * @generated + */ + void setUseEtypesPackage(boolean value); + + /** + * Returns the value of the '<em><b>Unique Namespaces</b></em>' attribute. + * The default value is <code>"true"</code>. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Unique Namespaces</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Unique Namespaces</em>' attribute. + * @see #setUniqueNamespaces(boolean) + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getEvolution_UniqueNamespaces() + * @model default="true" + * @generated + */ + boolean isUniqueNamespaces(); + + /** + * Sets the value of the '{@link org.eclipse.emf.cdo.evolution.Evolution#isUniqueNamespaces <em>Unique Namespaces</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Unique Namespaces</em>' attribute. + * @see #isUniqueNamespaces() + * @generated + */ + void setUniqueNamespaces(boolean value); + + /** + * Returns the value of the '<em><b>Root Packages</b></em>' reference list. + * The list contents are of type {@link org.eclipse.emf.ecore.EPackage}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Root Packages</em>' reference list isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Root Packages</em>' reference list. + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getEvolution_RootPackages() + * @model transient="true" changeable="false" volatile="true" derived="true" + * @generated + */ + EList<EPackage> getRootPackages(); + + /** + * Returns the value of the '<em><b>All Packages</b></em>' reference list. + * The list contents are of type {@link org.eclipse.emf.ecore.EPackage}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>All Packages</em>' reference list isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>All Packages</em>' reference list. + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getEvolution_AllPackages() + * @model transient="true" changeable="false" volatile="true" derived="true" + * @generated + */ + EList<EPackage> getAllPackages(); + + public Map<String, Set<EPackage>> getReleasedPackages(); + + /** + * Returns the value of the '<em><b>Releases</b></em>' containment reference list. + * The list contents are of type {@link org.eclipse.emf.cdo.evolution.Release}. + * It is bidirectional and its opposite is '{@link org.eclipse.emf.cdo.evolution.Release#getEvolution <em>Evolution</em>}'. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Releases</em>' containment reference list isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Releases</em>' containment reference list. + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getEvolution_Releases() + * @see org.eclipse.emf.cdo.evolution.Release#getEvolution + * @model opposite="evolution" containment="true" + * @generated + */ + EList<Release> getReleases(); + + /** + * Returns the value of the '<em><b>Ordered Releases</b></em>' reference list. + * The list contents are of type {@link org.eclipse.emf.cdo.evolution.Release}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Ordered Releases</em>' reference list isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Ordered Releases</em>' reference list. + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getEvolution_OrderedReleases() + * @model transient="true" changeable="false" volatile="true" derived="true" + * @generated + */ + EList<Release> getOrderedReleases(); + + /** + * Returns the value of the '<em><b>Latest Release</b></em>' reference. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Latest Release</em>' reference isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Latest Release</em>' reference. + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getEvolution_LatestRelease() + * @model transient="true" changeable="false" volatile="true" derived="true" + * @generated + */ + Release getLatestRelease(); + + /** + * Returns the value of the '<em><b>Next Release Version</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Next Release Version</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Next Release Version</em>' attribute. + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getEvolution_NextReleaseVersion() + * @model transient="true" changeable="false" volatile="true" derived="true" + * @generated + */ + int getNextReleaseVersion(); + + /** + * Returns the value of the '<em><b>Missing Packages</b></em>' reference list. + * The list contents are of type {@link org.eclipse.emf.ecore.EPackage}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Missing Packages</em>' reference list isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Missing Packages</em>' reference list. + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getEvolution_MissingPackages() + * @model transient="true" changeable="false" volatile="true" derived="true" + * @generated + */ + EList<EPackage> getMissingPackages(); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model + * @generated + */ + Release getRelease(int version); + +} // Evolution diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/EvolutionFactory.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/EvolutionFactory.java new file mode 100644 index 0000000000..90503ae4bc --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/EvolutionFactory.java @@ -0,0 +1,148 @@ +/** + */ +package org.eclipse.emf.cdo.evolution; + +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EFactory; +import org.eclipse.emf.ecore.EModelElement; +import org.eclipse.emf.ecore.EStructuralFeature; + +/** + * <!-- begin-user-doc --> + * The <b>Factory</b> for the model. + * It provides a create method for each non-abstract class of the model. + * <!-- end-user-doc --> + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage + * @generated + */ +public interface EvolutionFactory extends EFactory +{ + /** + * The singleton instance of the factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EvolutionFactory eINSTANCE = org.eclipse.emf.cdo.evolution.impl.EvolutionFactoryImpl.init(); + + /** + * Returns a new object of class '<em>Model</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return a new object of class '<em>Model</em>'. + * @generated + */ + Model createModel(); + + Model createModel(URI uri); + + /** + * Returns a new object of class '<em>Evolution</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return a new object of class '<em>Evolution</em>'. + * @generated + */ + Evolution createEvolution(); + + /** + * Returns a new object of class '<em>Release</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return a new object of class '<em>Release</em>'. + * @generated + */ + Release createRelease(); + + /** + * Returns a new object of class '<em>Model Set Change</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return a new object of class '<em>Model Set Change</em>'. + * @generated + */ + ModelSetChange createModelSetChange(); + + ModelSetChange createModelSetChange(ModelSet[] modelSetChain); + + /** + * Returns a new object of class '<em>Element Change</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return a new object of class '<em>Element Change</em>'. + * @generated + */ + ElementChange createElementChange(); + + ElementChange createElementChange(EModelElement oldElement, EModelElement newElement, ChangeKind kind); + + /** + * Returns a new object of class '<em>Property Change</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return a new object of class '<em>Property Change</em>'. + * @generated + */ + PropertyChange createPropertyChange(); + + /** + * Returns a new object of class '<em>Feature Path Migration</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return a new object of class '<em>Feature Path Migration</em>'. + * @generated + */ + FeaturePathMigration createFeaturePathMigration(); + + PropertyChange createPropertyChange(EStructuralFeature feature, Object oldValue, Object newValue); + + /** + * Returns an instance of data type '<em>Change Kind</em>' corresponding the given literal. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param literal a literal of the data type. + * @return a new instance value of the data type. + * @generated + */ + ChangeKind createChangeKind(String literal); + + /** + * Returns a literal representation of an instance of data type '<em>Change Kind</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param instanceValue an instance value of the data type. + * @return a literal representation of the instance value. + * @generated + */ + String convertChangeKind(ChangeKind instanceValue); + + /** + * Returns an instance of data type '<em>URI</em>' corresponding the given literal. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param literal a literal of the data type. + * @return a new instance value of the data type. + * @generated + */ + URI createURI(String literal); + + /** + * Returns a literal representation of an instance of data type '<em>URI</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param instanceValue an instance value of the data type. + * @return a literal representation of the instance value. + * @generated + */ + String convertURI(URI instanceValue); + + /** + * Returns the package supported by this factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the package supported by this factory. + * @generated + */ + EvolutionPackage getEvolutionPackage(); + +} // EvolutionFactory diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/EvolutionPackage.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/EvolutionPackage.java new file mode 100644 index 0000000000..3be6a2ddf1 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/EvolutionPackage.java @@ -0,0 +1,2761 @@ +/** + */ +package org.eclipse.emf.cdo.evolution; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EDataType; +import org.eclipse.emf.ecore.EEnum; +import org.eclipse.emf.ecore.EOperation; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +/** + * <!-- begin-user-doc --> + * The <b>Package</b> for the model. + * It contains accessors for the meta objects to represent + * <ul> + * <li>each class,</li> + * <li>each feature of each class,</li> + * <li>each operation of each class,</li> + * <li>each enum,</li> + * <li>and each data type</li> + * </ul> + * <!-- end-user-doc --> + * @see org.eclipse.emf.cdo.evolution.EvolutionFactory + * @model kind="package" + * @generated + */ +public interface EvolutionPackage extends EPackage +{ + /** + * The package name. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + String eNAME = "evolution"; + + /** + * The package namespace URI. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + String eNS_URI = "http://www.eclipse.org/emf/CDO/evolution/1.0.0"; + + /** + * The package namespace name. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + String eNS_PREFIX = "evolution"; + + /** + * The singleton instance of the package. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EvolutionPackage eINSTANCE = org.eclipse.emf.cdo.evolution.impl.EvolutionPackageImpl.init(); + + /** + * The meta object id for the '{@link org.eclipse.emf.cdo.evolution.impl.ModelSetImpl <em>Model Set</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.cdo.evolution.impl.ModelSetImpl + * @see org.eclipse.emf.cdo.evolution.impl.EvolutionPackageImpl#getModelSet() + * @generated + */ + int MODEL_SET = 0; + + /** + * The feature id for the '<em><b>Change</b></em>' containment reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL_SET__CHANGE = 0; + + /** + * The feature id for the '<em><b>Migrations</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL_SET__MIGRATIONS = 1; + + /** + * The number of structural features of the '<em>Model Set</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL_SET_FEATURE_COUNT = 2; + + /** + * The operation id for the '<em>Get Evolution</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL_SET___GET_EVOLUTION = 0; + + /** + * The operation id for the '<em>Get Version</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL_SET___GET_VERSION = 1; + + /** + * The operation id for the '<em>Get Previous Release</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL_SET___GET_PREVIOUS_RELEASE = 2; + + /** + * The operation id for the '<em>Get Root Packages</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL_SET___GET_ROOT_PACKAGES = 3; + + /** + * The operation id for the '<em>Get All Packages</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL_SET___GET_ALL_PACKAGES = 4; + + /** + * The operation id for the '<em>Contains Element</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL_SET___CONTAINS_ELEMENT__EMODELELEMENT = 5; + + /** + * The operation id for the '<em>Get Element</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL_SET___GET_ELEMENT__STRING = 6; + + /** + * The operation id for the '<em>Get Element ID</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL_SET___GET_ELEMENT_ID__EMODELELEMENT = 7; + + /** + * The operation id for the '<em>Get Element ID</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL_SET___GET_ELEMENT_ID__EMODELELEMENT_BOOLEAN = 8; + + /** + * The operation id for the '<em>Compare</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL_SET___COMPARE__MODELSET = 9; + + /** + * The operation id for the '<em>Get Migration</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL_SET___GET_MIGRATION__STRING = 10; + + /** + * The number of operations of the '<em>Model Set</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL_SET_OPERATION_COUNT = 11; + + /** + * The meta object id for the '{@link org.eclipse.emf.cdo.evolution.impl.ModelImpl <em>Model</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.cdo.evolution.impl.ModelImpl + * @see org.eclipse.emf.cdo.evolution.impl.EvolutionPackageImpl#getModel() + * @generated + */ + int MODEL = 1; + + /** + * The meta object id for the '{@link org.eclipse.emf.cdo.evolution.impl.EvolutionImpl <em>Evolution</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.cdo.evolution.impl.EvolutionImpl + * @see org.eclipse.emf.cdo.evolution.impl.EvolutionPackageImpl#getEvolution() + * @generated + */ + int EVOLUTION = 2; + + /** + * The feature id for the '<em><b>Evolution</b></em>' container reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL__EVOLUTION = 0; + + /** + * The feature id for the '<em><b>URI</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL__URI = 1; + + /** + * The feature id for the '<em><b>Root Package</b></em>' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL__ROOT_PACKAGE = 2; + + /** + * The feature id for the '<em><b>All Packages</b></em>' reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL__ALL_PACKAGES = 3; + + /** + * The feature id for the '<em><b>Referenced Packages</b></em>' reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL__REFERENCED_PACKAGES = 4; + + /** + * The feature id for the '<em><b>Missing Packages</b></em>' reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL__MISSING_PACKAGES = 5; + + /** + * The number of structural features of the '<em>Model</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL_FEATURE_COUNT = 6; + + /** + * The number of operations of the '<em>Model</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL_OPERATION_COUNT = 0; + + /** + * The feature id for the '<em><b>Change</b></em>' containment reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int EVOLUTION__CHANGE = MODEL_SET__CHANGE; + + /** + * The feature id for the '<em><b>Migrations</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int EVOLUTION__MIGRATIONS = MODEL_SET__MIGRATIONS; + + /** + * The feature id for the '<em><b>Use Ecore Package</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int EVOLUTION__USE_ECORE_PACKAGE = MODEL_SET_FEATURE_COUNT + 0; + + /** + * The feature id for the '<em><b>Use Eresource Package</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int EVOLUTION__USE_ERESOURCE_PACKAGE = MODEL_SET_FEATURE_COUNT + 1; + + /** + * The feature id for the '<em><b>Use Etypes Package</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int EVOLUTION__USE_ETYPES_PACKAGE = MODEL_SET_FEATURE_COUNT + 2; + + /** + * The feature id for the '<em><b>Unique Namespaces</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int EVOLUTION__UNIQUE_NAMESPACES = MODEL_SET_FEATURE_COUNT + 3; + + /** + * The feature id for the '<em><b>Models</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int EVOLUTION__MODELS = MODEL_SET_FEATURE_COUNT + 4; + + /** + * The feature id for the '<em><b>Root Packages</b></em>' reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int EVOLUTION__ROOT_PACKAGES = MODEL_SET_FEATURE_COUNT + 5; + + /** + * The feature id for the '<em><b>All Packages</b></em>' reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int EVOLUTION__ALL_PACKAGES = MODEL_SET_FEATURE_COUNT + 6; + + /** + * The feature id for the '<em><b>Missing Packages</b></em>' reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int EVOLUTION__MISSING_PACKAGES = MODEL_SET_FEATURE_COUNT + 7; + + /** + * The feature id for the '<em><b>Releases</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int EVOLUTION__RELEASES = MODEL_SET_FEATURE_COUNT + 8; + + /** + * The feature id for the '<em><b>Ordered Releases</b></em>' reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int EVOLUTION__ORDERED_RELEASES = MODEL_SET_FEATURE_COUNT + 9; + + /** + * The feature id for the '<em><b>Latest Release</b></em>' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int EVOLUTION__LATEST_RELEASE = MODEL_SET_FEATURE_COUNT + 10; + + /** + * The feature id for the '<em><b>Next Release Version</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int EVOLUTION__NEXT_RELEASE_VERSION = MODEL_SET_FEATURE_COUNT + 11; + + /** + * The number of structural features of the '<em>Evolution</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int EVOLUTION_FEATURE_COUNT = MODEL_SET_FEATURE_COUNT + 12; + + /** + * The operation id for the '<em>Get Evolution</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int EVOLUTION___GET_EVOLUTION = MODEL_SET___GET_EVOLUTION; + + /** + * The operation id for the '<em>Get Version</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int EVOLUTION___GET_VERSION = MODEL_SET___GET_VERSION; + + /** + * The operation id for the '<em>Get Previous Release</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int EVOLUTION___GET_PREVIOUS_RELEASE = MODEL_SET___GET_PREVIOUS_RELEASE; + + /** + * The operation id for the '<em>Get Root Packages</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int EVOLUTION___GET_ROOT_PACKAGES = MODEL_SET___GET_ROOT_PACKAGES; + + /** + * The operation id for the '<em>Get All Packages</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int EVOLUTION___GET_ALL_PACKAGES = MODEL_SET___GET_ALL_PACKAGES; + + /** + * The operation id for the '<em>Contains Element</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int EVOLUTION___CONTAINS_ELEMENT__EMODELELEMENT = MODEL_SET___CONTAINS_ELEMENT__EMODELELEMENT; + + /** + * The operation id for the '<em>Get Element</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int EVOLUTION___GET_ELEMENT__STRING = MODEL_SET___GET_ELEMENT__STRING; + + /** + * The operation id for the '<em>Get Element ID</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int EVOLUTION___GET_ELEMENT_ID__EMODELELEMENT = MODEL_SET___GET_ELEMENT_ID__EMODELELEMENT; + + /** + * The operation id for the '<em>Get Element ID</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int EVOLUTION___GET_ELEMENT_ID__EMODELELEMENT_BOOLEAN = MODEL_SET___GET_ELEMENT_ID__EMODELELEMENT_BOOLEAN; + + /** + * The operation id for the '<em>Compare</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int EVOLUTION___COMPARE__MODELSET = MODEL_SET___COMPARE__MODELSET; + + /** + * The operation id for the '<em>Get Migration</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int EVOLUTION___GET_MIGRATION__STRING = MODEL_SET___GET_MIGRATION__STRING; + + /** + * The operation id for the '<em>Get Release</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int EVOLUTION___GET_RELEASE__INT = MODEL_SET_OPERATION_COUNT + 0; + + /** + * The number of operations of the '<em>Evolution</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int EVOLUTION_OPERATION_COUNT = MODEL_SET_OPERATION_COUNT + 1; + + /** + * The meta object id for the '{@link org.eclipse.emf.cdo.evolution.impl.ReleaseImpl <em>Release</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.cdo.evolution.impl.ReleaseImpl + * @see org.eclipse.emf.cdo.evolution.impl.EvolutionPackageImpl#getRelease() + * @generated + */ + int RELEASE = 3; + + /** + * The feature id for the '<em><b>Change</b></em>' containment reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int RELEASE__CHANGE = MODEL_SET__CHANGE; + + /** + * The feature id for the '<em><b>Migrations</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int RELEASE__MIGRATIONS = MODEL_SET__MIGRATIONS; + + /** + * The feature id for the '<em><b>Evolution</b></em>' container reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int RELEASE__EVOLUTION = MODEL_SET_FEATURE_COUNT + 0; + + /** + * The feature id for the '<em><b>Version</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int RELEASE__VERSION = MODEL_SET_FEATURE_COUNT + 1; + + /** + * The feature id for the '<em><b>Date</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int RELEASE__DATE = MODEL_SET_FEATURE_COUNT + 2; + + /** + * The feature id for the '<em><b>Next Release</b></em>' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int RELEASE__NEXT_RELEASE = MODEL_SET_FEATURE_COUNT + 3; + + /** + * The feature id for the '<em><b>Previous Release</b></em>' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int RELEASE__PREVIOUS_RELEASE = MODEL_SET_FEATURE_COUNT + 4; + + /** + * The feature id for the '<em><b>Root Packages</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int RELEASE__ROOT_PACKAGES = MODEL_SET_FEATURE_COUNT + 5; + + /** + * The feature id for the '<em><b>All Packages</b></em>' reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int RELEASE__ALL_PACKAGES = MODEL_SET_FEATURE_COUNT + 6; + + /** + * The number of structural features of the '<em>Release</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int RELEASE_FEATURE_COUNT = MODEL_SET_FEATURE_COUNT + 7; + + /** + * The operation id for the '<em>Get Evolution</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int RELEASE___GET_EVOLUTION = MODEL_SET___GET_EVOLUTION; + + /** + * The operation id for the '<em>Get Version</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int RELEASE___GET_VERSION = MODEL_SET___GET_VERSION; + + /** + * The operation id for the '<em>Get Previous Release</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int RELEASE___GET_PREVIOUS_RELEASE = MODEL_SET___GET_PREVIOUS_RELEASE; + + /** + * The operation id for the '<em>Get Root Packages</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int RELEASE___GET_ROOT_PACKAGES = MODEL_SET___GET_ROOT_PACKAGES; + + /** + * The operation id for the '<em>Get All Packages</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int RELEASE___GET_ALL_PACKAGES = MODEL_SET___GET_ALL_PACKAGES; + + /** + * The operation id for the '<em>Contains Element</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int RELEASE___CONTAINS_ELEMENT__EMODELELEMENT = MODEL_SET___CONTAINS_ELEMENT__EMODELELEMENT; + + /** + * The operation id for the '<em>Get Element</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int RELEASE___GET_ELEMENT__STRING = MODEL_SET___GET_ELEMENT__STRING; + + /** + * The operation id for the '<em>Get Element ID</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int RELEASE___GET_ELEMENT_ID__EMODELELEMENT = MODEL_SET___GET_ELEMENT_ID__EMODELELEMENT; + + /** + * The operation id for the '<em>Get Element ID</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int RELEASE___GET_ELEMENT_ID__EMODELELEMENT_BOOLEAN = MODEL_SET___GET_ELEMENT_ID__EMODELELEMENT_BOOLEAN; + + /** + * The operation id for the '<em>Compare</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int RELEASE___COMPARE__MODELSET = MODEL_SET___COMPARE__MODELSET; + + /** + * The operation id for the '<em>Get Migration</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int RELEASE___GET_MIGRATION__STRING = MODEL_SET___GET_MIGRATION__STRING; + + /** + * The number of operations of the '<em>Release</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int RELEASE_OPERATION_COUNT = MODEL_SET_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.emf.cdo.evolution.impl.ChangeImpl <em>Change</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.cdo.evolution.impl.ChangeImpl + * @see org.eclipse.emf.cdo.evolution.impl.EvolutionPackageImpl#getChange() + * @generated + */ + int CHANGE = 4; + + /** + * The feature id for the '<em><b>Parent</b></em>' container reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int CHANGE__PARENT = 0; + + /** + * The feature id for the '<em><b>Children</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int CHANGE__CHILDREN = 1; + + /** + * The number of structural features of the '<em>Change</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int CHANGE_FEATURE_COUNT = 2; + + /** + * The operation id for the '<em>Get Model Set Change</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int CHANGE___GET_MODEL_SET_CHANGE = 0; + + /** + * The operation id for the '<em>Get Old Element For</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int CHANGE___GET_OLD_ELEMENT_FOR__EMODELELEMENT = 1; + + /** + * The operation id for the '<em>Get New Elements For</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int CHANGE___GET_NEW_ELEMENTS_FOR__EMODELELEMENT = 2; + + /** + * The operation id for the '<em>Get Old Model Set</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int CHANGE___GET_OLD_MODEL_SET = 3; + + /** + * The operation id for the '<em>Get New Model Set</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int CHANGE___GET_NEW_MODEL_SET = 4; + + /** + * The number of operations of the '<em>Change</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int CHANGE_OPERATION_COUNT = 5; + + /** + * The meta object id for the '{@link org.eclipse.emf.cdo.evolution.impl.ModelSetChangeImpl <em>Model Set Change</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.cdo.evolution.impl.ModelSetChangeImpl + * @see org.eclipse.emf.cdo.evolution.impl.EvolutionPackageImpl#getModelSetChange() + * @generated + */ + int MODEL_SET_CHANGE = 5; + + /** + * The feature id for the '<em><b>Parent</b></em>' container reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL_SET_CHANGE__PARENT = CHANGE__PARENT; + + /** + * The feature id for the '<em><b>Children</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL_SET_CHANGE__CHILDREN = CHANGE__CHILDREN; + + /** + * The feature id for the '<em><b>Old Model Set</b></em>' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL_SET_CHANGE__OLD_MODEL_SET = CHANGE_FEATURE_COUNT + 0; + + /** + * The feature id for the '<em><b>New Model Set</b></em>' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL_SET_CHANGE__NEW_MODEL_SET = CHANGE_FEATURE_COUNT + 1; + + /** + * The number of structural features of the '<em>Model Set Change</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL_SET_CHANGE_FEATURE_COUNT = CHANGE_FEATURE_COUNT + 2; + + /** + * The operation id for the '<em>Get Model Set Change</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL_SET_CHANGE___GET_MODEL_SET_CHANGE = CHANGE___GET_MODEL_SET_CHANGE; + + /** + * The operation id for the '<em>Get Old Element For</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL_SET_CHANGE___GET_OLD_ELEMENT_FOR__EMODELELEMENT = CHANGE___GET_OLD_ELEMENT_FOR__EMODELELEMENT; + + /** + * The operation id for the '<em>Get New Elements For</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL_SET_CHANGE___GET_NEW_ELEMENTS_FOR__EMODELELEMENT = CHANGE___GET_NEW_ELEMENTS_FOR__EMODELELEMENT; + + /** + * The operation id for the '<em>Get Old Model Set</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL_SET_CHANGE___GET_OLD_MODEL_SET = CHANGE___GET_OLD_MODEL_SET; + + /** + * The operation id for the '<em>Get New Model Set</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL_SET_CHANGE___GET_NEW_MODEL_SET = CHANGE___GET_NEW_MODEL_SET; + + /** + * The number of operations of the '<em>Model Set Change</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL_SET_CHANGE_OPERATION_COUNT = CHANGE_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.emf.cdo.evolution.impl.ElementChangeImpl <em>Element Change</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.cdo.evolution.impl.ElementChangeImpl + * @see org.eclipse.emf.cdo.evolution.impl.EvolutionPackageImpl#getElementChange() + * @generated + */ + int ELEMENT_CHANGE = 6; + + /** + * The feature id for the '<em><b>Parent</b></em>' container reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int ELEMENT_CHANGE__PARENT = CHANGE__PARENT; + + /** + * The feature id for the '<em><b>Children</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int ELEMENT_CHANGE__CHILDREN = CHANGE__CHILDREN; + + /** + * The feature id for the '<em><b>Old Element</b></em>' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int ELEMENT_CHANGE__OLD_ELEMENT = CHANGE_FEATURE_COUNT + 0; + + /** + * The feature id for the '<em><b>New Element</b></em>' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int ELEMENT_CHANGE__NEW_ELEMENT = CHANGE_FEATURE_COUNT + 1; + + /** + * The feature id for the '<em><b>Kind</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int ELEMENT_CHANGE__KIND = CHANGE_FEATURE_COUNT + 2; + + /** + * The number of structural features of the '<em>Element Change</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int ELEMENT_CHANGE_FEATURE_COUNT = CHANGE_FEATURE_COUNT + 3; + + /** + * The operation id for the '<em>Get Model Set Change</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int ELEMENT_CHANGE___GET_MODEL_SET_CHANGE = CHANGE___GET_MODEL_SET_CHANGE; + + /** + * The operation id for the '<em>Get Old Element For</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int ELEMENT_CHANGE___GET_OLD_ELEMENT_FOR__EMODELELEMENT = CHANGE___GET_OLD_ELEMENT_FOR__EMODELELEMENT; + + /** + * The operation id for the '<em>Get New Elements For</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int ELEMENT_CHANGE___GET_NEW_ELEMENTS_FOR__EMODELELEMENT = CHANGE___GET_NEW_ELEMENTS_FOR__EMODELELEMENT; + + /** + * The operation id for the '<em>Get Old Model Set</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int ELEMENT_CHANGE___GET_OLD_MODEL_SET = CHANGE___GET_OLD_MODEL_SET; + + /** + * The operation id for the '<em>Get New Model Set</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int ELEMENT_CHANGE___GET_NEW_MODEL_SET = CHANGE___GET_NEW_MODEL_SET; + + /** + * The operation id for the '<em>Get Element</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int ELEMENT_CHANGE___GET_ELEMENT = CHANGE_OPERATION_COUNT + 0; + + /** + * The number of operations of the '<em>Element Change</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int ELEMENT_CHANGE_OPERATION_COUNT = CHANGE_OPERATION_COUNT + 1; + + /** + * The meta object id for the '{@link org.eclipse.emf.cdo.evolution.impl.PropertyChangeImpl <em>Property Change</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.cdo.evolution.impl.PropertyChangeImpl + * @see org.eclipse.emf.cdo.evolution.impl.EvolutionPackageImpl#getPropertyChange() + * @generated + */ + int PROPERTY_CHANGE = 7; + + /** + * The feature id for the '<em><b>Parent</b></em>' container reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PROPERTY_CHANGE__PARENT = CHANGE__PARENT; + + /** + * The feature id for the '<em><b>Children</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PROPERTY_CHANGE__CHILDREN = CHANGE__CHILDREN; + + /** + * The feature id for the '<em><b>Feature</b></em>' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PROPERTY_CHANGE__FEATURE = CHANGE_FEATURE_COUNT + 0; + + /** + * The feature id for the '<em><b>Old Value</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PROPERTY_CHANGE__OLD_VALUE = CHANGE_FEATURE_COUNT + 1; + + /** + * The feature id for the '<em><b>New Value</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PROPERTY_CHANGE__NEW_VALUE = CHANGE_FEATURE_COUNT + 2; + + /** + * The feature id for the '<em><b>Kind</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PROPERTY_CHANGE__KIND = CHANGE_FEATURE_COUNT + 3; + + /** + * The number of structural features of the '<em>Property Change</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PROPERTY_CHANGE_FEATURE_COUNT = CHANGE_FEATURE_COUNT + 4; + + /** + * The operation id for the '<em>Get Model Set Change</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PROPERTY_CHANGE___GET_MODEL_SET_CHANGE = CHANGE___GET_MODEL_SET_CHANGE; + + /** + * The operation id for the '<em>Get Old Element For</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PROPERTY_CHANGE___GET_OLD_ELEMENT_FOR__EMODELELEMENT = CHANGE___GET_OLD_ELEMENT_FOR__EMODELELEMENT; + + /** + * The operation id for the '<em>Get New Elements For</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PROPERTY_CHANGE___GET_NEW_ELEMENTS_FOR__EMODELELEMENT = CHANGE___GET_NEW_ELEMENTS_FOR__EMODELELEMENT; + + /** + * The operation id for the '<em>Get Old Model Set</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PROPERTY_CHANGE___GET_OLD_MODEL_SET = CHANGE___GET_OLD_MODEL_SET; + + /** + * The operation id for the '<em>Get New Model Set</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PROPERTY_CHANGE___GET_NEW_MODEL_SET = CHANGE___GET_NEW_MODEL_SET; + + /** + * The number of operations of the '<em>Property Change</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PROPERTY_CHANGE_OPERATION_COUNT = CHANGE_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.emf.cdo.evolution.impl.MigrationImpl <em>Migration</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.cdo.evolution.impl.MigrationImpl + * @see org.eclipse.emf.cdo.evolution.impl.EvolutionPackageImpl#getMigration() + * @generated + */ + int MIGRATION = 8; + + /** + * The feature id for the '<em><b>Model Set</b></em>' container reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MIGRATION__MODEL_SET = 0; + + /** + * The feature id for the '<em><b>Diagnostic ID</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MIGRATION__DIAGNOSTIC_ID = 1; + + /** + * The number of structural features of the '<em>Migration</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MIGRATION_FEATURE_COUNT = 2; + + /** + * The number of operations of the '<em>Migration</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MIGRATION_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link org.eclipse.emf.cdo.evolution.impl.FeaturePathMigrationImpl <em>Feature Path Migration</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.cdo.evolution.impl.FeaturePathMigrationImpl + * @see org.eclipse.emf.cdo.evolution.impl.EvolutionPackageImpl#getFeaturePathMigration() + * @generated + */ + int FEATURE_PATH_MIGRATION = 9; + + /** + * The feature id for the '<em><b>Model Set</b></em>' container reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int FEATURE_PATH_MIGRATION__MODEL_SET = MIGRATION__MODEL_SET; + + /** + * The feature id for the '<em><b>Diagnostic ID</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int FEATURE_PATH_MIGRATION__DIAGNOSTIC_ID = MIGRATION__DIAGNOSTIC_ID; + + /** + * The feature id for the '<em><b>From Class</b></em>' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int FEATURE_PATH_MIGRATION__FROM_CLASS = MIGRATION_FEATURE_COUNT + 0; + + /** + * The feature id for the '<em><b>To Class</b></em>' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int FEATURE_PATH_MIGRATION__TO_CLASS = MIGRATION_FEATURE_COUNT + 1; + + /** + * The feature id for the '<em><b>Feature Path</b></em>' reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int FEATURE_PATH_MIGRATION__FEATURE_PATH = MIGRATION_FEATURE_COUNT + 2; + + /** + * The number of structural features of the '<em>Feature Path Migration</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int FEATURE_PATH_MIGRATION_FEATURE_COUNT = MIGRATION_FEATURE_COUNT + 3; + + /** + * The number of operations of the '<em>Feature Path Migration</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int FEATURE_PATH_MIGRATION_OPERATION_COUNT = MIGRATION_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.emf.cdo.evolution.ChangeKind <em>Change Kind</em>}' enum. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.cdo.evolution.ChangeKind + * @see org.eclipse.emf.cdo.evolution.impl.EvolutionPackageImpl#getChangeKind() + * @generated + */ + int CHANGE_KIND = 10; + + /** + * The meta object id for the '<em>URI</em>' data type. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.common.util.URI + * @see org.eclipse.emf.cdo.evolution.impl.EvolutionPackageImpl#getURI() + * @generated + */ + int URI = 11; + + /** + * Returns the meta object for class '{@link org.eclipse.emf.cdo.evolution.ModelSet <em>Model Set</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Model Set</em>'. + * @see org.eclipse.emf.cdo.evolution.ModelSet + * @generated + */ + EClass getModelSet(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.emf.cdo.evolution.ModelSet#getChange <em>Change</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the containment reference '<em>Change</em>'. + * @see org.eclipse.emf.cdo.evolution.ModelSet#getChange() + * @see #getModelSet() + * @generated + */ + EReference getModelSet_Change(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.emf.cdo.evolution.ModelSet#getMigrations <em>Migrations</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the containment reference list '<em>Migrations</em>'. + * @see org.eclipse.emf.cdo.evolution.ModelSet#getMigrations() + * @see #getModelSet() + * @generated + */ + EReference getModelSet_Migrations(); + + /** + * Returns the meta object for the '{@link org.eclipse.emf.cdo.evolution.ModelSet#getEvolution() <em>Get Evolution</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the '<em>Get Evolution</em>' operation. + * @see org.eclipse.emf.cdo.evolution.ModelSet#getEvolution() + * @generated + */ + EOperation getModelSet__GetEvolution(); + + /** + * Returns the meta object for the '{@link org.eclipse.emf.cdo.evolution.ModelSet#getVersion() <em>Get Version</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the '<em>Get Version</em>' operation. + * @see org.eclipse.emf.cdo.evolution.ModelSet#getVersion() + * @generated + */ + EOperation getModelSet__GetVersion(); + + /** + * Returns the meta object for the '{@link org.eclipse.emf.cdo.evolution.ModelSet#getPreviousRelease() <em>Get Previous Release</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the '<em>Get Previous Release</em>' operation. + * @see org.eclipse.emf.cdo.evolution.ModelSet#getPreviousRelease() + * @generated + */ + EOperation getModelSet__GetPreviousRelease(); + + /** + * Returns the meta object for the '{@link org.eclipse.emf.cdo.evolution.ModelSet#getRootPackages() <em>Get Root Packages</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the '<em>Get Root Packages</em>' operation. + * @see org.eclipse.emf.cdo.evolution.ModelSet#getRootPackages() + * @generated + */ + EOperation getModelSet__GetRootPackages(); + + /** + * Returns the meta object for the '{@link org.eclipse.emf.cdo.evolution.ModelSet#getAllPackages() <em>Get All Packages</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the '<em>Get All Packages</em>' operation. + * @see org.eclipse.emf.cdo.evolution.ModelSet#getAllPackages() + * @generated + */ + EOperation getModelSet__GetAllPackages(); + + /** + * Returns the meta object for the '{@link org.eclipse.emf.cdo.evolution.ModelSet#containsElement(org.eclipse.emf.ecore.EModelElement) <em>Contains Element</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the '<em>Contains Element</em>' operation. + * @see org.eclipse.emf.cdo.evolution.ModelSet#containsElement(org.eclipse.emf.ecore.EModelElement) + * @generated + */ + EOperation getModelSet__ContainsElement__EModelElement(); + + /** + * Returns the meta object for the '{@link org.eclipse.emf.cdo.evolution.ModelSet#getElement(java.lang.String) <em>Get Element</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the '<em>Get Element</em>' operation. + * @see org.eclipse.emf.cdo.evolution.ModelSet#getElement(java.lang.String) + * @generated + */ + EOperation getModelSet__GetElement__String(); + + /** + * Returns the meta object for the '{@link org.eclipse.emf.cdo.evolution.ModelSet#getElementID(org.eclipse.emf.ecore.EModelElement) <em>Get Element ID</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the '<em>Get Element ID</em>' operation. + * @see org.eclipse.emf.cdo.evolution.ModelSet#getElementID(org.eclipse.emf.ecore.EModelElement) + * @generated + */ + EOperation getModelSet__GetElementID__EModelElement(); + + /** + * Returns the meta object for the '{@link org.eclipse.emf.cdo.evolution.ModelSet#getElementID(org.eclipse.emf.ecore.EModelElement, boolean) <em>Get Element ID</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the '<em>Get Element ID</em>' operation. + * @see org.eclipse.emf.cdo.evolution.ModelSet#getElementID(org.eclipse.emf.ecore.EModelElement, boolean) + * @generated + */ + EOperation getModelSet__GetElementID__EModelElement_boolean(); + + /** + * Returns the meta object for the '{@link org.eclipse.emf.cdo.evolution.ModelSet#compare(org.eclipse.emf.cdo.evolution.ModelSet) <em>Compare</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the '<em>Compare</em>' operation. + * @see org.eclipse.emf.cdo.evolution.ModelSet#compare(org.eclipse.emf.cdo.evolution.ModelSet) + * @generated + */ + EOperation getModelSet__Compare__ModelSet(); + + /** + * Returns the meta object for the '{@link org.eclipse.emf.cdo.evolution.ModelSet#getMigration(java.lang.String) <em>Get Migration</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the '<em>Get Migration</em>' operation. + * @see org.eclipse.emf.cdo.evolution.ModelSet#getMigration(java.lang.String) + * @generated + */ + EOperation getModelSet__GetMigration__String(); + + /** + * Returns the meta object for class '{@link org.eclipse.emf.cdo.evolution.Model <em>Model</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Model</em>'. + * @see org.eclipse.emf.cdo.evolution.Model + * @generated + */ + EClass getModel(); + + /** + * Returns the meta object for the container reference '{@link org.eclipse.emf.cdo.evolution.Model#getEvolution <em>Evolution</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the container reference '<em>Evolution</em>'. + * @see org.eclipse.emf.cdo.evolution.Model#getEvolution() + * @see #getModel() + * @generated + */ + EReference getModel_Evolution(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.evolution.Model#getURI <em>URI</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>URI</em>'. + * @see org.eclipse.emf.cdo.evolution.Model#getURI() + * @see #getModel() + * @generated + */ + EAttribute getModel_URI(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.emf.cdo.evolution.Model#getRootPackage <em>Root Package</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the reference '<em>Root Package</em>'. + * @see org.eclipse.emf.cdo.evolution.Model#getRootPackage() + * @see #getModel() + * @generated + */ + EReference getModel_RootPackage(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.emf.cdo.evolution.Model#getAllPackages <em>All Packages</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the reference list '<em>All Packages</em>'. + * @see org.eclipse.emf.cdo.evolution.Model#getAllPackages() + * @see #getModel() + * @generated + */ + EReference getModel_AllPackages(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.emf.cdo.evolution.Model#getReferencedPackages <em>Referenced Packages</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the reference list '<em>Referenced Packages</em>'. + * @see org.eclipse.emf.cdo.evolution.Model#getReferencedPackages() + * @see #getModel() + * @generated + */ + EReference getModel_ReferencedPackages(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.emf.cdo.evolution.Model#getMissingPackages <em>Missing Packages</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the reference list '<em>Missing Packages</em>'. + * @see org.eclipse.emf.cdo.evolution.Model#getMissingPackages() + * @see #getModel() + * @generated + */ + EReference getModel_MissingPackages(); + + /** + * Returns the meta object for class '{@link org.eclipse.emf.cdo.evolution.Evolution <em>Evolution</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Evolution</em>'. + * @see org.eclipse.emf.cdo.evolution.Evolution + * @generated + */ + EClass getEvolution(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.emf.cdo.evolution.Evolution#getModels <em>Models</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the containment reference list '<em>Models</em>'. + * @see org.eclipse.emf.cdo.evolution.Evolution#getModels() + * @see #getEvolution() + * @generated + */ + EReference getEvolution_Models(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.evolution.Evolution#isUseEcorePackage <em>Use Ecore Package</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Use Ecore Package</em>'. + * @see org.eclipse.emf.cdo.evolution.Evolution#isUseEcorePackage() + * @see #getEvolution() + * @generated + */ + EAttribute getEvolution_UseEcorePackage(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.evolution.Evolution#isUseEresourcePackage <em>Use Eresource Package</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Use Eresource Package</em>'. + * @see org.eclipse.emf.cdo.evolution.Evolution#isUseEresourcePackage() + * @see #getEvolution() + * @generated + */ + EAttribute getEvolution_UseEresourcePackage(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.evolution.Evolution#isUseEtypesPackage <em>Use Etypes Package</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Use Etypes Package</em>'. + * @see org.eclipse.emf.cdo.evolution.Evolution#isUseEtypesPackage() + * @see #getEvolution() + * @generated + */ + EAttribute getEvolution_UseEtypesPackage(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.evolution.Evolution#isUniqueNamespaces <em>Unique Namespaces</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Unique Namespaces</em>'. + * @see org.eclipse.emf.cdo.evolution.Evolution#isUniqueNamespaces() + * @see #getEvolution() + * @generated + */ + EAttribute getEvolution_UniqueNamespaces(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.emf.cdo.evolution.Evolution#getRootPackages <em>Root Packages</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the reference list '<em>Root Packages</em>'. + * @see org.eclipse.emf.cdo.evolution.Evolution#getRootPackages() + * @see #getEvolution() + * @generated + */ + EReference getEvolution_RootPackages(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.emf.cdo.evolution.Evolution#getAllPackages <em>All Packages</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the reference list '<em>All Packages</em>'. + * @see org.eclipse.emf.cdo.evolution.Evolution#getAllPackages() + * @see #getEvolution() + * @generated + */ + EReference getEvolution_AllPackages(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.emf.cdo.evolution.Evolution#getReleases <em>Releases</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the containment reference list '<em>Releases</em>'. + * @see org.eclipse.emf.cdo.evolution.Evolution#getReleases() + * @see #getEvolution() + * @generated + */ + EReference getEvolution_Releases(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.emf.cdo.evolution.Evolution#getOrderedReleases <em>Ordered Releases</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the reference list '<em>Ordered Releases</em>'. + * @see org.eclipse.emf.cdo.evolution.Evolution#getOrderedReleases() + * @see #getEvolution() + * @generated + */ + EReference getEvolution_OrderedReleases(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.emf.cdo.evolution.Evolution#getLatestRelease <em>Latest Release</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the reference '<em>Latest Release</em>'. + * @see org.eclipse.emf.cdo.evolution.Evolution#getLatestRelease() + * @see #getEvolution() + * @generated + */ + EReference getEvolution_LatestRelease(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.evolution.Evolution#getNextReleaseVersion <em>Next Release Version</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Next Release Version</em>'. + * @see org.eclipse.emf.cdo.evolution.Evolution#getNextReleaseVersion() + * @see #getEvolution() + * @generated + */ + EAttribute getEvolution_NextReleaseVersion(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.emf.cdo.evolution.Evolution#getMissingPackages <em>Missing Packages</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the reference list '<em>Missing Packages</em>'. + * @see org.eclipse.emf.cdo.evolution.Evolution#getMissingPackages() + * @see #getEvolution() + * @generated + */ + EReference getEvolution_MissingPackages(); + + /** + * Returns the meta object for the '{@link org.eclipse.emf.cdo.evolution.Evolution#getRelease(int) <em>Get Release</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the '<em>Get Release</em>' operation. + * @see org.eclipse.emf.cdo.evolution.Evolution#getRelease(int) + * @generated + */ + EOperation getEvolution__GetRelease__int(); + + /** + * Returns the meta object for class '{@link org.eclipse.emf.cdo.evolution.Release <em>Release</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Release</em>'. + * @see org.eclipse.emf.cdo.evolution.Release + * @generated + */ + EClass getRelease(); + + /** + * Returns the meta object for the container reference '{@link org.eclipse.emf.cdo.evolution.Release#getEvolution <em>Evolution</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the container reference '<em>Evolution</em>'. + * @see org.eclipse.emf.cdo.evolution.Release#getEvolution() + * @see #getRelease() + * @generated + */ + EReference getRelease_Evolution(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.evolution.Release#getDate <em>Date</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Date</em>'. + * @see org.eclipse.emf.cdo.evolution.Release#getDate() + * @see #getRelease() + * @generated + */ + EAttribute getRelease_Date(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.emf.cdo.evolution.Release#getNextRelease <em>Next Release</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the reference '<em>Next Release</em>'. + * @see org.eclipse.emf.cdo.evolution.Release#getNextRelease() + * @see #getRelease() + * @generated + */ + EReference getRelease_NextRelease(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.emf.cdo.evolution.Release#getPreviousRelease <em>Previous Release</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the reference '<em>Previous Release</em>'. + * @see org.eclipse.emf.cdo.evolution.Release#getPreviousRelease() + * @see #getRelease() + * @generated + */ + EReference getRelease_PreviousRelease(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.evolution.Release#getVersion <em>Version</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Version</em>'. + * @see org.eclipse.emf.cdo.evolution.Release#getVersion() + * @see #getRelease() + * @generated + */ + EAttribute getRelease_Version(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.emf.cdo.evolution.Release#getRootPackages <em>Root Packages</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the containment reference list '<em>Root Packages</em>'. + * @see org.eclipse.emf.cdo.evolution.Release#getRootPackages() + * @see #getRelease() + * @generated + */ + EReference getRelease_RootPackages(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.emf.cdo.evolution.Release#getAllPackages <em>All Packages</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the reference list '<em>All Packages</em>'. + * @see org.eclipse.emf.cdo.evolution.Release#getAllPackages() + * @see #getRelease() + * @generated + */ + EReference getRelease_AllPackages(); + + /** + * Returns the meta object for class '{@link org.eclipse.emf.cdo.evolution.Change <em>Change</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Change</em>'. + * @see org.eclipse.emf.cdo.evolution.Change + * @generated + */ + EClass getChange(); + + /** + * Returns the meta object for the container reference '{@link org.eclipse.emf.cdo.evolution.Change#getParent <em>Parent</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the container reference '<em>Parent</em>'. + * @see org.eclipse.emf.cdo.evolution.Change#getParent() + * @see #getChange() + * @generated + */ + EReference getChange_Parent(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.emf.cdo.evolution.Change#getChildren <em>Children</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the containment reference list '<em>Children</em>'. + * @see org.eclipse.emf.cdo.evolution.Change#getChildren() + * @see #getChange() + * @generated + */ + EReference getChange_Children(); + + /** + * Returns the meta object for the '{@link org.eclipse.emf.cdo.evolution.Change#getOldModelSet() <em>Get Old Model Set</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the '<em>Get Old Model Set</em>' operation. + * @see org.eclipse.emf.cdo.evolution.Change#getOldModelSet() + * @generated + */ + EOperation getChange__GetOldModelSet(); + + /** + * Returns the meta object for the '{@link org.eclipse.emf.cdo.evolution.Change#getNewModelSet() <em>Get New Model Set</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the '<em>Get New Model Set</em>' operation. + * @see org.eclipse.emf.cdo.evolution.Change#getNewModelSet() + * @generated + */ + EOperation getChange__GetNewModelSet(); + + /** + * Returns the meta object for the '{@link org.eclipse.emf.cdo.evolution.Change#getModelSetChange() <em>Get Model Set Change</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the '<em>Get Model Set Change</em>' operation. + * @see org.eclipse.emf.cdo.evolution.Change#getModelSetChange() + * @generated + */ + EOperation getChange__GetModelSetChange(); + + /** + * Returns the meta object for the '{@link org.eclipse.emf.cdo.evolution.Change#getOldElementFor(org.eclipse.emf.ecore.EModelElement) <em>Get Old Element For</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the '<em>Get Old Element For</em>' operation. + * @see org.eclipse.emf.cdo.evolution.Change#getOldElementFor(org.eclipse.emf.ecore.EModelElement) + * @generated + */ + EOperation getChange__GetOldElementFor__EModelElement(); + + /** + * Returns the meta object for the '{@link org.eclipse.emf.cdo.evolution.Change#getNewElementsFor(org.eclipse.emf.ecore.EModelElement) <em>Get New Elements For</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the '<em>Get New Elements For</em>' operation. + * @see org.eclipse.emf.cdo.evolution.Change#getNewElementsFor(org.eclipse.emf.ecore.EModelElement) + * @generated + */ + EOperation getChange__GetNewElementsFor__EModelElement(); + + /** + * Returns the meta object for class '{@link org.eclipse.emf.cdo.evolution.ModelSetChange <em>Model Set Change</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Model Set Change</em>'. + * @see org.eclipse.emf.cdo.evolution.ModelSetChange + * @generated + */ + EClass getModelSetChange(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.emf.cdo.evolution.ModelSetChange#getOldModelSet <em>Old Model Set</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the reference '<em>Old Model Set</em>'. + * @see org.eclipse.emf.cdo.evolution.ModelSetChange#getOldModelSet() + * @see #getModelSetChange() + * @generated + */ + EReference getModelSetChange_OldModelSet(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.emf.cdo.evolution.ModelSetChange#getNewModelSet <em>New Model Set</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the reference '<em>New Model Set</em>'. + * @see org.eclipse.emf.cdo.evolution.ModelSetChange#getNewModelSet() + * @see #getModelSetChange() + * @generated + */ + EReference getModelSetChange_NewModelSet(); + + /** + * Returns the meta object for class '{@link org.eclipse.emf.cdo.evolution.ElementChange <em>Element Change</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Element Change</em>'. + * @see org.eclipse.emf.cdo.evolution.ElementChange + * @generated + */ + EClass getElementChange(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.emf.cdo.evolution.ElementChange#getOldElement <em>Old Element</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the reference '<em>Old Element</em>'. + * @see org.eclipse.emf.cdo.evolution.ElementChange#getOldElement() + * @see #getElementChange() + * @generated + */ + EReference getElementChange_OldElement(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.emf.cdo.evolution.ElementChange#getNewElement <em>New Element</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the reference '<em>New Element</em>'. + * @see org.eclipse.emf.cdo.evolution.ElementChange#getNewElement() + * @see #getElementChange() + * @generated + */ + EReference getElementChange_NewElement(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.evolution.ElementChange#getKind <em>Kind</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Kind</em>'. + * @see org.eclipse.emf.cdo.evolution.ElementChange#getKind() + * @see #getElementChange() + * @generated + */ + EAttribute getElementChange_Kind(); + + /** + * Returns the meta object for the '{@link org.eclipse.emf.cdo.evolution.ElementChange#getElement() <em>Get Element</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the '<em>Get Element</em>' operation. + * @see org.eclipse.emf.cdo.evolution.ElementChange#getElement() + * @generated + */ + EOperation getElementChange__GetElement(); + + /** + * Returns the meta object for class '{@link org.eclipse.emf.cdo.evolution.PropertyChange <em>Property Change</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Property Change</em>'. + * @see org.eclipse.emf.cdo.evolution.PropertyChange + * @generated + */ + EClass getPropertyChange(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.emf.cdo.evolution.PropertyChange#getFeature <em>Feature</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the reference '<em>Feature</em>'. + * @see org.eclipse.emf.cdo.evolution.PropertyChange#getFeature() + * @see #getPropertyChange() + * @generated + */ + EReference getPropertyChange_Feature(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.evolution.PropertyChange#getOldValue <em>Old Value</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Old Value</em>'. + * @see org.eclipse.emf.cdo.evolution.PropertyChange#getOldValue() + * @see #getPropertyChange() + * @generated + */ + EAttribute getPropertyChange_OldValue(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.evolution.PropertyChange#getNewValue <em>New Value</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>New Value</em>'. + * @see org.eclipse.emf.cdo.evolution.PropertyChange#getNewValue() + * @see #getPropertyChange() + * @generated + */ + EAttribute getPropertyChange_NewValue(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.evolution.PropertyChange#getKind <em>Kind</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Kind</em>'. + * @see org.eclipse.emf.cdo.evolution.PropertyChange#getKind() + * @see #getPropertyChange() + * @generated + */ + EAttribute getPropertyChange_Kind(); + + /** + * Returns the meta object for class '{@link org.eclipse.emf.cdo.evolution.Migration <em>Migration</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Migration</em>'. + * @see org.eclipse.emf.cdo.evolution.Migration + * @generated + */ + EClass getMigration(); + + /** + * Returns the meta object for the container reference '{@link org.eclipse.emf.cdo.evolution.Migration#getModelSet <em>Model Set</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the container reference '<em>Model Set</em>'. + * @see org.eclipse.emf.cdo.evolution.Migration#getModelSet() + * @see #getMigration() + * @generated + */ + EReference getMigration_ModelSet(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.evolution.Migration#getDiagnosticID <em>Diagnostic ID</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Diagnostic ID</em>'. + * @see org.eclipse.emf.cdo.evolution.Migration#getDiagnosticID() + * @see #getMigration() + * @generated + */ + EAttribute getMigration_DiagnosticID(); + + /** + * Returns the meta object for class '{@link org.eclipse.emf.cdo.evolution.FeaturePathMigration <em>Feature Path Migration</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Feature Path Migration</em>'. + * @see org.eclipse.emf.cdo.evolution.FeaturePathMigration + * @generated + */ + EClass getFeaturePathMigration(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.emf.cdo.evolution.FeaturePathMigration#getFromClass <em>From Class</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the reference '<em>From Class</em>'. + * @see org.eclipse.emf.cdo.evolution.FeaturePathMigration#getFromClass() + * @see #getFeaturePathMigration() + * @generated + */ + EReference getFeaturePathMigration_FromClass(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.emf.cdo.evolution.FeaturePathMigration#getToClass <em>To Class</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the reference '<em>To Class</em>'. + * @see org.eclipse.emf.cdo.evolution.FeaturePathMigration#getToClass() + * @see #getFeaturePathMigration() + * @generated + */ + EReference getFeaturePathMigration_ToClass(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.emf.cdo.evolution.FeaturePathMigration#getFeaturePath <em>Feature Path</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the reference list '<em>Feature Path</em>'. + * @see org.eclipse.emf.cdo.evolution.FeaturePathMigration#getFeaturePath() + * @see #getFeaturePathMigration() + * @generated + */ + EReference getFeaturePathMigration_FeaturePath(); + + /** + * Returns the meta object for enum '{@link org.eclipse.emf.cdo.evolution.ChangeKind <em>Change Kind</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for enum '<em>Change Kind</em>'. + * @see org.eclipse.emf.cdo.evolution.ChangeKind + * @generated + */ + EEnum getChangeKind(); + + /** + * Returns the meta object for data type '{@link org.eclipse.emf.common.util.URI <em>URI</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for data type '<em>URI</em>'. + * @see org.eclipse.emf.common.util.URI + * @model instanceClass="org.eclipse.emf.common.util.URI" + * @generated + */ + EDataType getURI(); + + /** + * Returns the factory that creates the instances of the model. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the factory that creates the instances of the model. + * @generated + */ + EvolutionFactory getEvolutionFactory(); + + /** + * <!-- begin-user-doc --> + * Defines literals for the meta objects that represent + * <ul> + * <li>each class,</li> + * <li>each feature of each class,</li> + * <li>each operation of each class,</li> + * <li>each enum,</li> + * <li>and each data type</li> + * </ul> + * <!-- end-user-doc --> + * @generated + */ + interface Literals + { + /** + * The meta object literal for the '{@link org.eclipse.emf.cdo.evolution.impl.ModelSetImpl <em>Model Set</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.cdo.evolution.impl.ModelSetImpl + * @see org.eclipse.emf.cdo.evolution.impl.EvolutionPackageImpl#getModelSet() + * @generated + */ + EClass MODEL_SET = eINSTANCE.getModelSet(); + + /** + * The meta object literal for the '<em><b>Change</b></em>' containment reference feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference MODEL_SET__CHANGE = eINSTANCE.getModelSet_Change(); + + /** + * The meta object literal for the '<em><b>Migrations</b></em>' containment reference list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference MODEL_SET__MIGRATIONS = eINSTANCE.getModelSet_Migrations(); + + /** + * The meta object literal for the '<em><b>Get Evolution</b></em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EOperation MODEL_SET___GET_EVOLUTION = eINSTANCE.getModelSet__GetEvolution(); + + /** + * The meta object literal for the '<em><b>Get Version</b></em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EOperation MODEL_SET___GET_VERSION = eINSTANCE.getModelSet__GetVersion(); + + /** + * The meta object literal for the '<em><b>Get Previous Release</b></em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EOperation MODEL_SET___GET_PREVIOUS_RELEASE = eINSTANCE.getModelSet__GetPreviousRelease(); + + /** + * The meta object literal for the '<em><b>Get Root Packages</b></em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EOperation MODEL_SET___GET_ROOT_PACKAGES = eINSTANCE.getModelSet__GetRootPackages(); + + /** + * The meta object literal for the '<em><b>Get All Packages</b></em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EOperation MODEL_SET___GET_ALL_PACKAGES = eINSTANCE.getModelSet__GetAllPackages(); + + /** + * The meta object literal for the '<em><b>Contains Element</b></em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EOperation MODEL_SET___CONTAINS_ELEMENT__EMODELELEMENT = eINSTANCE.getModelSet__ContainsElement__EModelElement(); + + /** + * The meta object literal for the '<em><b>Get Element</b></em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EOperation MODEL_SET___GET_ELEMENT__STRING = eINSTANCE.getModelSet__GetElement__String(); + + /** + * The meta object literal for the '<em><b>Get Element ID</b></em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EOperation MODEL_SET___GET_ELEMENT_ID__EMODELELEMENT = eINSTANCE.getModelSet__GetElementID__EModelElement(); + + /** + * The meta object literal for the '<em><b>Get Element ID</b></em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EOperation MODEL_SET___GET_ELEMENT_ID__EMODELELEMENT_BOOLEAN = eINSTANCE.getModelSet__GetElementID__EModelElement_boolean(); + + /** + * The meta object literal for the '<em><b>Compare</b></em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EOperation MODEL_SET___COMPARE__MODELSET = eINSTANCE.getModelSet__Compare__ModelSet(); + + /** + * The meta object literal for the '<em><b>Get Migration</b></em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EOperation MODEL_SET___GET_MIGRATION__STRING = eINSTANCE.getModelSet__GetMigration__String(); + + /** + * The meta object literal for the '{@link org.eclipse.emf.cdo.evolution.impl.ModelImpl <em>Model</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.cdo.evolution.impl.ModelImpl + * @see org.eclipse.emf.cdo.evolution.impl.EvolutionPackageImpl#getModel() + * @generated + */ + EClass MODEL = eINSTANCE.getModel(); + + /** + * The meta object literal for the '<em><b>Evolution</b></em>' container reference feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference MODEL__EVOLUTION = eINSTANCE.getModel_Evolution(); + + /** + * The meta object literal for the '<em><b>URI</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute MODEL__URI = eINSTANCE.getModel_URI(); + + /** + * The meta object literal for the '<em><b>Root Package</b></em>' reference feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference MODEL__ROOT_PACKAGE = eINSTANCE.getModel_RootPackage(); + + /** + * The meta object literal for the '<em><b>All Packages</b></em>' reference list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference MODEL__ALL_PACKAGES = eINSTANCE.getModel_AllPackages(); + + /** + * The meta object literal for the '<em><b>Referenced Packages</b></em>' reference list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference MODEL__REFERENCED_PACKAGES = eINSTANCE.getModel_ReferencedPackages(); + + /** + * The meta object literal for the '<em><b>Missing Packages</b></em>' reference list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference MODEL__MISSING_PACKAGES = eINSTANCE.getModel_MissingPackages(); + + /** + * The meta object literal for the '{@link org.eclipse.emf.cdo.evolution.impl.EvolutionImpl <em>Evolution</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.cdo.evolution.impl.EvolutionImpl + * @see org.eclipse.emf.cdo.evolution.impl.EvolutionPackageImpl#getEvolution() + * @generated + */ + EClass EVOLUTION = eINSTANCE.getEvolution(); + + /** + * The meta object literal for the '<em><b>Models</b></em>' containment reference list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference EVOLUTION__MODELS = eINSTANCE.getEvolution_Models(); + + /** + * The meta object literal for the '<em><b>Use Ecore Package</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute EVOLUTION__USE_ECORE_PACKAGE = eINSTANCE.getEvolution_UseEcorePackage(); + + /** + * The meta object literal for the '<em><b>Use Eresource Package</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute EVOLUTION__USE_ERESOURCE_PACKAGE = eINSTANCE.getEvolution_UseEresourcePackage(); + + /** + * The meta object literal for the '<em><b>Use Etypes Package</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute EVOLUTION__USE_ETYPES_PACKAGE = eINSTANCE.getEvolution_UseEtypesPackage(); + + /** + * The meta object literal for the '<em><b>Unique Namespaces</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute EVOLUTION__UNIQUE_NAMESPACES = eINSTANCE.getEvolution_UniqueNamespaces(); + + /** + * The meta object literal for the '<em><b>Root Packages</b></em>' reference list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference EVOLUTION__ROOT_PACKAGES = eINSTANCE.getEvolution_RootPackages(); + + /** + * The meta object literal for the '<em><b>All Packages</b></em>' reference list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference EVOLUTION__ALL_PACKAGES = eINSTANCE.getEvolution_AllPackages(); + + /** + * The meta object literal for the '<em><b>Releases</b></em>' containment reference list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference EVOLUTION__RELEASES = eINSTANCE.getEvolution_Releases(); + + /** + * The meta object literal for the '<em><b>Ordered Releases</b></em>' reference list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference EVOLUTION__ORDERED_RELEASES = eINSTANCE.getEvolution_OrderedReleases(); + + /** + * The meta object literal for the '<em><b>Latest Release</b></em>' reference feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference EVOLUTION__LATEST_RELEASE = eINSTANCE.getEvolution_LatestRelease(); + + /** + * The meta object literal for the '<em><b>Next Release Version</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute EVOLUTION__NEXT_RELEASE_VERSION = eINSTANCE.getEvolution_NextReleaseVersion(); + + /** + * The meta object literal for the '<em><b>Missing Packages</b></em>' reference list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference EVOLUTION__MISSING_PACKAGES = eINSTANCE.getEvolution_MissingPackages(); + + /** + * The meta object literal for the '<em><b>Get Release</b></em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EOperation EVOLUTION___GET_RELEASE__INT = eINSTANCE.getEvolution__GetRelease__int(); + + /** + * The meta object literal for the '{@link org.eclipse.emf.cdo.evolution.impl.ReleaseImpl <em>Release</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.cdo.evolution.impl.ReleaseImpl + * @see org.eclipse.emf.cdo.evolution.impl.EvolutionPackageImpl#getRelease() + * @generated + */ + EClass RELEASE = eINSTANCE.getRelease(); + + /** + * The meta object literal for the '<em><b>Evolution</b></em>' container reference feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference RELEASE__EVOLUTION = eINSTANCE.getRelease_Evolution(); + + /** + * The meta object literal for the '<em><b>Date</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute RELEASE__DATE = eINSTANCE.getRelease_Date(); + + /** + * The meta object literal for the '<em><b>Next Release</b></em>' reference feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference RELEASE__NEXT_RELEASE = eINSTANCE.getRelease_NextRelease(); + + /** + * The meta object literal for the '<em><b>Previous Release</b></em>' reference feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference RELEASE__PREVIOUS_RELEASE = eINSTANCE.getRelease_PreviousRelease(); + + /** + * The meta object literal for the '<em><b>Version</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute RELEASE__VERSION = eINSTANCE.getRelease_Version(); + + /** + * The meta object literal for the '<em><b>Root Packages</b></em>' containment reference list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference RELEASE__ROOT_PACKAGES = eINSTANCE.getRelease_RootPackages(); + + /** + * The meta object literal for the '<em><b>All Packages</b></em>' reference list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference RELEASE__ALL_PACKAGES = eINSTANCE.getRelease_AllPackages(); + + /** + * The meta object literal for the '{@link org.eclipse.emf.cdo.evolution.impl.ChangeImpl <em>Change</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.cdo.evolution.impl.ChangeImpl + * @see org.eclipse.emf.cdo.evolution.impl.EvolutionPackageImpl#getChange() + * @generated + */ + EClass CHANGE = eINSTANCE.getChange(); + + /** + * The meta object literal for the '<em><b>Parent</b></em>' container reference feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference CHANGE__PARENT = eINSTANCE.getChange_Parent(); + + /** + * The meta object literal for the '<em><b>Children</b></em>' containment reference list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference CHANGE__CHILDREN = eINSTANCE.getChange_Children(); + + /** + * The meta object literal for the '<em><b>Get Old Model Set</b></em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EOperation CHANGE___GET_OLD_MODEL_SET = eINSTANCE.getChange__GetOldModelSet(); + + /** + * The meta object literal for the '<em><b>Get New Model Set</b></em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EOperation CHANGE___GET_NEW_MODEL_SET = eINSTANCE.getChange__GetNewModelSet(); + + /** + * The meta object literal for the '<em><b>Get Model Set Change</b></em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EOperation CHANGE___GET_MODEL_SET_CHANGE = eINSTANCE.getChange__GetModelSetChange(); + + /** + * The meta object literal for the '<em><b>Get Old Element For</b></em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EOperation CHANGE___GET_OLD_ELEMENT_FOR__EMODELELEMENT = eINSTANCE.getChange__GetOldElementFor__EModelElement(); + + /** + * The meta object literal for the '<em><b>Get New Elements For</b></em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EOperation CHANGE___GET_NEW_ELEMENTS_FOR__EMODELELEMENT = eINSTANCE.getChange__GetNewElementsFor__EModelElement(); + + /** + * The meta object literal for the '{@link org.eclipse.emf.cdo.evolution.impl.ModelSetChangeImpl <em>Model Set Change</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.cdo.evolution.impl.ModelSetChangeImpl + * @see org.eclipse.emf.cdo.evolution.impl.EvolutionPackageImpl#getModelSetChange() + * @generated + */ + EClass MODEL_SET_CHANGE = eINSTANCE.getModelSetChange(); + + /** + * The meta object literal for the '<em><b>Old Model Set</b></em>' reference feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference MODEL_SET_CHANGE__OLD_MODEL_SET = eINSTANCE.getModelSetChange_OldModelSet(); + + /** + * The meta object literal for the '<em><b>New Model Set</b></em>' reference feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference MODEL_SET_CHANGE__NEW_MODEL_SET = eINSTANCE.getModelSetChange_NewModelSet(); + + /** + * The meta object literal for the '{@link org.eclipse.emf.cdo.evolution.impl.ElementChangeImpl <em>Element Change</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.cdo.evolution.impl.ElementChangeImpl + * @see org.eclipse.emf.cdo.evolution.impl.EvolutionPackageImpl#getElementChange() + * @generated + */ + EClass ELEMENT_CHANGE = eINSTANCE.getElementChange(); + + /** + * The meta object literal for the '<em><b>Old Element</b></em>' reference feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference ELEMENT_CHANGE__OLD_ELEMENT = eINSTANCE.getElementChange_OldElement(); + + /** + * The meta object literal for the '<em><b>New Element</b></em>' reference feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference ELEMENT_CHANGE__NEW_ELEMENT = eINSTANCE.getElementChange_NewElement(); + + /** + * The meta object literal for the '<em><b>Kind</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute ELEMENT_CHANGE__KIND = eINSTANCE.getElementChange_Kind(); + + /** + * The meta object literal for the '<em><b>Get Element</b></em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EOperation ELEMENT_CHANGE___GET_ELEMENT = eINSTANCE.getElementChange__GetElement(); + + /** + * The meta object literal for the '{@link org.eclipse.emf.cdo.evolution.impl.PropertyChangeImpl <em>Property Change</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.cdo.evolution.impl.PropertyChangeImpl + * @see org.eclipse.emf.cdo.evolution.impl.EvolutionPackageImpl#getPropertyChange() + * @generated + */ + EClass PROPERTY_CHANGE = eINSTANCE.getPropertyChange(); + + /** + * The meta object literal for the '<em><b>Feature</b></em>' reference feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference PROPERTY_CHANGE__FEATURE = eINSTANCE.getPropertyChange_Feature(); + + /** + * The meta object literal for the '<em><b>Old Value</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute PROPERTY_CHANGE__OLD_VALUE = eINSTANCE.getPropertyChange_OldValue(); + + /** + * The meta object literal for the '<em><b>New Value</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute PROPERTY_CHANGE__NEW_VALUE = eINSTANCE.getPropertyChange_NewValue(); + + /** + * The meta object literal for the '<em><b>Kind</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute PROPERTY_CHANGE__KIND = eINSTANCE.getPropertyChange_Kind(); + + /** + * The meta object literal for the '{@link org.eclipse.emf.cdo.evolution.impl.MigrationImpl <em>Migration</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.cdo.evolution.impl.MigrationImpl + * @see org.eclipse.emf.cdo.evolution.impl.EvolutionPackageImpl#getMigration() + * @generated + */ + EClass MIGRATION = eINSTANCE.getMigration(); + + /** + * The meta object literal for the '<em><b>Model Set</b></em>' container reference feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference MIGRATION__MODEL_SET = eINSTANCE.getMigration_ModelSet(); + + /** + * The meta object literal for the '<em><b>Diagnostic ID</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute MIGRATION__DIAGNOSTIC_ID = eINSTANCE.getMigration_DiagnosticID(); + + /** + * The meta object literal for the '{@link org.eclipse.emf.cdo.evolution.impl.FeaturePathMigrationImpl <em>Feature Path Migration</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.cdo.evolution.impl.FeaturePathMigrationImpl + * @see org.eclipse.emf.cdo.evolution.impl.EvolutionPackageImpl#getFeaturePathMigration() + * @generated + */ + EClass FEATURE_PATH_MIGRATION = eINSTANCE.getFeaturePathMigration(); + + /** + * The meta object literal for the '<em><b>From Class</b></em>' reference feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference FEATURE_PATH_MIGRATION__FROM_CLASS = eINSTANCE.getFeaturePathMigration_FromClass(); + + /** + * The meta object literal for the '<em><b>To Class</b></em>' reference feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference FEATURE_PATH_MIGRATION__TO_CLASS = eINSTANCE.getFeaturePathMigration_ToClass(); + + /** + * The meta object literal for the '<em><b>Feature Path</b></em>' reference list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference FEATURE_PATH_MIGRATION__FEATURE_PATH = eINSTANCE.getFeaturePathMigration_FeaturePath(); + + /** + * The meta object literal for the '{@link org.eclipse.emf.cdo.evolution.ChangeKind <em>Change Kind</em>}' enum. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.cdo.evolution.ChangeKind + * @see org.eclipse.emf.cdo.evolution.impl.EvolutionPackageImpl#getChangeKind() + * @generated + */ + EEnum CHANGE_KIND = eINSTANCE.getChangeKind(); + + /** + * The meta object literal for the '<em>URI</em>' data type. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.common.util.URI + * @see org.eclipse.emf.cdo.evolution.impl.EvolutionPackageImpl#getURI() + * @generated + */ + EDataType URI = eINSTANCE.getURI(); + + } + +} // EvolutionPackage diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/FeaturePathMigration.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/FeaturePathMigration.java new file mode 100644 index 0000000000..857f6b9440 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/FeaturePathMigration.java @@ -0,0 +1,97 @@ +/** + */ +package org.eclipse.emf.cdo.evolution; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EReference; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Feature Path Migration</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * </p> + * <ul> + * <li>{@link org.eclipse.emf.cdo.evolution.FeaturePathMigration#getFromClass <em>From Class</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.FeaturePathMigration#getToClass <em>To Class</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.FeaturePathMigration#getFeaturePath <em>Feature Path</em>}</li> + * </ul> + * + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getFeaturePathMigration() + * @model annotation="http://www.eclipse.org/emf/2002/Ecore constraints='NewFeatureReachable'" + * @generated + */ +public interface FeaturePathMigration extends Migration +{ + /** + * Returns the value of the '<em><b>From Class</b></em>' reference. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>From Class</em>' reference isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>From Class</em>' reference. + * @see #setFromClass(EClass) + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getFeaturePathMigration_FromClass() + * @model required="true" + * @generated + */ + EClass getFromClass(); + + /** + * Sets the value of the '{@link org.eclipse.emf.cdo.evolution.FeaturePathMigration#getFromClass <em>From Class</em>}' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>From Class</em>' reference. + * @see #getFromClass() + * @generated + */ + void setFromClass(EClass value); + + /** + * Returns the value of the '<em><b>To Class</b></em>' reference. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>To Class</em>' reference isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>To Class</em>' reference. + * @see #setToClass(EClass) + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getFeaturePathMigration_ToClass() + * @model required="true" + * @generated + */ + EClass getToClass(); + + /** + * Sets the value of the '{@link org.eclipse.emf.cdo.evolution.FeaturePathMigration#getToClass <em>To Class</em>}' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>To Class</em>' reference. + * @see #getToClass() + * @generated + */ + void setToClass(EClass value); + + /** + * Returns the value of the '<em><b>Feature Path</b></em>' reference list. + * The list contents are of type {@link org.eclipse.emf.ecore.EReference}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Feature Path</em>' reference list isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Feature Path</em>' reference list. + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getFeaturePathMigration_FeaturePath() + * @model + * @generated + */ + EList<EReference> getFeaturePath(); + +} // FeaturePathMigration diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/Migration.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/Migration.java new file mode 100644 index 0000000000..6da9d95632 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/Migration.java @@ -0,0 +1,82 @@ +/** + */ +package org.eclipse.emf.cdo.evolution; + +import org.eclipse.emf.cdo.CDOObject; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Migration</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * </p> + * <ul> + * <li>{@link org.eclipse.emf.cdo.evolution.Migration#getModelSet <em>Model Set</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.Migration#getDiagnosticID <em>Diagnostic ID</em>}</li> + * </ul> + * + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getMigration() + * @model abstract="true" + * annotation="http://www.eclipse.org/emf/2002/Ecore constraints='NotObsolete'" + * @extends CDOObject + * @generated + */ +public interface Migration extends CDOObject +{ + /** + * Returns the value of the '<em><b>Model Set</b></em>' container reference. + * It is bidirectional and its opposite is '{@link org.eclipse.emf.cdo.evolution.ModelSet#getMigrations <em>Migrations</em>}'. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Model Set</em>' container reference isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Model Set</em>' container reference. + * @see #setModelSet(ModelSet) + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getMigration_ModelSet() + * @see org.eclipse.emf.cdo.evolution.ModelSet#getMigrations + * @model opposite="migrations" transient="false" + * @generated + */ + ModelSet getModelSet(); + + /** + * Sets the value of the '{@link org.eclipse.emf.cdo.evolution.Migration#getModelSet <em>Model Set</em>}' container reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Model Set</em>' container reference. + * @see #getModelSet() + * @generated + */ + void setModelSet(ModelSet value); + + /** + * Returns the value of the '<em><b>Diagnostic ID</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Diagnostic ID</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Diagnostic ID</em>' attribute. + * @see #setDiagnosticID(String) + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getMigration_DiagnosticID() + * @model + * @generated + */ + String getDiagnosticID(); + + /** + * Sets the value of the '{@link org.eclipse.emf.cdo.evolution.Migration#getDiagnosticID <em>Diagnostic ID</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Diagnostic ID</em>' attribute. + * @see #getDiagnosticID() + * @generated + */ + void setDiagnosticID(String value); + +} // Migration diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/Model.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/Model.java new file mode 100644 index 0000000000..77ad5c8e4e --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/Model.java @@ -0,0 +1,163 @@ +/** + */ +package org.eclipse.emf.cdo.evolution; + +import org.eclipse.emf.cdo.CDOObject; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EPackage; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Model</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * </p> + * <ul> + * <li>{@link org.eclipse.emf.cdo.evolution.Model#getEvolution <em>Evolution</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.Model#getURI <em>URI</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.Model#getRootPackage <em>Root Package</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.Model#getAllPackages <em>All Packages</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.Model#getReferencedPackages <em>Referenced Packages</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.Model#getMissingPackages <em>Missing Packages</em>}</li> + * </ul> + * + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getModel() + * @model annotation="http://www.eclipse.org/emf/2002/Ecore constraints='ModelLoaded IDs_Exist NamespaceReflectsChange'" + * @extends CDOObject + * @generated + */ +public interface Model extends CDOObject +{ + /** + * Returns the value of the '<em><b>Evolution</b></em>' container reference. + * It is bidirectional and its opposite is '{@link org.eclipse.emf.cdo.evolution.Evolution#getModels <em>Models</em>}'. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Evolution</em>' container reference isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Evolution</em>' container reference. + * @see #setEvolution(Evolution) + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getModel_Evolution() + * @see org.eclipse.emf.cdo.evolution.Evolution#getModels + * @model opposite="models" required="true" transient="false" + * @generated + */ + Evolution getEvolution(); + + /** + * Sets the value of the '{@link org.eclipse.emf.cdo.evolution.Model#getEvolution <em>Evolution</em>}' container reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Evolution</em>' container reference. + * @see #getEvolution() + * @generated + */ + void setEvolution(Evolution value); + + /** + * Returns the value of the '<em><b>URI</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>URI</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>URI</em>' attribute. + * @see #setURI(URI) + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getModel_URI() + * @model dataType="org.eclipse.emf.cdo.evolution.URI" + * extendedMetaData="kind='attribute' name='uri'" + * @generated + */ + URI getURI(); + + /** + * Sets the value of the '{@link org.eclipse.emf.cdo.evolution.Model#getURI <em>URI</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>URI</em>' attribute. + * @see #getURI() + * @generated + */ + void setURI(URI value); + + /** + * Returns the value of the '<em><b>Root Package</b></em>' reference. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Root Package</em>' reference isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Root Package</em>' reference. + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getModel_RootPackage() + * @model transient="true" changeable="false" volatile="true" derived="true" + * @generated + */ + EPackage getRootPackage(); + + /** + * Returns the value of the '<em><b>All Packages</b></em>' reference list. + * The list contents are of type {@link org.eclipse.emf.ecore.EPackage}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>All Packages</em>' reference list isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>All Packages</em>' reference list. + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getModel_AllPackages() + * @model transient="true" changeable="false" volatile="true" derived="true" + * @generated + */ + EList<EPackage> getAllPackages(); + + /** + * Returns the value of the '<em><b>Referenced Packages</b></em>' reference list. + * The list contents are of type {@link org.eclipse.emf.ecore.EPackage}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Referenced Packages</em>' reference list isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Referenced Packages</em>' reference list. + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getModel_ReferencedPackages() + * @model transient="true" changeable="false" volatile="true" derived="true" + * @generated + */ + EList<EPackage> getReferencedPackages(); + + /** + * Returns the value of the '<em><b>Missing Packages</b></em>' reference list. + * The list contents are of type {@link org.eclipse.emf.ecore.EPackage}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Missing Packages</em>' reference list isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Missing Packages</em>' reference list. + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getModel_MissingPackages() + * @model transient="true" changeable="false" volatile="true" derived="true" + * @generated + */ + EList<EPackage> getMissingPackages(); + + public ModelStatus getStatus(); + + /** + * @author Eike Stepper + */ + public enum ModelStatus + { + NO_URI, NO_RESOURCE_SET, RESOURCE_NOT_FOUND, LOAD_PROBLEM, CONTENT_PROBLEM, OK + } + +} // Model diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/ModelSet.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/ModelSet.java new file mode 100644 index 0000000000..9b4e61e5d5 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/ModelSet.java @@ -0,0 +1,163 @@ +/** + */ +package org.eclipse.emf.cdo.evolution; + +import org.eclipse.emf.cdo.CDOObject; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EModelElement; +import org.eclipse.emf.ecore.EPackage; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Model Set</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * </p> + * <ul> + * <li>{@link org.eclipse.emf.cdo.evolution.ModelSet#getChange <em>Change</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.ModelSet#getMigrations <em>Migrations</em>}</li> + * </ul> + * + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getModelSet() + * @model abstract="true" + * @extends CDOObject + * @generated + */ +public interface ModelSet extends CDOObject +{ + /** + * Returns the value of the '<em><b>Change</b></em>' containment reference. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Change</em>' reference isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Change</em>' containment reference. + * @see #isSetChange() + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getModelSet_Change() + * @model containment="true" unsettable="true" transient="true" derived="true" suppressedSetVisibility="true" suppressedUnsetVisibility="true" + * @generated + */ + ModelSetChange getChange(); + + /** + * Returns whether the value of the '{@link org.eclipse.emf.cdo.evolution.ModelSet#getChange <em>Change</em>}' containment reference is set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return whether the value of the '<em>Change</em>' containment reference is set. + * @see #getChange() + * @generated + */ + boolean isSetChange(); + + /** + * Returns the value of the '<em><b>Migrations</b></em>' containment reference list. + * The list contents are of type {@link org.eclipse.emf.cdo.evolution.Migration}. + * It is bidirectional and its opposite is '{@link org.eclipse.emf.cdo.evolution.Migration#getModelSet <em>Model Set</em>}'. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Migrations</em>' containment reference list isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Migrations</em>' containment reference list. + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getModelSet_Migrations() + * @see org.eclipse.emf.cdo.evolution.Migration#getModelSet + * @model opposite="modelSet" containment="true" + * @generated + */ + EList<Migration> getMigrations(); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model kind="operation" + * @generated + */ + Evolution getEvolution(); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model kind="operation" + * @generated + */ + int getVersion(); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model kind="operation" + * @generated + */ + Release getPreviousRelease(); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model kind="operation" + * @generated + */ + EList<EPackage> getRootPackages(); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model kind="operation" + * @generated + */ + EList<EPackage> getAllPackages(); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model + * @generated + */ + boolean containsElement(EModelElement modelElement); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model + * @generated + */ + <T extends EModelElement> T getElement(String id); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model + * @generated + */ + String getElementID(EModelElement modelElement); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model + * @generated + */ + String getElementID(EModelElement modelElement, boolean considerOldIDs); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model + * @generated + */ + ModelSetChange compare(ModelSet other); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model + * @generated + */ + Migration getMigration(String diagnosticID); + +} // ModelSet diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/ModelSetChange.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/ModelSetChange.java new file mode 100644 index 0000000000..d17c62092b --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/ModelSetChange.java @@ -0,0 +1,71 @@ +/** + */ +package org.eclipse.emf.cdo.evolution; + +import org.eclipse.emf.ecore.EModelElement; + +import java.util.Map; +import java.util.Set; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Model Set Change</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * </p> + * <ul> + * <li>{@link org.eclipse.emf.cdo.evolution.ModelSetChange#getOldModelSet <em>Old Model Set</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.ModelSetChange#getNewModelSet <em>New Model Set</em>}</li> + * </ul> + * + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getModelSetChange() + * @model + * @generated + */ +public interface ModelSetChange extends Change +{ + /** + * Returns the value of the '<em><b>Old Model Set</b></em>' reference. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Old Model Set</em>' reference isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Old Model Set</em>' reference. + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getModelSetChange_OldModelSet() + * @model suppressedSetVisibility="true" + * @generated + */ + ModelSet getOldModelSet(); + + /** + * Returns the value of the '<em><b>New Model Set</b></em>' reference. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>New Model Set</em>' reference isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>New Model Set</em>' reference. + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getModelSetChange_NewModelSet() + * @model suppressedSetVisibility="true" + * @generated + */ + ModelSet getNewModelSet(); + + ModelSet[] getModelSetChain(); + + Map<EModelElement, ElementChange> getElementChanges(); + + Map<EModelElement, EModelElement> getNewToOldElements(); + + Map<EModelElement, Set<EModelElement>> getOldToNewElements(); + + Set<EModelElement> getAddedElements(); + + Set<EModelElement> getRemovedElements(); + +} // ModelSetChange diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/PropertyChange.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/PropertyChange.java new file mode 100644 index 0000000000..7aab3eae4b --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/PropertyChange.java @@ -0,0 +1,90 @@ +/** + */ +package org.eclipse.emf.cdo.evolution; + +import org.eclipse.emf.ecore.EStructuralFeature; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Property Change</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * </p> + * <ul> + * <li>{@link org.eclipse.emf.cdo.evolution.PropertyChange#getFeature <em>Feature</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.PropertyChange#getOldValue <em>Old Value</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.PropertyChange#getNewValue <em>New Value</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.PropertyChange#getKind <em>Kind</em>}</li> + * </ul> + * + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getPropertyChange() + * @model + * @generated + */ +public interface PropertyChange extends Change +{ + /** + * Returns the value of the '<em><b>Feature</b></em>' reference. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Feature</em>' reference isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Feature</em>' reference. + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getPropertyChange_Feature() + * @model suppressedSetVisibility="true" + * @generated + */ + EStructuralFeature getFeature(); + + /** + * Returns the value of the '<em><b>Old Value</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Old Value</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Old Value</em>' attribute. + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getPropertyChange_OldValue() + * @model suppressedSetVisibility="true" + * @generated + */ + Object getOldValue(); + + /** + * Returns the value of the '<em><b>New Value</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>New Value</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>New Value</em>' attribute. + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getPropertyChange_NewValue() + * @model suppressedSetVisibility="true" + * @generated + */ + Object getNewValue(); + + /** + * Returns the value of the '<em><b>Kind</b></em>' attribute. + * The literals are from the enumeration {@link org.eclipse.emf.cdo.evolution.ChangeKind}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Kind</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Kind</em>' attribute. + * @see org.eclipse.emf.cdo.evolution.ChangeKind + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getPropertyChange_Kind() + * @model transient="true" changeable="false" volatile="true" derived="true" + * @generated + */ + ChangeKind getKind(); + +} // PropertyChange diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/Release.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/Release.java new file mode 100644 index 0000000000..ef07d0dfbb --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/Release.java @@ -0,0 +1,177 @@ +/** + */ +package org.eclipse.emf.cdo.evolution; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EPackage; + +import java.util.Date; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Release</b></em>'. + * @extends Comparable<Release> + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * </p> + * <ul> + * <li>{@link org.eclipse.emf.cdo.evolution.Release#getEvolution <em>Evolution</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.Release#getVersion <em>Version</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.Release#getDate <em>Date</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.Release#getNextRelease <em>Next Release</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.Release#getPreviousRelease <em>Previous Release</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.Release#getRootPackages <em>Root Packages</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.Release#getAllPackages <em>All Packages</em>}</li> + * </ul> + * + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getRelease() + * @model + * @generated + */ +public interface Release extends ModelSet, Comparable<Release> +{ + /** + * Returns the value of the '<em><b>Evolution</b></em>' container reference. + * It is bidirectional and its opposite is '{@link org.eclipse.emf.cdo.evolution.Evolution#getReleases <em>Releases</em>}'. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Evolution</em>' reference isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Evolution</em>' container reference. + * @see #setEvolution(Evolution) + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getRelease_Evolution() + * @see org.eclipse.emf.cdo.evolution.Evolution#getReleases + * @model opposite="releases" required="true" transient="false" + * @generated + */ + Evolution getEvolution(); + + /** + * Sets the value of the '{@link org.eclipse.emf.cdo.evolution.Release#getEvolution <em>Evolution</em>}' container reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Evolution</em>' container reference. + * @see #getEvolution() + * @generated + */ + void setEvolution(Evolution value); + + /** + * Returns the value of the '<em><b>Date</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Date</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Date</em>' attribute. + * @see #setDate(Date) + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getRelease_Date() + * @model required="true" + * @generated + */ + Date getDate(); + + /** + * Sets the value of the '{@link org.eclipse.emf.cdo.evolution.Release#getDate <em>Date</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Date</em>' attribute. + * @see #getDate() + * @generated + */ + void setDate(Date value); + + /** + * Returns the value of the '<em><b>Next Release</b></em>' reference. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Next Release</em>' reference isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Next Release</em>' reference. + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getRelease_NextRelease() + * @model transient="true" changeable="false" volatile="true" derived="true" + * @generated + */ + Release getNextRelease(); + + /** + * Returns the value of the '<em><b>Previous Release</b></em>' reference. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Previous Release</em>' reference isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Previous Release</em>' reference. + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getRelease_PreviousRelease() + * @model transient="true" changeable="false" volatile="true" derived="true" + * @generated + */ + Release getPreviousRelease(); + + /** + * Returns the value of the '<em><b>Version</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Version</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Version</em>' attribute. + * @see #setVersion(int) + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getRelease_Version() + * @model required="true" + * @generated + */ + int getVersion(); + + /** + * Sets the value of the '{@link org.eclipse.emf.cdo.evolution.Release#getVersion <em>Version</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Version</em>' attribute. + * @see #getVersion() + * @generated + */ + void setVersion(int value); + + /** + * Returns the value of the '<em><b>Root Packages</b></em>' containment reference list. + * The list contents are of type {@link org.eclipse.emf.ecore.EPackage}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Root Packages</em>' containment reference list isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Root Packages</em>' containment reference list. + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getRelease_RootPackages() + * @model containment="true" + * @generated + */ + EList<EPackage> getRootPackages(); + + /** + * Returns the value of the '<em><b>All Packages</b></em>' reference list. + * The list contents are of type {@link org.eclipse.emf.ecore.EPackage}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>All Packages</em>' reference list isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>All Packages</em>' reference list. + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#getRelease_AllPackages() + * @model transient="true" changeable="false" volatile="true" derived="true" + * @generated + */ + EList<EPackage> getAllPackages(); + +} // Release diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/ChangeImpl.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/ChangeImpl.java new file mode 100644 index 0000000000..eb877a9fc6 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/ChangeImpl.java @@ -0,0 +1,349 @@ +/** + */ +package org.eclipse.emf.cdo.evolution.impl; + +import org.eclipse.emf.cdo.evolution.Change; +import org.eclipse.emf.cdo.evolution.EvolutionPackage; +import org.eclipse.emf.cdo.evolution.ModelSet; +import org.eclipse.emf.cdo.evolution.ModelSetChange; + +import org.eclipse.emf.internal.cdo.CDOObjectImpl; + +import org.eclipse.emf.common.notify.NotificationChain; +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.ECollections; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EModelElement; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.util.InternalEList; + +import java.lang.reflect.InvocationTargetException; +import java.util.Collection; +import java.util.Set; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Change</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * </p> + * <ul> + * <li>{@link org.eclipse.emf.cdo.evolution.impl.ChangeImpl#getParent <em>Parent</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.impl.ChangeImpl#getChildren <em>Children</em>}</li> + * </ul> + * + * @generated + */ +public abstract class ChangeImpl extends CDOObjectImpl implements Change +{ + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected ChangeImpl() + { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() + { + return EvolutionPackage.Literals.CHANGE; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected int eStaticFeatureCount() + { + return 0; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public Change getParent() + { + return (Change)eDynamicGet(EvolutionPackage.CHANGE__PARENT, EvolutionPackage.Literals.CHANGE__PARENT, true, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public NotificationChain basicSetParent(Change newParent, NotificationChain msgs) + { + msgs = eBasicSetContainer((InternalEObject)newParent, EvolutionPackage.CHANGE__PARENT, msgs); + return msgs; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setParent(Change newParent) + { + eDynamicSet(EvolutionPackage.CHANGE__PARENT, EvolutionPackage.Literals.CHANGE__PARENT, newParent); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @SuppressWarnings("unchecked") + public EList<Change> getChildren() + { + return (EList<Change>)eDynamicGet(EvolutionPackage.CHANGE__CHILDREN, EvolutionPackage.Literals.CHANGE__CHILDREN, true, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + public abstract ModelSet getOldModelSet(); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + public abstract ModelSet getNewModelSet(); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + public ModelSetChange getModelSetChange() + { + Change parent = getParent(); + if (parent != null) + { + return parent.getModelSetChange(); + } + + return null; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + public EModelElement getOldElementFor(EModelElement newElement) + { + ModelSetChange modelSetChange = getModelSetChange(); + if (modelSetChange != null) + { + return modelSetChange.getNewToOldElements().get(newElement); + } + + return null; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + public EList<EModelElement> getNewElementsFor(EModelElement oldElement) + { + ModelSetChange modelSetChange = getModelSetChange(); + if (modelSetChange != null) + { + Set<EModelElement> newElements = modelSetChange.getOldToNewElements().get(oldElement); + if (newElements != null) + { + int size = newElements.size(); + if (size == 1) + { + return ECollections.singletonEList(newElements.iterator().next()); + } + + if (size > 1) + { + return new BasicEList<EModelElement>(newElements); + } + } + } + + return ECollections.emptyEList(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) + { + switch (featureID) + { + case EvolutionPackage.CHANGE__PARENT: + if (eInternalContainer() != null) + { + msgs = eBasicRemoveFromContainer(msgs); + } + return basicSetParent((Change)otherEnd, msgs); + case EvolutionPackage.CHANGE__CHILDREN: + return ((InternalEList<InternalEObject>)(InternalEList<?>)getChildren()).basicAdd(otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) + { + switch (featureID) + { + case EvolutionPackage.CHANGE__PARENT: + return basicSetParent(null, msgs); + case EvolutionPackage.CHANGE__CHILDREN: + return ((InternalEList<?>)getChildren()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) + { + switch (eContainerFeatureID()) + { + case EvolutionPackage.CHANGE__PARENT: + return eInternalContainer().eInverseRemove(this, EvolutionPackage.CHANGE__CHILDREN, Change.class, msgs); + } + return super.eBasicRemoveFromContainerFeature(msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) + { + switch (featureID) + { + case EvolutionPackage.CHANGE__PARENT: + return getParent(); + case EvolutionPackage.CHANGE__CHILDREN: + return getChildren(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) + { + switch (featureID) + { + case EvolutionPackage.CHANGE__PARENT: + setParent((Change)newValue); + return; + case EvolutionPackage.CHANGE__CHILDREN: + getChildren().clear(); + getChildren().addAll((Collection<? extends Change>)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) + { + switch (featureID) + { + case EvolutionPackage.CHANGE__PARENT: + setParent((Change)null); + return; + case EvolutionPackage.CHANGE__CHILDREN: + getChildren().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) + { + switch (featureID) + { + case EvolutionPackage.CHANGE__PARENT: + return getParent() != null; + case EvolutionPackage.CHANGE__CHILDREN: + return !getChildren().isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException + { + switch (operationID) + { + case EvolutionPackage.CHANGE___GET_MODEL_SET_CHANGE: + return getModelSetChange(); + case EvolutionPackage.CHANGE___GET_OLD_ELEMENT_FOR__EMODELELEMENT: + return getOldElementFor((EModelElement)arguments.get(0)); + case EvolutionPackage.CHANGE___GET_NEW_ELEMENTS_FOR__EMODELELEMENT: + return getNewElementsFor((EModelElement)arguments.get(0)); + case EvolutionPackage.CHANGE___GET_OLD_MODEL_SET: + return getOldModelSet(); + case EvolutionPackage.CHANGE___GET_NEW_MODEL_SET: + return getNewModelSet(); + } + return super.eInvoke(operationID, arguments); + } + +} // ChangeImpl diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/ElementChangeImpl.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/ElementChangeImpl.java new file mode 100644 index 0000000000..9789905356 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/ElementChangeImpl.java @@ -0,0 +1,317 @@ +/** + */ +package org.eclipse.emf.cdo.evolution.impl; + +import org.eclipse.emf.cdo.evolution.Change; +import org.eclipse.emf.cdo.evolution.ChangeKind; +import org.eclipse.emf.cdo.evolution.ElementChange; +import org.eclipse.emf.cdo.evolution.EvolutionPackage; +import org.eclipse.emf.cdo.evolution.ModelSet; +import org.eclipse.emf.cdo.evolution.util.DiagnosticID; +import org.eclipse.emf.cdo.evolution.util.IDAnnotation; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EModelElement; + +import java.lang.reflect.InvocationTargetException; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Element Change</b></em>'. + * @implements DiagnosticID.Provider + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * </p> + * <ul> + * <li>{@link org.eclipse.emf.cdo.evolution.impl.ElementChangeImpl#getOldElement <em>Old Element</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.impl.ElementChangeImpl#getNewElement <em>New Element</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.impl.ElementChangeImpl#getKind <em>Kind</em>}</li> + * </ul> + * + * @generated + */ +public class ElementChangeImpl extends ChangeImpl implements ElementChange, DiagnosticID.Provider +{ + /** + * The default value of the '{@link #getKind() <em>Kind</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getKind() + * @generated + * @ordered + */ + protected static final ChangeKind KIND_EDEFAULT = ChangeKind.NONE; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected ElementChangeImpl() + { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() + { + return EvolutionPackage.Literals.ELEMENT_CHANGE; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EModelElement getOldElement() + { + return (EModelElement)eDynamicGet(EvolutionPackage.ELEMENT_CHANGE__OLD_ELEMENT, EvolutionPackage.Literals.ELEMENT_CHANGE__OLD_ELEMENT, true, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EModelElement basicGetOldElement() + { + return (EModelElement)eDynamicGet(EvolutionPackage.ELEMENT_CHANGE__OLD_ELEMENT, EvolutionPackage.Literals.ELEMENT_CHANGE__OLD_ELEMENT, false, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setOldElement(EModelElement newOldElement) + { + eDynamicSet(EvolutionPackage.ELEMENT_CHANGE__OLD_ELEMENT, EvolutionPackage.Literals.ELEMENT_CHANGE__OLD_ELEMENT, newOldElement); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EModelElement getNewElement() + { + return (EModelElement)eDynamicGet(EvolutionPackage.ELEMENT_CHANGE__NEW_ELEMENT, EvolutionPackage.Literals.ELEMENT_CHANGE__NEW_ELEMENT, true, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EModelElement basicGetNewElement() + { + return (EModelElement)eDynamicGet(EvolutionPackage.ELEMENT_CHANGE__NEW_ELEMENT, EvolutionPackage.Literals.ELEMENT_CHANGE__NEW_ELEMENT, false, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setNewElement(EModelElement newNewElement) + { + eDynamicSet(EvolutionPackage.ELEMENT_CHANGE__NEW_ELEMENT, EvolutionPackage.Literals.ELEMENT_CHANGE__NEW_ELEMENT, newNewElement); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public ChangeKind getKind() + { + return (ChangeKind)eDynamicGet(EvolutionPackage.ELEMENT_CHANGE__KIND, EvolutionPackage.Literals.ELEMENT_CHANGE__KIND, true, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setKind(ChangeKind newKind) + { + eDynamicSet(EvolutionPackage.ELEMENT_CHANGE__KIND, EvolutionPackage.Literals.ELEMENT_CHANGE__KIND, newKind); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + public EModelElement getElement() + { + EModelElement element = getNewElement(); + if (element == null) + { + element = getOldElement(); + } + + return element; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) + { + switch (featureID) + { + case EvolutionPackage.ELEMENT_CHANGE__OLD_ELEMENT: + if (resolve) + { + return getOldElement(); + } + return basicGetOldElement(); + case EvolutionPackage.ELEMENT_CHANGE__NEW_ELEMENT: + if (resolve) + { + return getNewElement(); + } + return basicGetNewElement(); + case EvolutionPackage.ELEMENT_CHANGE__KIND: + return getKind(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) + { + switch (featureID) + { + case EvolutionPackage.ELEMENT_CHANGE__OLD_ELEMENT: + setOldElement((EModelElement)newValue); + return; + case EvolutionPackage.ELEMENT_CHANGE__NEW_ELEMENT: + setNewElement((EModelElement)newValue); + return; + case EvolutionPackage.ELEMENT_CHANGE__KIND: + setKind((ChangeKind)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) + { + switch (featureID) + { + case EvolutionPackage.ELEMENT_CHANGE__OLD_ELEMENT: + setOldElement((EModelElement)null); + return; + case EvolutionPackage.ELEMENT_CHANGE__NEW_ELEMENT: + setNewElement((EModelElement)null); + return; + case EvolutionPackage.ELEMENT_CHANGE__KIND: + setKind(KIND_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) + { + switch (featureID) + { + case EvolutionPackage.ELEMENT_CHANGE__OLD_ELEMENT: + return basicGetOldElement() != null; + case EvolutionPackage.ELEMENT_CHANGE__NEW_ELEMENT: + return basicGetNewElement() != null; + case EvolutionPackage.ELEMENT_CHANGE__KIND: + return getKind() != KIND_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException + { + switch (operationID) + { + case EvolutionPackage.ELEMENT_CHANGE___GET_ELEMENT: + return getElement(); + } + return super.eInvoke(operationID, arguments); + } + + @Override + public ModelSet getOldModelSet() + { + Change parent = getParent(); + if (parent != null) + { + return parent.getOldModelSet(); + } + + return null; + } + + @Override + public ModelSet getNewModelSet() + { + Change parent = getParent(); + if (parent != null) + { + return parent.getNewModelSet(); + } + + return null; + } + + public void extractDiagnosticData(Context context) + { + context.add("EC"); + + EModelElement newElement = getNewElement(); + if (newElement != null) + { + context.add(IDAnnotation.getValue(newElement)); + } + + EModelElement oldElement = getOldElement(); + if (oldElement != null) + { + context.add(IDAnnotation.getValue(oldElement)); + } + + context.add(getKind().getName()); + } + +} // ElementChangeImpl diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/EvolutionFactoryImpl.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/EvolutionFactoryImpl.java new file mode 100644 index 0000000000..f50c7c98ea --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/EvolutionFactoryImpl.java @@ -0,0 +1,352 @@ +/** + */ +package org.eclipse.emf.cdo.evolution.impl; + +import org.eclipse.emf.cdo.evolution.ChangeKind; +import org.eclipse.emf.cdo.evolution.ElementChange; +import org.eclipse.emf.cdo.evolution.Evolution; +import org.eclipse.emf.cdo.evolution.EvolutionFactory; +import org.eclipse.emf.cdo.evolution.EvolutionPackage; +import org.eclipse.emf.cdo.evolution.FeaturePathMigration; +import org.eclipse.emf.cdo.evolution.Model; +import org.eclipse.emf.cdo.evolution.ModelSet; +import org.eclipse.emf.cdo.evolution.ModelSetChange; +import org.eclipse.emf.cdo.evolution.PropertyChange; +import org.eclipse.emf.cdo.evolution.Release; + +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EDataType; +import org.eclipse.emf.ecore.EModelElement; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.ecore.impl.EFactoryImpl; +import org.eclipse.emf.ecore.plugin.EcorePlugin; + +/** + * <!-- begin-user-doc --> + * An implementation of the model <b>Factory</b>. + * <!-- end-user-doc --> + * @generated + */ +public class EvolutionFactoryImpl extends EFactoryImpl implements EvolutionFactory +{ + /** + * Creates the default factory implementation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static EvolutionFactory init() + { + try + { + EvolutionFactory theEvolutionFactory = (EvolutionFactory)EPackage.Registry.INSTANCE.getEFactory(EvolutionPackage.eNS_URI); + if (theEvolutionFactory != null) + { + return theEvolutionFactory; + } + } + catch (Exception exception) + { + EcorePlugin.INSTANCE.log(exception); + } + return new EvolutionFactoryImpl(); + } + + /** + * Creates an instance of the factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EvolutionFactoryImpl() + { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public EObject create(EClass eClass) + { + switch (eClass.getClassifierID()) + { + case EvolutionPackage.MODEL: + return createModel(); + case EvolutionPackage.EVOLUTION: + return createEvolution(); + case EvolutionPackage.RELEASE: + return createRelease(); + case EvolutionPackage.MODEL_SET_CHANGE: + return createModelSetChange(); + case EvolutionPackage.ELEMENT_CHANGE: + return createElementChange(); + case EvolutionPackage.PROPERTY_CHANGE: + return createPropertyChange(); + case EvolutionPackage.FEATURE_PATH_MIGRATION: + return createFeaturePathMigration(); + default: + throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); + } + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object createFromString(EDataType eDataType, String initialValue) + { + switch (eDataType.getClassifierID()) + { + case EvolutionPackage.CHANGE_KIND: + return createChangeKindFromString(eDataType, initialValue); + case EvolutionPackage.URI: + return createURIFromString(eDataType, initialValue); + default: + throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); + } + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public String convertToString(EDataType eDataType, Object instanceValue) + { + switch (eDataType.getClassifierID()) + { + case EvolutionPackage.CHANGE_KIND: + return convertChangeKindToString(eDataType, instanceValue); + case EvolutionPackage.URI: + return convertURIToString(eDataType, instanceValue); + default: + throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); + } + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public Model createModel() + { + ModelImpl model = new ModelImpl(); + return model; + } + + public Model createModel(URI uri) + { + ModelImpl model = new ModelImpl(); + model.setURI(uri); + return model; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public Evolution createEvolution() + { + EvolutionImpl evolution = new EvolutionImpl(); + return evolution; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public Release createRelease() + { + ReleaseImpl release = new ReleaseImpl(); + return release; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public ModelSetChange createModelSetChange() + { + ModelSetChangeImpl modelSetChange = new ModelSetChangeImpl(); + return modelSetChange; + } + + public ModelSetChange createModelSetChange(ModelSet[] modelSetChain) + { + ModelSetChangeImpl modelSetChange = new ModelSetChangeImpl(); + modelSetChange.setModelSetChain(modelSetChain); + return modelSetChange; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public ElementChange createElementChange() + { + ElementChangeImpl elementChange = new ElementChangeImpl(); + return elementChange; + } + + public ElementChange createElementChange(EModelElement oldElement, EModelElement newElement, ChangeKind kind) + { + ElementChangeImpl elementChange = new ElementChangeImpl(); + elementChange.setOldElement(oldElement); + elementChange.setNewElement(newElement); + elementChange.setKind(kind); + return elementChange; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public PropertyChange createPropertyChange() + { + PropertyChangeImpl propertyChange = new PropertyChangeImpl(); + return propertyChange; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public FeaturePathMigration createFeaturePathMigration() + { + FeaturePathMigrationImpl featurePathMigration = new FeaturePathMigrationImpl(); + return featurePathMigration; + } + + public PropertyChange createPropertyChange(EStructuralFeature feature, Object oldValue, Object newValue) + { + PropertyChangeImpl propertyChange = new PropertyChangeImpl(); + propertyChange.setFeature(feature); + propertyChange.setOldValue(oldValue); + propertyChange.setNewValue(newValue); + return propertyChange; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public ChangeKind createChangeKind(String literal) + { + ChangeKind result = ChangeKind.get(literal); + if (result == null) + { + throw new IllegalArgumentException("The value '" + literal + "' is not a valid enumerator of '" + EvolutionPackage.Literals.CHANGE_KIND.getName() + "'"); + } + return result; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public ChangeKind createChangeKindFromString(EDataType eDataType, String initialValue) + { + return createChangeKind(initialValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String convertChangeKind(ChangeKind instanceValue) + { + return instanceValue == null ? null : instanceValue.toString(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String convertChangeKindToString(EDataType eDataType, Object instanceValue) + { + return convertChangeKind((ChangeKind)instanceValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + public URI createURI(String literal) + { + return literal == null ? null : URI.createURI(literal); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + public URI createURIFromString(EDataType eDataType, String initialValue) + { + return initialValue == null ? null : URI.createURI(initialValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + public String convertURI(URI instanceValue) + { + return instanceValue == null ? null : instanceValue.toString(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + public String convertURIToString(EDataType eDataType, Object instanceValue) + { + return instanceValue == null ? null : instanceValue.toString(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EvolutionPackage getEvolutionPackage() + { + return (EvolutionPackage)getEPackage(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @deprecated + * @generated + */ + @Deprecated + public static EvolutionPackage getPackage() + { + return EvolutionPackage.eINSTANCE; + } + +} // EvolutionFactoryImpl diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/EvolutionImpl.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/EvolutionImpl.java new file mode 100644 index 0000000000..a4af9491d0 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/EvolutionImpl.java @@ -0,0 +1,691 @@ +/** + */ +package org.eclipse.emf.cdo.evolution.impl; + +import org.eclipse.emf.cdo.evolution.Evolution; +import org.eclipse.emf.cdo.evolution.EvolutionPackage; +import org.eclipse.emf.cdo.evolution.Model; +import org.eclipse.emf.cdo.evolution.Release; + +import org.eclipse.net4j.util.collection.CollectionUtil; + +import org.eclipse.emf.common.notify.NotificationChain; +import org.eclipse.emf.common.notify.Notifier; +import org.eclipse.emf.common.util.ECollections; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EModelElement; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.util.EcoreEList; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.emf.ecore.util.InternalEList; + +import java.lang.reflect.InvocationTargetException; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Evolution</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * </p> + * <ul> + * <li>{@link org.eclipse.emf.cdo.evolution.impl.EvolutionImpl#isUseEcorePackage <em>Use Ecore Package</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.impl.EvolutionImpl#isUseEresourcePackage <em>Use Eresource Package</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.impl.EvolutionImpl#isUseEtypesPackage <em>Use Etypes Package</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.impl.EvolutionImpl#isUniqueNamespaces <em>Unique Namespaces</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.impl.EvolutionImpl#getModels <em>Models</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.impl.EvolutionImpl#getRootPackages <em>Root Packages</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.impl.EvolutionImpl#getAllPackages <em>All Packages</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.impl.EvolutionImpl#getMissingPackages <em>Missing Packages</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.impl.EvolutionImpl#getReleases <em>Releases</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.impl.EvolutionImpl#getOrderedReleases <em>Ordered Releases</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.impl.EvolutionImpl#getLatestRelease <em>Latest Release</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.impl.EvolutionImpl#getNextReleaseVersion <em>Next Release Version</em>}</li> + * </ul> + * + * @generated + */ +public class EvolutionImpl extends ModelSetImpl implements Evolution +{ + /** + * The default value of the '{@link #isUseEcorePackage() <em>Use Ecore Package</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #isUseEcorePackage() + * @generated + * @ordered + */ + protected static final boolean USE_ECORE_PACKAGE_EDEFAULT = true; + + /** + * The default value of the '{@link #isUseEresourcePackage() <em>Use Eresource Package</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #isUseEresourcePackage() + * @generated + * @ordered + */ + protected static final boolean USE_ERESOURCE_PACKAGE_EDEFAULT = false; + + /** + * The default value of the '{@link #isUseEtypesPackage() <em>Use Etypes Package</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #isUseEtypesPackage() + * @generated + * @ordered + */ + protected static final boolean USE_ETYPES_PACKAGE_EDEFAULT = false; + + /** + * The default value of the '{@link #isUniqueNamespaces() <em>Unique Namespaces</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #isUniqueNamespaces() + * @generated + * @ordered + */ + protected static final boolean UNIQUE_NAMESPACES_EDEFAULT = true; + + /** + * The default value of the '{@link #getNextReleaseVersion() <em>Next Release Version</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getNextReleaseVersion() + * @generated + * @ordered + */ + protected static final int NEXT_RELEASE_VERSION_EDEFAULT = 0; + + private Map<String, Set<EPackage>> releasedPackages; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected EvolutionImpl() + { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() + { + return EvolutionPackage.Literals.EVOLUTION; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @SuppressWarnings("unchecked") + public EList<Model> getModels() + { + return (EList<Model>)eDynamicGet(EvolutionPackage.EVOLUTION__MODELS, EvolutionPackage.Literals.EVOLUTION__MODELS, true, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isUseEcorePackage() + { + return (Boolean)eDynamicGet(EvolutionPackage.EVOLUTION__USE_ECORE_PACKAGE, EvolutionPackage.Literals.EVOLUTION__USE_ECORE_PACKAGE, true, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setUseEcorePackage(boolean newUseEcorePackage) + { + eDynamicSet(EvolutionPackage.EVOLUTION__USE_ECORE_PACKAGE, EvolutionPackage.Literals.EVOLUTION__USE_ECORE_PACKAGE, newUseEcorePackage); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isUseEresourcePackage() + { + return (Boolean)eDynamicGet(EvolutionPackage.EVOLUTION__USE_ERESOURCE_PACKAGE, EvolutionPackage.Literals.EVOLUTION__USE_ERESOURCE_PACKAGE, true, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setUseEresourcePackage(boolean newUseEresourcePackage) + { + eDynamicSet(EvolutionPackage.EVOLUTION__USE_ERESOURCE_PACKAGE, EvolutionPackage.Literals.EVOLUTION__USE_ERESOURCE_PACKAGE, newUseEresourcePackage); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isUseEtypesPackage() + { + return (Boolean)eDynamicGet(EvolutionPackage.EVOLUTION__USE_ETYPES_PACKAGE, EvolutionPackage.Literals.EVOLUTION__USE_ETYPES_PACKAGE, true, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setUseEtypesPackage(boolean newUseEtypesPackage) + { + eDynamicSet(EvolutionPackage.EVOLUTION__USE_ETYPES_PACKAGE, EvolutionPackage.Literals.EVOLUTION__USE_ETYPES_PACKAGE, newUseEtypesPackage); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isUniqueNamespaces() + { + return (Boolean)eDynamicGet(EvolutionPackage.EVOLUTION__UNIQUE_NAMESPACES, EvolutionPackage.Literals.EVOLUTION__UNIQUE_NAMESPACES, true, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setUniqueNamespaces(boolean newUniqueNamespaces) + { + eDynamicSet(EvolutionPackage.EVOLUTION__UNIQUE_NAMESPACES, EvolutionPackage.Literals.EVOLUTION__UNIQUE_NAMESPACES, newUniqueNamespaces); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + @Override + public EList<EPackage> getRootPackages() + { + EcoreEList<EPackage> list = new EcoreEList<EPackage>(EPackage.class, this) + { + private static final long serialVersionUID = 1L; + + @Override + public int getFeatureID() + { + return EvolutionPackage.EVOLUTION__ROOT_PACKAGES; + } + }; + + for (Model model : getModels()) + { + EPackage rootPackage = model.getRootPackage(); + if (rootPackage != null) + { + list.add(rootPackage); + } + } + + return list; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + @Override + public EList<EPackage> getAllPackages() + { + EcoreEList<EPackage> list = new EcoreEList<EPackage>(EPackage.class, this) + { + private static final long serialVersionUID = 1L; + + @Override + public int getFeatureID() + { + return EvolutionPackage.EVOLUTION__ALL_PACKAGES; + } + }; + + for (Model model : getModels()) + { + list.addAll(model.getAllPackages()); + } + + return list; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + public EList<EPackage> getMissingPackages() + { + EcoreEList<EPackage> list = new EcoreEList<EPackage>(EPackage.class, this) + { + private static final long serialVersionUID = 1L; + + @Override + public int getFeatureID() + { + return EvolutionPackage.EVOLUTION__MISSING_PACKAGES; + } + }; + + Set<EPackage> set = new HashSet<EPackage>(); + for (Model model : getModels()) + { + set.addAll(model.getMissingPackages()); + } + + list.addAll(set); + return list; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + public Release getRelease(int version) + { + for (Release release : getReleases()) + { + if (release.getVersion() == version) + { + return release; + } + } + + return null; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @SuppressWarnings("unchecked") + public EList<Release> getReleases() + { + return (EList<Release>)eDynamicGet(EvolutionPackage.EVOLUTION__RELEASES, EvolutionPackage.Literals.EVOLUTION__RELEASES, true, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + public EList<Release> getOrderedReleases() + { + EcoreEList<Release> list = new EcoreEList<Release>(Release.class, this) + { + private static final long serialVersionUID = 1L; + + @Override + public int getFeatureID() + { + return EvolutionPackage.EVOLUTION__ORDERED_RELEASES; + } + }; + + list.addAll(getReleases()); + ECollections.sort(list); + return list; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public Release getLatestRelease() + { + Release latestRelease = basicGetLatestRelease(); + return latestRelease != null && ((EObject)latestRelease).eIsProxy() ? (Release)eResolveProxy((InternalEObject)latestRelease) : latestRelease; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + public Release basicGetLatestRelease() + { + EList<Release> orderedReleases = getOrderedReleases(); + if (orderedReleases.isEmpty()) + { + return null; + } + + return orderedReleases.get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + public int getNextReleaseVersion() + { + Release latestRelease = getLatestRelease(); + return latestRelease == null ? 1 : latestRelease.getVersion() + 1; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) + { + switch (featureID) + { + case EvolutionPackage.EVOLUTION__MODELS: + return ((InternalEList<InternalEObject>)(InternalEList<?>)getModels()).basicAdd(otherEnd, msgs); + case EvolutionPackage.EVOLUTION__RELEASES: + return ((InternalEList<InternalEObject>)(InternalEList<?>)getReleases()).basicAdd(otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) + { + switch (featureID) + { + case EvolutionPackage.EVOLUTION__MODELS: + return ((InternalEList<?>)getModels()).basicRemove(otherEnd, msgs); + case EvolutionPackage.EVOLUTION__RELEASES: + return ((InternalEList<?>)getReleases()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) + { + switch (featureID) + { + case EvolutionPackage.EVOLUTION__USE_ECORE_PACKAGE: + return isUseEcorePackage(); + case EvolutionPackage.EVOLUTION__USE_ERESOURCE_PACKAGE: + return isUseEresourcePackage(); + case EvolutionPackage.EVOLUTION__USE_ETYPES_PACKAGE: + return isUseEtypesPackage(); + case EvolutionPackage.EVOLUTION__UNIQUE_NAMESPACES: + return isUniqueNamespaces(); + case EvolutionPackage.EVOLUTION__MODELS: + return getModels(); + case EvolutionPackage.EVOLUTION__ROOT_PACKAGES: + return getRootPackages(); + case EvolutionPackage.EVOLUTION__ALL_PACKAGES: + return getAllPackages(); + case EvolutionPackage.EVOLUTION__MISSING_PACKAGES: + return getMissingPackages(); + case EvolutionPackage.EVOLUTION__RELEASES: + return getReleases(); + case EvolutionPackage.EVOLUTION__ORDERED_RELEASES: + return getOrderedReleases(); + case EvolutionPackage.EVOLUTION__LATEST_RELEASE: + if (resolve) + { + return getLatestRelease(); + } + return basicGetLatestRelease(); + case EvolutionPackage.EVOLUTION__NEXT_RELEASE_VERSION: + return getNextReleaseVersion(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) + { + switch (featureID) + { + case EvolutionPackage.EVOLUTION__USE_ECORE_PACKAGE: + setUseEcorePackage((Boolean)newValue); + return; + case EvolutionPackage.EVOLUTION__USE_ERESOURCE_PACKAGE: + setUseEresourcePackage((Boolean)newValue); + return; + case EvolutionPackage.EVOLUTION__USE_ETYPES_PACKAGE: + setUseEtypesPackage((Boolean)newValue); + return; + case EvolutionPackage.EVOLUTION__UNIQUE_NAMESPACES: + setUniqueNamespaces((Boolean)newValue); + return; + case EvolutionPackage.EVOLUTION__MODELS: + getModels().clear(); + getModels().addAll((Collection<? extends Model>)newValue); + return; + case EvolutionPackage.EVOLUTION__RELEASES: + getReleases().clear(); + getReleases().addAll((Collection<? extends Release>)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) + { + switch (featureID) + { + case EvolutionPackage.EVOLUTION__USE_ECORE_PACKAGE: + setUseEcorePackage(USE_ECORE_PACKAGE_EDEFAULT); + return; + case EvolutionPackage.EVOLUTION__USE_ERESOURCE_PACKAGE: + setUseEresourcePackage(USE_ERESOURCE_PACKAGE_EDEFAULT); + return; + case EvolutionPackage.EVOLUTION__USE_ETYPES_PACKAGE: + setUseEtypesPackage(USE_ETYPES_PACKAGE_EDEFAULT); + return; + case EvolutionPackage.EVOLUTION__UNIQUE_NAMESPACES: + setUniqueNamespaces(UNIQUE_NAMESPACES_EDEFAULT); + return; + case EvolutionPackage.EVOLUTION__MODELS: + getModels().clear(); + return; + case EvolutionPackage.EVOLUTION__RELEASES: + getReleases().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) + { + switch (featureID) + { + case EvolutionPackage.EVOLUTION__USE_ECORE_PACKAGE: + return isUseEcorePackage() != USE_ECORE_PACKAGE_EDEFAULT; + case EvolutionPackage.EVOLUTION__USE_ERESOURCE_PACKAGE: + return isUseEresourcePackage() != USE_ERESOURCE_PACKAGE_EDEFAULT; + case EvolutionPackage.EVOLUTION__USE_ETYPES_PACKAGE: + return isUseEtypesPackage() != USE_ETYPES_PACKAGE_EDEFAULT; + case EvolutionPackage.EVOLUTION__UNIQUE_NAMESPACES: + return isUniqueNamespaces() != UNIQUE_NAMESPACES_EDEFAULT; + case EvolutionPackage.EVOLUTION__MODELS: + return !getModels().isEmpty(); + case EvolutionPackage.EVOLUTION__ROOT_PACKAGES: + return !getRootPackages().isEmpty(); + case EvolutionPackage.EVOLUTION__ALL_PACKAGES: + return !getAllPackages().isEmpty(); + case EvolutionPackage.EVOLUTION__MISSING_PACKAGES: + return !getMissingPackages().isEmpty(); + case EvolutionPackage.EVOLUTION__RELEASES: + return !getReleases().isEmpty(); + case EvolutionPackage.EVOLUTION__ORDERED_RELEASES: + return !getOrderedReleases().isEmpty(); + case EvolutionPackage.EVOLUTION__LATEST_RELEASE: + return basicGetLatestRelease() != null; + case EvolutionPackage.EVOLUTION__NEXT_RELEASE_VERSION: + return getNextReleaseVersion() != NEXT_RELEASE_VERSION_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException + { + switch (operationID) + { + case EvolutionPackage.EVOLUTION___GET_RELEASE__INT: + return getRelease((Integer)arguments.get(0)); + } + return super.eInvoke(operationID, arguments); + } + + @Override + public Evolution getEvolution() + { + return this; + } + + @Override + public int getVersion() + { + return Integer.MAX_VALUE; + } + + @Override + public Release getPreviousRelease() + { + return getLatestRelease(); + } + + @Override + public boolean containsElement(EModelElement modelElement) + { + for (EPackage ePackage : getRootPackages()) + { + if (EcoreUtil.isAncestor(ePackage, modelElement)) + { + return true; + } + } + + return false; + } + + public Map<String, Set<EPackage>> getReleasedPackages() + { + if (releasedPackages == null) + { + releasedPackages = new HashMap<String, Set<EPackage>>(); + + for (Release release : getReleases()) + { + for (EPackage ePackage : release.getAllPackages()) + { + CollectionUtil.add(releasedPackages, ePackage.getNsURI(), ePackage); + } + } + } + + return releasedPackages; + } + + public static Evolution get(Notifier notifier) + { + if (notifier instanceof ResourceSet) + { + EList<Resource> resources = ((ResourceSet)notifier).getResources(); + if (resources.isEmpty()) + { + return null; + } + + notifier = resources.get(0); + } + + if (notifier instanceof Resource) + { + EList<EObject> contents = ((Resource)notifier).getContents(); + if (contents.isEmpty()) + { + return null; + } + + notifier = contents.get(0); + } + + if (notifier instanceof Evolution) + { + return (Evolution)notifier; + } + + if (notifier instanceof EObject) + { + Resource resource = ((EObject)notifier).eResource(); + if (resource != null) + { + return get(resource.getResourceSet()); + } + } + + return null; + } + +} // EvolutionImpl diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/EvolutionPackageImpl.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/EvolutionPackageImpl.java new file mode 100644 index 0000000000..3f66950b8f --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/EvolutionPackageImpl.java @@ -0,0 +1,1306 @@ +/** + */ +package org.eclipse.emf.cdo.evolution.impl; + +import org.eclipse.emf.cdo.evolution.Change; +import org.eclipse.emf.cdo.evolution.ChangeKind; +import org.eclipse.emf.cdo.evolution.ElementChange; +import org.eclipse.emf.cdo.evolution.Evolution; +import org.eclipse.emf.cdo.evolution.EvolutionFactory; +import org.eclipse.emf.cdo.evolution.EvolutionPackage; +import org.eclipse.emf.cdo.evolution.FeaturePathMigration; +import org.eclipse.emf.cdo.evolution.Migration; +import org.eclipse.emf.cdo.evolution.Model; +import org.eclipse.emf.cdo.evolution.ModelSet; +import org.eclipse.emf.cdo.evolution.ModelSetChange; +import org.eclipse.emf.cdo.evolution.PropertyChange; +import org.eclipse.emf.cdo.evolution.Release; +import org.eclipse.emf.cdo.evolution.util.EvolutionValidator; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EDataType; +import org.eclipse.emf.ecore.EEnum; +import org.eclipse.emf.ecore.EGenericType; +import org.eclipse.emf.ecore.EOperation; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.ETypeParameter; +import org.eclipse.emf.ecore.EValidator; +import org.eclipse.emf.ecore.EcorePackage; +import org.eclipse.emf.ecore.impl.EPackageImpl; + +/** + * <!-- begin-user-doc --> + * An implementation of the model <b>Package</b>. + * <!-- end-user-doc --> + * @generated + */ +public class EvolutionPackageImpl extends EPackageImpl implements EvolutionPackage +{ + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass modelSetEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass modelEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass evolutionEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass releaseEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass changeEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass modelSetChangeEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass elementChangeEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass propertyChangeEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass migrationEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass featurePathMigrationEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EEnum changeKindEEnum = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EDataType uriEDataType = null; + + /** + * Creates an instance of the model <b>Package</b>, registered with + * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package + * package URI value. + * <p>Note: the correct way to create the package is via the static + * factory method {@link #init init()}, which also performs + * initialization of the package, or returns the registered package, + * if one already exists. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.ecore.EPackage.Registry + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage#eNS_URI + * @see #init() + * @generated + */ + private EvolutionPackageImpl() + { + super(eNS_URI, EvolutionFactory.eINSTANCE); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private static boolean isInited = false; + + /** + * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends. + * + * <p>This method is used to initialize {@link EvolutionPackage#eINSTANCE} when that field is accessed. + * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #eNS_URI + * @see #createPackageContents() + * @see #initializePackageContents() + * @generated + */ + public static EvolutionPackage init() + { + if (isInited) + { + return (EvolutionPackage)EPackage.Registry.INSTANCE.getEPackage(EvolutionPackage.eNS_URI); + } + + // Obtain or create and register package + Object registeredEvolutionPackage = EPackage.Registry.INSTANCE.get(eNS_URI); + EvolutionPackageImpl theEvolutionPackage = registeredEvolutionPackage instanceof EvolutionPackageImpl ? (EvolutionPackageImpl)registeredEvolutionPackage + : new EvolutionPackageImpl(); + + isInited = true; + + // Initialize simple dependencies + EcorePackage.eINSTANCE.eClass(); + + // Create package meta-data objects + theEvolutionPackage.createPackageContents(); + + // Initialize created meta-data + theEvolutionPackage.initializePackageContents(); + + // Register package validator + EValidator.Registry.INSTANCE.put(theEvolutionPackage, new EValidator.Descriptor() + { + public EValidator getEValidator() + { + return EvolutionValidator.INSTANCE; + } + }); + + // Mark meta-data to indicate it can't be changed + theEvolutionPackage.freeze(); + + // Update the registry and return the package + EPackage.Registry.INSTANCE.put(EvolutionPackage.eNS_URI, theEvolutionPackage); + return theEvolutionPackage; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getModelSet() + { + return modelSetEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getModelSet_Change() + { + return (EReference)modelSetEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getModelSet_Migrations() + { + return (EReference)modelSetEClass.getEStructuralFeatures().get(1); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EOperation getModelSet__GetEvolution() + { + return modelSetEClass.getEOperations().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EOperation getModelSet__GetVersion() + { + return modelSetEClass.getEOperations().get(1); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EOperation getModelSet__GetPreviousRelease() + { + return modelSetEClass.getEOperations().get(2); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EOperation getModelSet__GetRootPackages() + { + return modelSetEClass.getEOperations().get(3); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EOperation getModelSet__GetAllPackages() + { + return modelSetEClass.getEOperations().get(4); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EOperation getModelSet__ContainsElement__EModelElement() + { + return modelSetEClass.getEOperations().get(5); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EOperation getModelSet__GetElement__String() + { + return modelSetEClass.getEOperations().get(6); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EOperation getModelSet__GetElementID__EModelElement() + { + return modelSetEClass.getEOperations().get(7); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EOperation getModelSet__GetElementID__EModelElement_boolean() + { + return modelSetEClass.getEOperations().get(8); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EOperation getModelSet__Compare__ModelSet() + { + return modelSetEClass.getEOperations().get(9); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EOperation getModelSet__GetMigration__String() + { + return modelSetEClass.getEOperations().get(10); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getModel() + { + return modelEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getModel_Evolution() + { + return (EReference)modelEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getModel_URI() + { + return (EAttribute)modelEClass.getEStructuralFeatures().get(1); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getModel_RootPackage() + { + return (EReference)modelEClass.getEStructuralFeatures().get(2); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getModel_AllPackages() + { + return (EReference)modelEClass.getEStructuralFeatures().get(3); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getModel_ReferencedPackages() + { + return (EReference)modelEClass.getEStructuralFeatures().get(4); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getModel_MissingPackages() + { + return (EReference)modelEClass.getEStructuralFeatures().get(5); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getEvolution() + { + return evolutionEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getEvolution_Models() + { + return (EReference)evolutionEClass.getEStructuralFeatures().get(4); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getEvolution_UseEcorePackage() + { + return (EAttribute)evolutionEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getEvolution_UseEresourcePackage() + { + return (EAttribute)evolutionEClass.getEStructuralFeatures().get(1); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getEvolution_UseEtypesPackage() + { + return (EAttribute)evolutionEClass.getEStructuralFeatures().get(2); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getEvolution_UniqueNamespaces() + { + return (EAttribute)evolutionEClass.getEStructuralFeatures().get(3); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getEvolution_RootPackages() + { + return (EReference)evolutionEClass.getEStructuralFeatures().get(5); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getEvolution_AllPackages() + { + return (EReference)evolutionEClass.getEStructuralFeatures().get(6); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getEvolution_Releases() + { + return (EReference)evolutionEClass.getEStructuralFeatures().get(8); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getEvolution_OrderedReleases() + { + return (EReference)evolutionEClass.getEStructuralFeatures().get(9); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getEvolution_LatestRelease() + { + return (EReference)evolutionEClass.getEStructuralFeatures().get(10); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getEvolution_NextReleaseVersion() + { + return (EAttribute)evolutionEClass.getEStructuralFeatures().get(11); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getEvolution_MissingPackages() + { + return (EReference)evolutionEClass.getEStructuralFeatures().get(7); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EOperation getEvolution__GetRelease__int() + { + return evolutionEClass.getEOperations().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getRelease() + { + return releaseEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getRelease_Evolution() + { + return (EReference)releaseEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getRelease_Date() + { + return (EAttribute)releaseEClass.getEStructuralFeatures().get(2); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getRelease_NextRelease() + { + return (EReference)releaseEClass.getEStructuralFeatures().get(3); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getRelease_PreviousRelease() + { + return (EReference)releaseEClass.getEStructuralFeatures().get(4); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getRelease_Version() + { + return (EAttribute)releaseEClass.getEStructuralFeatures().get(1); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getRelease_RootPackages() + { + return (EReference)releaseEClass.getEStructuralFeatures().get(5); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getRelease_AllPackages() + { + return (EReference)releaseEClass.getEStructuralFeatures().get(6); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getChange() + { + return changeEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getChange_Parent() + { + return (EReference)changeEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getChange_Children() + { + return (EReference)changeEClass.getEStructuralFeatures().get(1); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EOperation getChange__GetOldModelSet() + { + return changeEClass.getEOperations().get(3); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EOperation getChange__GetNewModelSet() + { + return changeEClass.getEOperations().get(4); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EOperation getChange__GetModelSetChange() + { + return changeEClass.getEOperations().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EOperation getChange__GetOldElementFor__EModelElement() + { + return changeEClass.getEOperations().get(1); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EOperation getChange__GetNewElementsFor__EModelElement() + { + return changeEClass.getEOperations().get(2); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getModelSetChange() + { + return modelSetChangeEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getModelSetChange_OldModelSet() + { + return (EReference)modelSetChangeEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getModelSetChange_NewModelSet() + { + return (EReference)modelSetChangeEClass.getEStructuralFeatures().get(1); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getElementChange() + { + return elementChangeEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getElementChange_OldElement() + { + return (EReference)elementChangeEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getElementChange_NewElement() + { + return (EReference)elementChangeEClass.getEStructuralFeatures().get(1); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getElementChange_Kind() + { + return (EAttribute)elementChangeEClass.getEStructuralFeatures().get(2); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EOperation getElementChange__GetElement() + { + return elementChangeEClass.getEOperations().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getPropertyChange() + { + return propertyChangeEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getPropertyChange_Feature() + { + return (EReference)propertyChangeEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getPropertyChange_OldValue() + { + return (EAttribute)propertyChangeEClass.getEStructuralFeatures().get(1); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getPropertyChange_NewValue() + { + return (EAttribute)propertyChangeEClass.getEStructuralFeatures().get(2); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getPropertyChange_Kind() + { + return (EAttribute)propertyChangeEClass.getEStructuralFeatures().get(3); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getMigration() + { + return migrationEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getMigration_ModelSet() + { + return (EReference)migrationEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getMigration_DiagnosticID() + { + return (EAttribute)migrationEClass.getEStructuralFeatures().get(1); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getFeaturePathMigration() + { + return featurePathMigrationEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getFeaturePathMigration_FromClass() + { + return (EReference)featurePathMigrationEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getFeaturePathMigration_ToClass() + { + return (EReference)featurePathMigrationEClass.getEStructuralFeatures().get(1); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getFeaturePathMigration_FeaturePath() + { + return (EReference)featurePathMigrationEClass.getEStructuralFeatures().get(2); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EEnum getChangeKind() + { + return changeKindEEnum; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EDataType getURI() + { + return uriEDataType; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EvolutionFactory getEvolutionFactory() + { + return (EvolutionFactory)getEFactoryInstance(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private boolean isCreated = false; + + /** + * Creates the meta-model objects for the package. This method is + * guarded to have no affect on any invocation but its first. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void createPackageContents() + { + if (isCreated) + { + return; + } + isCreated = true; + + // Create classes and their features + modelSetEClass = createEClass(MODEL_SET); + createEReference(modelSetEClass, MODEL_SET__CHANGE); + createEReference(modelSetEClass, MODEL_SET__MIGRATIONS); + createEOperation(modelSetEClass, MODEL_SET___GET_EVOLUTION); + createEOperation(modelSetEClass, MODEL_SET___GET_VERSION); + createEOperation(modelSetEClass, MODEL_SET___GET_PREVIOUS_RELEASE); + createEOperation(modelSetEClass, MODEL_SET___GET_ROOT_PACKAGES); + createEOperation(modelSetEClass, MODEL_SET___GET_ALL_PACKAGES); + createEOperation(modelSetEClass, MODEL_SET___CONTAINS_ELEMENT__EMODELELEMENT); + createEOperation(modelSetEClass, MODEL_SET___GET_ELEMENT__STRING); + createEOperation(modelSetEClass, MODEL_SET___GET_ELEMENT_ID__EMODELELEMENT); + createEOperation(modelSetEClass, MODEL_SET___GET_ELEMENT_ID__EMODELELEMENT_BOOLEAN); + createEOperation(modelSetEClass, MODEL_SET___COMPARE__MODELSET); + createEOperation(modelSetEClass, MODEL_SET___GET_MIGRATION__STRING); + + modelEClass = createEClass(MODEL); + createEReference(modelEClass, MODEL__EVOLUTION); + createEAttribute(modelEClass, MODEL__URI); + createEReference(modelEClass, MODEL__ROOT_PACKAGE); + createEReference(modelEClass, MODEL__ALL_PACKAGES); + createEReference(modelEClass, MODEL__REFERENCED_PACKAGES); + createEReference(modelEClass, MODEL__MISSING_PACKAGES); + + evolutionEClass = createEClass(EVOLUTION); + createEAttribute(evolutionEClass, EVOLUTION__USE_ECORE_PACKAGE); + createEAttribute(evolutionEClass, EVOLUTION__USE_ERESOURCE_PACKAGE); + createEAttribute(evolutionEClass, EVOLUTION__USE_ETYPES_PACKAGE); + createEAttribute(evolutionEClass, EVOLUTION__UNIQUE_NAMESPACES); + createEReference(evolutionEClass, EVOLUTION__MODELS); + createEReference(evolutionEClass, EVOLUTION__ROOT_PACKAGES); + createEReference(evolutionEClass, EVOLUTION__ALL_PACKAGES); + createEReference(evolutionEClass, EVOLUTION__MISSING_PACKAGES); + createEReference(evolutionEClass, EVOLUTION__RELEASES); + createEReference(evolutionEClass, EVOLUTION__ORDERED_RELEASES); + createEReference(evolutionEClass, EVOLUTION__LATEST_RELEASE); + createEAttribute(evolutionEClass, EVOLUTION__NEXT_RELEASE_VERSION); + createEOperation(evolutionEClass, EVOLUTION___GET_RELEASE__INT); + + releaseEClass = createEClass(RELEASE); + createEReference(releaseEClass, RELEASE__EVOLUTION); + createEAttribute(releaseEClass, RELEASE__VERSION); + createEAttribute(releaseEClass, RELEASE__DATE); + createEReference(releaseEClass, RELEASE__NEXT_RELEASE); + createEReference(releaseEClass, RELEASE__PREVIOUS_RELEASE); + createEReference(releaseEClass, RELEASE__ROOT_PACKAGES); + createEReference(releaseEClass, RELEASE__ALL_PACKAGES); + + changeEClass = createEClass(CHANGE); + createEReference(changeEClass, CHANGE__PARENT); + createEReference(changeEClass, CHANGE__CHILDREN); + createEOperation(changeEClass, CHANGE___GET_MODEL_SET_CHANGE); + createEOperation(changeEClass, CHANGE___GET_OLD_ELEMENT_FOR__EMODELELEMENT); + createEOperation(changeEClass, CHANGE___GET_NEW_ELEMENTS_FOR__EMODELELEMENT); + createEOperation(changeEClass, CHANGE___GET_OLD_MODEL_SET); + createEOperation(changeEClass, CHANGE___GET_NEW_MODEL_SET); + + modelSetChangeEClass = createEClass(MODEL_SET_CHANGE); + createEReference(modelSetChangeEClass, MODEL_SET_CHANGE__OLD_MODEL_SET); + createEReference(modelSetChangeEClass, MODEL_SET_CHANGE__NEW_MODEL_SET); + + elementChangeEClass = createEClass(ELEMENT_CHANGE); + createEReference(elementChangeEClass, ELEMENT_CHANGE__OLD_ELEMENT); + createEReference(elementChangeEClass, ELEMENT_CHANGE__NEW_ELEMENT); + createEAttribute(elementChangeEClass, ELEMENT_CHANGE__KIND); + createEOperation(elementChangeEClass, ELEMENT_CHANGE___GET_ELEMENT); + + propertyChangeEClass = createEClass(PROPERTY_CHANGE); + createEReference(propertyChangeEClass, PROPERTY_CHANGE__FEATURE); + createEAttribute(propertyChangeEClass, PROPERTY_CHANGE__OLD_VALUE); + createEAttribute(propertyChangeEClass, PROPERTY_CHANGE__NEW_VALUE); + createEAttribute(propertyChangeEClass, PROPERTY_CHANGE__KIND); + + migrationEClass = createEClass(MIGRATION); + createEReference(migrationEClass, MIGRATION__MODEL_SET); + createEAttribute(migrationEClass, MIGRATION__DIAGNOSTIC_ID); + + featurePathMigrationEClass = createEClass(FEATURE_PATH_MIGRATION); + createEReference(featurePathMigrationEClass, FEATURE_PATH_MIGRATION__FROM_CLASS); + createEReference(featurePathMigrationEClass, FEATURE_PATH_MIGRATION__TO_CLASS); + createEReference(featurePathMigrationEClass, FEATURE_PATH_MIGRATION__FEATURE_PATH); + + // Create enums + changeKindEEnum = createEEnum(CHANGE_KIND); + + // Create data types + uriEDataType = createEDataType(URI); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private boolean isInitialized = false; + + /** + * Complete the initialization of the package and its meta-model. This + * method is guarded to have no affect on any invocation but its first. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void initializePackageContents() + { + if (isInitialized) + { + return; + } + isInitialized = true; + + // Initialize package + setName(eNAME); + setNsPrefix(eNS_PREFIX); + setNsURI(eNS_URI); + + // Obtain other dependent packages + EcorePackage theEcorePackage = (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI); + + // Create type parameters + + // Set bounds for type parameters + + // Add supertypes to classes + evolutionEClass.getESuperTypes().add(getModelSet()); + releaseEClass.getESuperTypes().add(getModelSet()); + modelSetChangeEClass.getESuperTypes().add(getChange()); + elementChangeEClass.getESuperTypes().add(getChange()); + propertyChangeEClass.getESuperTypes().add(getChange()); + featurePathMigrationEClass.getESuperTypes().add(getMigration()); + + // Initialize classes, features, and operations; add parameters + initEClass(modelSetEClass, ModelSet.class, "ModelSet", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getModelSet_Change(), getModelSetChange(), null, "change", null, 0, 1, ModelSet.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getModelSet_Migrations(), getMigration(), getMigration_ModelSet(), "migrations", null, 0, -1, ModelSet.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEOperation(getModelSet__GetEvolution(), getEvolution(), "getEvolution", 0, 1, IS_UNIQUE, IS_ORDERED); + + initEOperation(getModelSet__GetVersion(), ecorePackage.getEInt(), "getVersion", 0, 1, IS_UNIQUE, IS_ORDERED); + + initEOperation(getModelSet__GetPreviousRelease(), getRelease(), "getPreviousRelease", 0, 1, IS_UNIQUE, IS_ORDERED); + + initEOperation(getModelSet__GetRootPackages(), ecorePackage.getEPackage(), "getRootPackages", 0, -1, IS_UNIQUE, IS_ORDERED); + + initEOperation(getModelSet__GetAllPackages(), ecorePackage.getEPackage(), "getAllPackages", 0, -1, IS_UNIQUE, IS_ORDERED); + + EOperation op = initEOperation(getModelSet__ContainsElement__EModelElement(), theEcorePackage.getEBoolean(), "containsElement", 0, 1, IS_UNIQUE, + IS_ORDERED); + addEParameter(op, theEcorePackage.getEModelElement(), "modelElement", 0, 1, IS_UNIQUE, IS_ORDERED); + + op = initEOperation(getModelSet__GetElement__String(), null, "getElement", 0, 1, IS_UNIQUE, IS_ORDERED); + ETypeParameter t1 = addETypeParameter(op, "T"); + EGenericType g1 = createEGenericType(theEcorePackage.getEModelElement()); + t1.getEBounds().add(g1); + addEParameter(op, theEcorePackage.getEString(), "id", 0, 1, IS_UNIQUE, IS_ORDERED); + g1 = createEGenericType(t1); + initEOperation(op, g1); + + op = initEOperation(getModelSet__GetElementID__EModelElement(), theEcorePackage.getEString(), "getElementID", 0, 1, IS_UNIQUE, IS_ORDERED); + addEParameter(op, theEcorePackage.getEModelElement(), "modelElement", 0, 1, IS_UNIQUE, IS_ORDERED); + + op = initEOperation(getModelSet__GetElementID__EModelElement_boolean(), theEcorePackage.getEString(), "getElementID", 0, 1, IS_UNIQUE, IS_ORDERED); + addEParameter(op, theEcorePackage.getEModelElement(), "modelElement", 0, 1, IS_UNIQUE, IS_ORDERED); + addEParameter(op, ecorePackage.getEBoolean(), "considerOldIDs", 0, 1, IS_UNIQUE, IS_ORDERED); + + op = initEOperation(getModelSet__Compare__ModelSet(), getModelSetChange(), "compare", 0, 1, IS_UNIQUE, IS_ORDERED); + addEParameter(op, getModelSet(), "other", 0, 1, IS_UNIQUE, IS_ORDERED); + + op = initEOperation(getModelSet__GetMigration__String(), getMigration(), "getMigration", 0, 1, IS_UNIQUE, IS_ORDERED); + addEParameter(op, ecorePackage.getEString(), "diagnosticID", 0, 1, IS_UNIQUE, IS_ORDERED); + + initEClass(modelEClass, Model.class, "Model", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getModel_Evolution(), getEvolution(), getEvolution_Models(), "evolution", null, 1, 1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getModel_URI(), getURI(), "uRI", null, 0, 1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, IS_ORDERED); + initEReference(getModel_RootPackage(), theEcorePackage.getEPackage(), null, "rootPackage", null, 0, 1, Model.class, IS_TRANSIENT, IS_VOLATILE, + !IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getModel_AllPackages(), theEcorePackage.getEPackage(), null, "allPackages", null, 0, -1, Model.class, IS_TRANSIENT, IS_VOLATILE, + !IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getModel_ReferencedPackages(), theEcorePackage.getEPackage(), null, "referencedPackages", null, 0, -1, Model.class, IS_TRANSIENT, + IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getModel_MissingPackages(), theEcorePackage.getEPackage(), null, "missingPackages", null, 0, -1, Model.class, IS_TRANSIENT, IS_VOLATILE, + !IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + + initEClass(evolutionEClass, Evolution.class, "Evolution", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getEvolution_UseEcorePackage(), ecorePackage.getEBoolean(), "useEcorePackage", "true", 0, 1, Evolution.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getEvolution_UseEresourcePackage(), ecorePackage.getEBoolean(), "useEresourcePackage", null, 0, 1, Evolution.class, !IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getEvolution_UseEtypesPackage(), ecorePackage.getEBoolean(), "useEtypesPackage", null, 0, 1, Evolution.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getEvolution_UniqueNamespaces(), ecorePackage.getEBoolean(), "uniqueNamespaces", "true", 0, 1, Evolution.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getEvolution_Models(), getModel(), getModel_Evolution(), "models", null, 0, -1, Evolution.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getEvolution_RootPackages(), theEcorePackage.getEPackage(), null, "rootPackages", null, 0, -1, Evolution.class, IS_TRANSIENT, IS_VOLATILE, + !IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getEvolution_AllPackages(), theEcorePackage.getEPackage(), null, "allPackages", null, 0, -1, Evolution.class, IS_TRANSIENT, IS_VOLATILE, + !IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getEvolution_MissingPackages(), theEcorePackage.getEPackage(), null, "missingPackages", null, 0, -1, Evolution.class, IS_TRANSIENT, + IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getEvolution_Releases(), getRelease(), getRelease_Evolution(), "releases", null, 0, -1, Evolution.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getEvolution_OrderedReleases(), getRelease(), null, "orderedReleases", null, 0, -1, Evolution.class, IS_TRANSIENT, IS_VOLATILE, + !IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getEvolution_LatestRelease(), getRelease(), null, "latestRelease", null, 0, 1, Evolution.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, + !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEAttribute(getEvolution_NextReleaseVersion(), theEcorePackage.getEInt(), "nextReleaseVersion", null, 0, 1, Evolution.class, IS_TRANSIENT, IS_VOLATILE, + !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + + op = initEOperation(getEvolution__GetRelease__int(), getRelease(), "getRelease", 0, 1, IS_UNIQUE, IS_ORDERED); + addEParameter(op, theEcorePackage.getEInt(), "version", 0, 1, IS_UNIQUE, IS_ORDERED); + + initEClass(releaseEClass, Release.class, "Release", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getRelease_Evolution(), getEvolution(), getEvolution_Releases(), "evolution", null, 1, 1, Release.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getRelease_Version(), ecorePackage.getEInt(), "version", null, 1, 1, Release.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getRelease_Date(), ecorePackage.getEDate(), "date", null, 1, 1, Release.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, + !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getRelease_NextRelease(), getRelease(), null, "nextRelease", null, 0, 1, Release.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, + !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getRelease_PreviousRelease(), getRelease(), null, "previousRelease", null, 0, 1, Release.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, + !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getRelease_RootPackages(), theEcorePackage.getEPackage(), null, "rootPackages", null, 0, -1, Release.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getRelease_AllPackages(), theEcorePackage.getEPackage(), null, "allPackages", null, 0, -1, Release.class, IS_TRANSIENT, IS_VOLATILE, + !IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + + initEClass(changeEClass, Change.class, "Change", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getChange_Parent(), getChange(), getChange_Children(), "parent", null, 0, 1, Change.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getChange_Children(), getChange(), getChange_Parent(), "children", null, 0, -1, Change.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEOperation(getChange__GetModelSetChange(), getModelSetChange(), "getModelSetChange", 0, 1, IS_UNIQUE, IS_ORDERED); + + op = initEOperation(getChange__GetOldElementFor__EModelElement(), theEcorePackage.getEModelElement(), "getOldElementFor", 0, 1, IS_UNIQUE, IS_ORDERED); + addEParameter(op, theEcorePackage.getEModelElement(), "newElement", 0, 1, IS_UNIQUE, IS_ORDERED); + + op = initEOperation(getChange__GetNewElementsFor__EModelElement(), theEcorePackage.getEModelElement(), "getNewElementsFor", 0, -1, IS_UNIQUE, IS_ORDERED); + addEParameter(op, theEcorePackage.getEModelElement(), "oldElement", 0, 1, IS_UNIQUE, IS_ORDERED); + + initEOperation(getChange__GetOldModelSet(), getModelSet(), "getOldModelSet", 0, 1, IS_UNIQUE, IS_ORDERED); + + initEOperation(getChange__GetNewModelSet(), getModelSet(), "getNewModelSet", 0, 1, IS_UNIQUE, IS_ORDERED); + + initEClass(modelSetChangeEClass, ModelSetChange.class, "ModelSetChange", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getModelSetChange_OldModelSet(), getModelSet(), null, "oldModelSet", null, 0, 1, ModelSetChange.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getModelSetChange_NewModelSet(), getModelSet(), null, "newModelSet", null, 0, 1, ModelSetChange.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(elementChangeEClass, ElementChange.class, "ElementChange", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getElementChange_OldElement(), theEcorePackage.getEModelElement(), null, "oldElement", null, 0, 1, ElementChange.class, !IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getElementChange_NewElement(), theEcorePackage.getEModelElement(), null, "newElement", null, 0, 1, ElementChange.class, !IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getElementChange_Kind(), getChangeKind(), "kind", null, 0, 1, ElementChange.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEOperation(getElementChange__GetElement(), theEcorePackage.getEModelElement(), "getElement", 0, 1, IS_UNIQUE, IS_ORDERED); + + initEClass(propertyChangeEClass, PropertyChange.class, "PropertyChange", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getPropertyChange_Feature(), theEcorePackage.getEStructuralFeature(), null, "feature", null, 0, 1, PropertyChange.class, !IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getPropertyChange_OldValue(), ecorePackage.getEJavaObject(), "oldValue", null, 0, 1, PropertyChange.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getPropertyChange_NewValue(), ecorePackage.getEJavaObject(), "newValue", null, 0, 1, PropertyChange.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getPropertyChange_Kind(), getChangeKind(), "kind", null, 0, 1, PropertyChange.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, + !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + + initEClass(migrationEClass, Migration.class, "Migration", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getMigration_ModelSet(), getModelSet(), getModelSet_Migrations(), "modelSet", null, 0, 1, Migration.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getMigration_DiagnosticID(), ecorePackage.getEString(), "diagnosticID", null, 0, 1, Migration.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(featurePathMigrationEClass, FeaturePathMigration.class, "FeaturePathMigration", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getFeaturePathMigration_FromClass(), ecorePackage.getEClass(), null, "fromClass", null, 1, 1, FeaturePathMigration.class, !IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getFeaturePathMigration_ToClass(), ecorePackage.getEClass(), null, "toClass", null, 1, 1, FeaturePathMigration.class, !IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getFeaturePathMigration_FeaturePath(), ecorePackage.getEReference(), null, "featurePath", null, 0, -1, FeaturePathMigration.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + // Initialize enums and add enum literals + initEEnum(changeKindEEnum, ChangeKind.class, "ChangeKind"); + addEEnumLiteral(changeKindEEnum, ChangeKind.NONE); + addEEnumLiteral(changeKindEEnum, ChangeKind.CHANGED); + addEEnumLiteral(changeKindEEnum, ChangeKind.REMOVED); + addEEnumLiteral(changeKindEEnum, ChangeKind.ADDED); + addEEnumLiteral(changeKindEEnum, ChangeKind.COPIED); + addEEnumLiteral(changeKindEEnum, ChangeKind.MOVED); + + // Initialize data types + initEDataType(uriEDataType, org.eclipse.emf.common.util.URI.class, "URI", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); + + // Create resource + createResource(eNS_URI); + + // Create annotations + // http://www.eclipse.org/emf/2002/Ecore + createEcoreAnnotations(); + // http:///org/eclipse/emf/ecore/util/ExtendedMetaData + createExtendedMetaDataAnnotations(); + } + + /** + * Initializes the annotations for <b>http://www.eclipse.org/emf/2002/Ecore</b>. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected void createEcoreAnnotations() + { + String source = "http://www.eclipse.org/emf/2002/Ecore"; + addAnnotation(modelEClass, source, new String[] { "constraints", "ModelLoaded IDs_Exist NamespaceReflectsChange" }); + addAnnotation(evolutionEClass, source, new String[] { "constraints", "NotEmpty PackagesUnique NoMissingPackages IDsUnique" }); + addAnnotation(elementChangeEClass, source, new String[] { "constraints", "FeaturePathIsKnown" }); + addAnnotation(migrationEClass, source, new String[] { "constraints", "NotObsolete" }); + addAnnotation(featurePathMigrationEClass, source, new String[] { "constraints", "NewFeatureReachable" }); + } + + /** + * Initializes the annotations for <b>http:///org/eclipse/emf/ecore/util/ExtendedMetaData</b>. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected void createExtendedMetaDataAnnotations() + { + String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData"; + addAnnotation(getModel_URI(), source, new String[] { "kind", "attribute", "name", "uri" }); + } + +} // EvolutionPackageImpl diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/EvolutionPlugin.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/EvolutionPlugin.java new file mode 100644 index 0000000000..9f831d2a44 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/EvolutionPlugin.java @@ -0,0 +1,92 @@ +/** + */ +package org.eclipse.emf.cdo.evolution.impl; + +import org.eclipse.emf.common.EMFPlugin; +import org.eclipse.emf.common.util.ResourceLocator; + +/** + * This is the central singleton for the Evolution model plugin. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ +public final class EvolutionPlugin extends EMFPlugin +{ + /** + * Keep track of the singleton. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static final EvolutionPlugin INSTANCE = new EvolutionPlugin(); + + /** + * Keep track of the singleton. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private static Implementation plugin; + + /** + * Create the instance. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EvolutionPlugin() + { + super(new ResourceLocator[] {}); + } + + /** + * Returns the singleton instance of the Eclipse plugin. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the singleton instance. + * @generated + */ + @Override + public ResourceLocator getPluginResourceLocator() + { + return plugin; + } + + /** + * Returns the singleton instance of the Eclipse plugin. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the singleton instance. + * @generated + */ + public static Implementation getPlugin() + { + return plugin; + } + + /** + * The actual implementation of the Eclipse <b>Plugin</b>. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static class Implementation extends EclipsePlugin + { + /** + * Creates an instance. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public Implementation() + { + super(); + + // Remember the static instance. + // + plugin = this; + } + } + +} diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/FeaturePathMigrationImpl.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/FeaturePathMigrationImpl.java new file mode 100644 index 0000000000..48239adeaa --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/FeaturePathMigrationImpl.java @@ -0,0 +1,220 @@ +/** + */ +package org.eclipse.emf.cdo.evolution.impl; + +import org.eclipse.emf.cdo.evolution.EvolutionPackage; +import org.eclipse.emf.cdo.evolution.FeaturePathMigration; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EReference; + +import java.util.Collection; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Feature Path Migration</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * </p> + * <ul> + * <li>{@link org.eclipse.emf.cdo.evolution.impl.FeaturePathMigrationImpl#getFromClass <em>From Class</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.impl.FeaturePathMigrationImpl#getToClass <em>To Class</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.impl.FeaturePathMigrationImpl#getFeaturePath <em>Feature Path</em>}</li> + * </ul> + * + * @generated + */ +public class FeaturePathMigrationImpl extends MigrationImpl implements FeaturePathMigration +{ + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected FeaturePathMigrationImpl() + { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() + { + return EvolutionPackage.Literals.FEATURE_PATH_MIGRATION; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getFromClass() + { + return (EClass)eDynamicGet(EvolutionPackage.FEATURE_PATH_MIGRATION__FROM_CLASS, EvolutionPackage.Literals.FEATURE_PATH_MIGRATION__FROM_CLASS, true, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass basicGetFromClass() + { + return (EClass)eDynamicGet(EvolutionPackage.FEATURE_PATH_MIGRATION__FROM_CLASS, EvolutionPackage.Literals.FEATURE_PATH_MIGRATION__FROM_CLASS, false, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setFromClass(EClass newFromClass) + { + eDynamicSet(EvolutionPackage.FEATURE_PATH_MIGRATION__FROM_CLASS, EvolutionPackage.Literals.FEATURE_PATH_MIGRATION__FROM_CLASS, newFromClass); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getToClass() + { + return (EClass)eDynamicGet(EvolutionPackage.FEATURE_PATH_MIGRATION__TO_CLASS, EvolutionPackage.Literals.FEATURE_PATH_MIGRATION__TO_CLASS, true, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass basicGetToClass() + { + return (EClass)eDynamicGet(EvolutionPackage.FEATURE_PATH_MIGRATION__TO_CLASS, EvolutionPackage.Literals.FEATURE_PATH_MIGRATION__TO_CLASS, false, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setToClass(EClass newToClass) + { + eDynamicSet(EvolutionPackage.FEATURE_PATH_MIGRATION__TO_CLASS, EvolutionPackage.Literals.FEATURE_PATH_MIGRATION__TO_CLASS, newToClass); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @SuppressWarnings("unchecked") + public EList<EReference> getFeaturePath() + { + return (EList<EReference>)eDynamicGet(EvolutionPackage.FEATURE_PATH_MIGRATION__FEATURE_PATH, EvolutionPackage.Literals.FEATURE_PATH_MIGRATION__FEATURE_PATH, + true, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) + { + switch (featureID) + { + case EvolutionPackage.FEATURE_PATH_MIGRATION__FROM_CLASS: + if (resolve) + { + return getFromClass(); + } + return basicGetFromClass(); + case EvolutionPackage.FEATURE_PATH_MIGRATION__TO_CLASS: + if (resolve) + { + return getToClass(); + } + return basicGetToClass(); + case EvolutionPackage.FEATURE_PATH_MIGRATION__FEATURE_PATH: + return getFeaturePath(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) + { + switch (featureID) + { + case EvolutionPackage.FEATURE_PATH_MIGRATION__FROM_CLASS: + setFromClass((EClass)newValue); + return; + case EvolutionPackage.FEATURE_PATH_MIGRATION__TO_CLASS: + setToClass((EClass)newValue); + return; + case EvolutionPackage.FEATURE_PATH_MIGRATION__FEATURE_PATH: + getFeaturePath().clear(); + getFeaturePath().addAll((Collection<? extends EReference>)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) + { + switch (featureID) + { + case EvolutionPackage.FEATURE_PATH_MIGRATION__FROM_CLASS: + setFromClass((EClass)null); + return; + case EvolutionPackage.FEATURE_PATH_MIGRATION__TO_CLASS: + setToClass((EClass)null); + return; + case EvolutionPackage.FEATURE_PATH_MIGRATION__FEATURE_PATH: + getFeaturePath().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) + { + switch (featureID) + { + case EvolutionPackage.FEATURE_PATH_MIGRATION__FROM_CLASS: + return basicGetFromClass() != null; + case EvolutionPackage.FEATURE_PATH_MIGRATION__TO_CLASS: + return basicGetToClass() != null; + case EvolutionPackage.FEATURE_PATH_MIGRATION__FEATURE_PATH: + return !getFeaturePath().isEmpty(); + } + return super.eIsSet(featureID); + } + +} // FeaturePathMigrationImpl diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/MigrationImpl.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/MigrationImpl.java new file mode 100644 index 0000000000..5f37be483b --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/MigrationImpl.java @@ -0,0 +1,252 @@ +/** + */ +package org.eclipse.emf.cdo.evolution.impl; + +import org.eclipse.emf.cdo.evolution.EvolutionPackage; +import org.eclipse.emf.cdo.evolution.Migration; +import org.eclipse.emf.cdo.evolution.ModelSet; + +import org.eclipse.emf.internal.cdo.CDOObjectImpl; + +import org.eclipse.emf.common.notify.NotificationChain; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Migration</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * </p> + * <ul> + * <li>{@link org.eclipse.emf.cdo.evolution.impl.MigrationImpl#getModelSet <em>Model Set</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.impl.MigrationImpl#getDiagnosticID <em>Diagnostic ID</em>}</li> + * </ul> + * + * @generated + */ +public abstract class MigrationImpl extends CDOObjectImpl implements Migration +{ + /** + * The default value of the '{@link #getDiagnosticID() <em>Diagnostic ID</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getDiagnosticID() + * @generated + * @ordered + */ + protected static final String DIAGNOSTIC_ID_EDEFAULT = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected MigrationImpl() + { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() + { + return EvolutionPackage.Literals.MIGRATION; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected int eStaticFeatureCount() + { + return 0; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public ModelSet getModelSet() + { + return (ModelSet)eDynamicGet(EvolutionPackage.MIGRATION__MODEL_SET, EvolutionPackage.Literals.MIGRATION__MODEL_SET, true, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public NotificationChain basicSetModelSet(ModelSet newModelSet, NotificationChain msgs) + { + msgs = eBasicSetContainer((InternalEObject)newModelSet, EvolutionPackage.MIGRATION__MODEL_SET, msgs); + return msgs; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setModelSet(ModelSet newModelSet) + { + eDynamicSet(EvolutionPackage.MIGRATION__MODEL_SET, EvolutionPackage.Literals.MIGRATION__MODEL_SET, newModelSet); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String getDiagnosticID() + { + return (String)eDynamicGet(EvolutionPackage.MIGRATION__DIAGNOSTIC_ID, EvolutionPackage.Literals.MIGRATION__DIAGNOSTIC_ID, true, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setDiagnosticID(String newDiagnosticID) + { + eDynamicSet(EvolutionPackage.MIGRATION__DIAGNOSTIC_ID, EvolutionPackage.Literals.MIGRATION__DIAGNOSTIC_ID, newDiagnosticID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) + { + switch (featureID) + { + case EvolutionPackage.MIGRATION__MODEL_SET: + if (eInternalContainer() != null) + { + msgs = eBasicRemoveFromContainer(msgs); + } + return basicSetModelSet((ModelSet)otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) + { + switch (featureID) + { + case EvolutionPackage.MIGRATION__MODEL_SET: + return basicSetModelSet(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) + { + switch (eContainerFeatureID()) + { + case EvolutionPackage.MIGRATION__MODEL_SET: + return eInternalContainer().eInverseRemove(this, EvolutionPackage.MODEL_SET__MIGRATIONS, ModelSet.class, msgs); + } + return super.eBasicRemoveFromContainerFeature(msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) + { + switch (featureID) + { + case EvolutionPackage.MIGRATION__MODEL_SET: + return getModelSet(); + case EvolutionPackage.MIGRATION__DIAGNOSTIC_ID: + return getDiagnosticID(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) + { + switch (featureID) + { + case EvolutionPackage.MIGRATION__MODEL_SET: + setModelSet((ModelSet)newValue); + return; + case EvolutionPackage.MIGRATION__DIAGNOSTIC_ID: + setDiagnosticID((String)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) + { + switch (featureID) + { + case EvolutionPackage.MIGRATION__MODEL_SET: + setModelSet((ModelSet)null); + return; + case EvolutionPackage.MIGRATION__DIAGNOSTIC_ID: + setDiagnosticID(DIAGNOSTIC_ID_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) + { + switch (featureID) + { + case EvolutionPackage.MIGRATION__MODEL_SET: + return getModelSet() != null; + case EvolutionPackage.MIGRATION__DIAGNOSTIC_ID: + return DIAGNOSTIC_ID_EDEFAULT == null ? getDiagnosticID() != null : !DIAGNOSTIC_ID_EDEFAULT.equals(getDiagnosticID()); + } + return super.eIsSet(featureID); + } + +} // MigrationImpl diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/ModelImpl.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/ModelImpl.java new file mode 100644 index 0000000000..577b41095b --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/ModelImpl.java @@ -0,0 +1,567 @@ +/** + */ +package org.eclipse.emf.cdo.evolution.impl; + +import org.eclipse.emf.cdo.eresource.EresourcePackage; +import org.eclipse.emf.cdo.etypes.EtypesPackage; +import org.eclipse.emf.cdo.evolution.Evolution; +import org.eclipse.emf.cdo.evolution.EvolutionPackage; +import org.eclipse.emf.cdo.evolution.Model; + +import org.eclipse.emf.internal.cdo.CDOObjectImpl; +import org.eclipse.emf.internal.cdo.util.CompletePackageClosure; +import org.eclipse.emf.internal.cdo.util.IPackageClosure; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; +import org.eclipse.emf.common.util.ECollections; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EcorePackage; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.util.EcoreEList; + +import java.util.Collections; +import java.util.Set; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Model</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * </p> + * <ul> + * <li>{@link org.eclipse.emf.cdo.evolution.impl.ModelImpl#getEvolution <em>Evolution</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.impl.ModelImpl#getURI <em>URI</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.impl.ModelImpl#getRootPackage <em>Root Package</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.impl.ModelImpl#getAllPackages <em>All Packages</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.impl.ModelImpl#getReferencedPackages <em>Referenced Packages</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.impl.ModelImpl#getMissingPackages <em>Missing Packages</em>}</li> + * </ul> + * + * @generated + */ +public class ModelImpl extends CDOObjectImpl implements Model +{ + /** + * The default value of the '{@link #getURI() <em>URI</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getURI() + * @generated + * @ordered + */ + protected static final URI URI_EDEFAULT = null; + + private ModelStatus status; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected ModelImpl() + { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() + { + return EvolutionPackage.Literals.MODEL; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected int eStaticFeatureCount() + { + return 0; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public Evolution getEvolution() + { + return (Evolution)eDynamicGet(EvolutionPackage.MODEL__EVOLUTION, EvolutionPackage.Literals.MODEL__EVOLUTION, true, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public NotificationChain basicSetEvolution(Evolution newEvolution, NotificationChain msgs) + { + msgs = eBasicSetContainer((InternalEObject)newEvolution, EvolutionPackage.MODEL__EVOLUTION, msgs); + return msgs; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setEvolution(Evolution newEvolution) + { + eDynamicSet(EvolutionPackage.MODEL__EVOLUTION, EvolutionPackage.Literals.MODEL__EVOLUTION, newEvolution); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public URI getURI() + { + return (URI)eDynamicGet(EvolutionPackage.MODEL__URI, EvolutionPackage.Literals.MODEL__URI, true, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setURIGen(URI newURI) + { + eDynamicSet(EvolutionPackage.MODEL__URI, EvolutionPackage.Literals.MODEL__URI, newURI); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + public void setURI(URI newURI) + { + status = null; + + EPackage oldRootPackage = null; + // EList<EPackage> oldAllPackages = null; + // EList<EPackage> oldReferencedPackages = null; + // EList<EPackage> oldMissingPackages = null; + + boolean notificationRequired = eNotificationRequired(); + if (notificationRequired) + { + oldRootPackage = getRootPackage(); + // oldAllPackages = getAllPackages(); + // oldReferencedPackages = getReferencedPackages(); + // oldMissingPackages = getMissingPackages(); + } + + setURIGen(newURI); + + if (notificationRequired) + { + EPackage rootPackage = getRootPackage(); + if (rootPackage != oldRootPackage) + { + eNotify(new ENotificationImpl(this, Notification.SET, EvolutionPackage.Literals.MODEL__ROOT_PACKAGE, oldRootPackage, rootPackage)); + } + + // EList<EPackage> allPackages = getAllPackages(); + // if (!allPackages.equals(oldAllPackages)) + // { + // eNotify(new ENotificationImpl(this, Notification.SET, EvolutionPackage.Literals.MODEL__ALL_PACKAGES, + // oldAllPackages, allPackages)); + // } + } + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EPackage getRootPackage() + { + EPackage rootPackage = basicGetRootPackage(); + return rootPackage != null && rootPackage.eIsProxy() ? (EPackage)eResolveProxy((InternalEObject)rootPackage) : rootPackage; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + public EPackage basicGetRootPackage() + { + URI uri = getURI(); + if (uri == null) + { + status = ModelStatus.NO_URI; + return null; + } + + Resource resource = eResource(); + if (resource == null) + { + status = ModelStatus.NO_RESOURCE_SET; + return null; + } + + ResourceSet resourceSet = resource.getResourceSet(); + if (resourceSet == null) + { + status = ModelStatus.NO_RESOURCE_SET; + return null; + } + + if (!resourceSet.getURIConverter().exists(uri, Collections.emptyMap())) + { + status = ModelStatus.RESOURCE_NOT_FOUND; + return null; + } + + Resource modelResource; + + try + { + modelResource = resourceSet.getResource(uri, true); + } + catch (Exception ex) + { + // ex.printStackTrace(); + modelResource = null; + } + + if (modelResource == null) + { + status = ModelStatus.LOAD_PROBLEM; + return null; + } + + if (!modelResource.getErrors().isEmpty()) + { + status = ModelStatus.LOAD_PROBLEM; + resourceSet.getResources().remove(modelResource); + return null; + } + + EList<EObject> contents = modelResource.getContents(); + if (contents.isEmpty()) + { + status = ModelStatus.CONTENT_PROBLEM; + return null; + } + + EObject firstElement = contents.get(0); + if (!(firstElement instanceof EPackage)) + { + status = ModelStatus.CONTENT_PROBLEM; + return null; + } + + status = ModelStatus.OK; + return (EPackage)firstElement; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + public EList<EPackage> getAllPackages() + { + EPackage rootPackage = getRootPackage(); + if (rootPackage == null) + { + return ECollections.emptyEList(); + } + + EcoreEList<EPackage> list = new EcoreEList<EPackage>(EPackage.class, this) + { + private static final long serialVersionUID = 1L; + + @Override + public int getFeatureID() + { + return EvolutionPackage.MODEL__ALL_PACKAGES; + } + }; + + collectAllPackages(rootPackage, list); + return list; + } + + static void collectAllPackages(EPackage ePackage, EList<EPackage> list) + { + list.add(ePackage); + + for (EPackage subPackage : ePackage.getESubpackages()) + { + collectAllPackages(subPackage, list); + } + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + public EList<EPackage> getReferencedPackages() + { + EList<EPackage> allPackages = getAllPackages(); + if (allPackages.isEmpty()) + { + return ECollections.emptyEList(); + } + + EcoreEList<EPackage> list = new EcoreEList<EPackage>(EPackage.class, this) + { + private static final long serialVersionUID = 1L; + + @Override + public int getFeatureID() + { + return EvolutionPackage.MODEL__REFERENCED_PACKAGES; + } + }; + + IPackageClosure closure = new CompletePackageClosure(); + Set<EPackage> referencedPackages = closure.calculate(allPackages); + + for (EPackage referencedPackage : referencedPackages) + { + if (!allPackages.contains(referencedPackage)) + { + list.add(referencedPackage); + } + } + + return list; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + public EList<EPackage> getMissingPackages() + { + EList<EPackage> referencedPackages = getReferencedPackages(); + if (referencedPackages.isEmpty()) + { + return ECollections.emptyEList(); + } + + Evolution evolution = getEvolution(); + if (evolution == null) + { + return ECollections.emptyEList(); + } + + EList<EPackage> allPackages = evolution.getAllPackages(); + + EcoreEList<EPackage> list = new EcoreEList<EPackage>(EPackage.class, this) + { + private static final long serialVersionUID = 1L; + + @Override + public int getFeatureID() + { + return EvolutionPackage.MODEL__MISSING_PACKAGES; + } + }; + + for (EPackage referencedPackage : referencedPackages) + { + if (referencedPackage == EcorePackage.eINSTANCE && evolution.isUseEcorePackage()) + { + continue; + } + + if (referencedPackage == EresourcePackage.eINSTANCE && evolution.isUseEresourcePackage()) + { + continue; + } + + if (referencedPackage == EtypesPackage.eINSTANCE && evolution.isUseEtypesPackage()) + { + continue; + } + + if (allPackages.contains(referencedPackage)) + { + continue; + } + + list.add(referencedPackage); + } + + return list; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) + { + switch (featureID) + { + case EvolutionPackage.MODEL__EVOLUTION: + if (eInternalContainer() != null) + { + msgs = eBasicRemoveFromContainer(msgs); + } + return basicSetEvolution((Evolution)otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) + { + switch (featureID) + { + case EvolutionPackage.MODEL__EVOLUTION: + return basicSetEvolution(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) + { + switch (eContainerFeatureID()) + { + case EvolutionPackage.MODEL__EVOLUTION: + return eInternalContainer().eInverseRemove(this, EvolutionPackage.EVOLUTION__MODELS, Evolution.class, msgs); + } + return super.eBasicRemoveFromContainerFeature(msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) + { + switch (featureID) + { + case EvolutionPackage.MODEL__EVOLUTION: + return getEvolution(); + case EvolutionPackage.MODEL__URI: + return getURI(); + case EvolutionPackage.MODEL__ROOT_PACKAGE: + if (resolve) + { + return getRootPackage(); + } + return basicGetRootPackage(); + case EvolutionPackage.MODEL__ALL_PACKAGES: + return getAllPackages(); + case EvolutionPackage.MODEL__REFERENCED_PACKAGES: + return getReferencedPackages(); + case EvolutionPackage.MODEL__MISSING_PACKAGES: + return getMissingPackages(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) + { + switch (featureID) + { + case EvolutionPackage.MODEL__EVOLUTION: + setEvolution((Evolution)newValue); + return; + case EvolutionPackage.MODEL__URI: + setURI((URI)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) + { + switch (featureID) + { + case EvolutionPackage.MODEL__EVOLUTION: + setEvolution((Evolution)null); + return; + case EvolutionPackage.MODEL__URI: + setURI(URI_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) + { + switch (featureID) + { + case EvolutionPackage.MODEL__EVOLUTION: + return getEvolution() != null; + case EvolutionPackage.MODEL__URI: + return URI_EDEFAULT == null ? getURI() != null : !URI_EDEFAULT.equals(getURI()); + case EvolutionPackage.MODEL__ROOT_PACKAGE: + return basicGetRootPackage() != null; + case EvolutionPackage.MODEL__ALL_PACKAGES: + return !getAllPackages().isEmpty(); + case EvolutionPackage.MODEL__REFERENCED_PACKAGES: + return !getReferencedPackages().isEmpty(); + case EvolutionPackage.MODEL__MISSING_PACKAGES: + return !getMissingPackages().isEmpty(); + } + return super.eIsSet(featureID); + } + + public ModelStatus getStatus() + { + return status; + } + +} // ModelImpl diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/ModelSetChangeImpl.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/ModelSetChangeImpl.java new file mode 100644 index 0000000000..b06a02328f --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/ModelSetChangeImpl.java @@ -0,0 +1,276 @@ +/** + */ +package org.eclipse.emf.cdo.evolution.impl; + +import org.eclipse.emf.cdo.evolution.ElementChange; +import org.eclipse.emf.cdo.evolution.EvolutionPackage; +import org.eclipse.emf.cdo.evolution.ModelSet; +import org.eclipse.emf.cdo.evolution.ModelSetChange; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EModelElement; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Model Set Change</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * </p> + * <ul> + * <li>{@link org.eclipse.emf.cdo.evolution.impl.ModelSetChangeImpl#getOldModelSet <em>Old Model Set</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.impl.ModelSetChangeImpl#getNewModelSet <em>New Model Set</em>}</li> + * </ul> + * + * @generated + */ +public class ModelSetChangeImpl extends ChangeImpl implements ModelSetChange +{ + private final Map<EModelElement, ElementChange> elementChanges = new HashMap<EModelElement, ElementChange>(); + + private final Map<EModelElement, EModelElement> newToOldElements = new HashMap<EModelElement, EModelElement>(); + + private final Map<EModelElement, Set<EModelElement>> oldToNewElements = new HashMap<EModelElement, Set<EModelElement>>(); + + private final Set<EModelElement> addedElements = new HashSet<EModelElement>(); + + private final Set<EModelElement> removedElements = new HashSet<EModelElement>(); + + private ModelSet[] modelSetChain; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected ModelSetChangeImpl() + { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() + { + return EvolutionPackage.Literals.MODEL_SET_CHANGE; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public ModelSet getOldModelSet() + { + return (ModelSet)eDynamicGet(EvolutionPackage.MODEL_SET_CHANGE__OLD_MODEL_SET, EvolutionPackage.Literals.MODEL_SET_CHANGE__OLD_MODEL_SET, true, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public ModelSet basicGetOldModelSet() + { + return (ModelSet)eDynamicGet(EvolutionPackage.MODEL_SET_CHANGE__OLD_MODEL_SET, EvolutionPackage.Literals.MODEL_SET_CHANGE__OLD_MODEL_SET, false, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setOldModelSet(ModelSet newOldModelSet) + { + eDynamicSet(EvolutionPackage.MODEL_SET_CHANGE__OLD_MODEL_SET, EvolutionPackage.Literals.MODEL_SET_CHANGE__OLD_MODEL_SET, newOldModelSet); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public ModelSet getNewModelSet() + { + return (ModelSet)eDynamicGet(EvolutionPackage.MODEL_SET_CHANGE__NEW_MODEL_SET, EvolutionPackage.Literals.MODEL_SET_CHANGE__NEW_MODEL_SET, true, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public ModelSet basicGetNewModelSet() + { + return (ModelSet)eDynamicGet(EvolutionPackage.MODEL_SET_CHANGE__NEW_MODEL_SET, EvolutionPackage.Literals.MODEL_SET_CHANGE__NEW_MODEL_SET, false, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setNewModelSet(ModelSet newNewModelSet) + { + eDynamicSet(EvolutionPackage.MODEL_SET_CHANGE__NEW_MODEL_SET, EvolutionPackage.Literals.MODEL_SET_CHANGE__NEW_MODEL_SET, newNewModelSet); + } + + @Override + public ModelSetChange getModelSetChange() + { + return this; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) + { + switch (featureID) + { + case EvolutionPackage.MODEL_SET_CHANGE__OLD_MODEL_SET: + if (resolve) + { + return getOldModelSet(); + } + return basicGetOldModelSet(); + case EvolutionPackage.MODEL_SET_CHANGE__NEW_MODEL_SET: + if (resolve) + { + return getNewModelSet(); + } + return basicGetNewModelSet(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) + { + switch (featureID) + { + case EvolutionPackage.MODEL_SET_CHANGE__OLD_MODEL_SET: + setOldModelSet((ModelSet)newValue); + return; + case EvolutionPackage.MODEL_SET_CHANGE__NEW_MODEL_SET: + setNewModelSet((ModelSet)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) + { + switch (featureID) + { + case EvolutionPackage.MODEL_SET_CHANGE__OLD_MODEL_SET: + setOldModelSet((ModelSet)null); + return; + case EvolutionPackage.MODEL_SET_CHANGE__NEW_MODEL_SET: + setNewModelSet((ModelSet)null); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) + { + switch (featureID) + { + case EvolutionPackage.MODEL_SET_CHANGE__OLD_MODEL_SET: + return basicGetOldModelSet() != null; + case EvolutionPackage.MODEL_SET_CHANGE__NEW_MODEL_SET: + return basicGetNewModelSet() != null; + } + return super.eIsSet(featureID); + } + + public Map<EModelElement, ElementChange> getElementChanges() + { + return elementChanges; + } + + public Map<EModelElement, EModelElement> getNewToOldElements() + { + return newToOldElements; + } + + public Map<EModelElement, Set<EModelElement>> getOldToNewElements() + { + return oldToNewElements; + } + + public Set<EModelElement> getAddedElements() + { + return addedElements; + } + + public Set<EModelElement> getRemovedElements() + { + return removedElements; + } + + public ModelSet[] getModelSetChain() + { + return modelSetChain; + } + + public void setModelSetChain(ModelSet[] modelSetChain) + { + this.modelSetChain = modelSetChain; + setOldModelSet(modelSetChain[0]); + setNewModelSet(modelSetChain[modelSetChain.length - 1]); + + } + + public Map<EModelElement, ElementChange> reset() + { + Map<EModelElement, ElementChange> result = new HashMap<EModelElement, ElementChange>(elementChanges); + + for (ElementChange elementChange : elementChanges.values()) + { + elementChange.getChildren().clear(); + } + + getChildren().clear(); + oldToNewElements.clear(); + newToOldElements.clear(); + addedElements.clear(); + removedElements.clear(); + elementChanges.clear(); + + return result; + } + +} // ModelSetChangeImpl diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/ModelSetImpl.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/ModelSetImpl.java new file mode 100644 index 0000000000..b7d7696a87 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/ModelSetImpl.java @@ -0,0 +1,937 @@ +/** + */ +package org.eclipse.emf.cdo.evolution.impl; + +import org.eclipse.emf.cdo.evolution.Change; +import org.eclipse.emf.cdo.evolution.ChangeKind; +import org.eclipse.emf.cdo.evolution.ElementChange; +import org.eclipse.emf.cdo.evolution.Evolution; +import org.eclipse.emf.cdo.evolution.EvolutionFactory; +import org.eclipse.emf.cdo.evolution.EvolutionPackage; +import org.eclipse.emf.cdo.evolution.Migration; +import org.eclipse.emf.cdo.evolution.ModelSet; +import org.eclipse.emf.cdo.evolution.ModelSetChange; +import org.eclipse.emf.cdo.evolution.PropertyChange; +import org.eclipse.emf.cdo.evolution.Release; +import org.eclipse.emf.cdo.evolution.util.ElementHandler; +import org.eclipse.emf.cdo.evolution.util.ElementRunnable; +import org.eclipse.emf.cdo.evolution.util.IDAnnotation; + +import org.eclipse.emf.internal.cdo.CDOObjectImpl; + +import org.eclipse.net4j.util.ObjectUtil; +import org.eclipse.net4j.util.collection.CollectionUtil; + +import org.eclipse.emf.common.notify.NotificationChain; +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.ECollections; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EModelElement; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.ecore.EcorePackage; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.emf.ecore.util.InternalEList; + +import java.lang.reflect.InvocationTargetException; +import java.util.Collection; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Model Set</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * </p> + * <ul> + * <li>{@link org.eclipse.emf.cdo.evolution.impl.ModelSetImpl#getChange <em>Change</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.impl.ModelSetImpl#getMigrations <em>Migrations</em>}</li> + * </ul> + * + * @generated + */ +public abstract class ModelSetImpl extends CDOObjectImpl implements ModelSet +{ + private static final boolean COMPARE_CONTAINMENT = false; + + private static final boolean DEBUG_IDS = false; + + private static final boolean DEBUG_MATCH = false; + + private static final boolean DEBUG_COMPARE = false; + + private static final boolean DEBUG_CLEANUP = false; + + private boolean changeInvalid; + + private ModelSetImpl emptyModelSet; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected ModelSetImpl() + { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() + { + return EvolutionPackage.Literals.MODEL_SET; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected int eStaticFeatureCount() + { + return 0; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public ModelSetChange getChangeGen() + { + return (ModelSetChange)eDynamicGet(EvolutionPackage.MODEL_SET__CHANGE, EvolutionPackage.Literals.MODEL_SET__CHANGE, true, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated NOT + */ + public ModelSetChange getChange() + { + ModelSetChangeImpl change = (ModelSetChangeImpl)getChangeGen(); + if (change != null && change.getOldModelSet() != getOldModelSet()) + { + // Can happen after undoing a release. + change = null; + } + + if (change == null || changeInvalid) + + { + ModelSetChangeImpl result; + Map<EModelElement, ElementChange> previousElementChanges; + + if (change != null) + { + previousElementChanges = change.reset(); + result = change; + } + else + { + ModelSet oldModelSet = getOldModelSet(); + ModelSet[] modelSetChain = createModelSetChain(oldModelSet, this); + + previousElementChanges = null; + result = (ModelSetChangeImpl)EvolutionFactory.eINSTANCE.createModelSetChange(modelSetChain); + } + + compareElements(result, previousElementChanges); + + try + { + eSetDeliver(false); + setChange(change = result); + } + finally + { + eSetDeliver(true); + changeInvalid = false; + } + } + + return change; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public NotificationChain basicSetChange(ModelSetChange newChange, NotificationChain msgs) + { + msgs = eDynamicInverseAdd((InternalEObject)newChange, EvolutionPackage.MODEL_SET__CHANGE, msgs); + return msgs; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setChange(ModelSetChange newChange) + { + eDynamicSet(EvolutionPackage.MODEL_SET__CHANGE, EvolutionPackage.Literals.MODEL_SET__CHANGE, newChange); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public NotificationChain basicUnsetChange(NotificationChain msgs) + { + return eDynamicInverseRemove((InternalEObject)getChange(), EvolutionPackage.MODEL_SET__CHANGE, msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void unsetChange() + { + eDynamicUnset(EvolutionPackage.MODEL_SET__CHANGE, EvolutionPackage.Literals.MODEL_SET__CHANGE); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isSetChange() + { + return eDynamicIsSet(EvolutionPackage.MODEL_SET__CHANGE, EvolutionPackage.Literals.MODEL_SET__CHANGE); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @SuppressWarnings("unchecked") + public EList<Migration> getMigrations() + { + return (EList<Migration>)eDynamicGet(EvolutionPackage.MODEL_SET__MIGRATIONS, EvolutionPackage.Literals.MODEL_SET__MIGRATIONS, true, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + public abstract Evolution getEvolution(); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + public abstract int getVersion(); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + public abstract Release getPreviousRelease(); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + public abstract EList<EPackage> getRootPackages(); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + public abstract EList<EPackage> getAllPackages(); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + public abstract boolean containsElement(EModelElement modelElement); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + @SuppressWarnings("unchecked") + public <T extends EModelElement> T getElement(final String id) + { + // TODO Design better approach to early return from ElementHandler.execute(). + int xxx; + + class ResultException extends RuntimeException + { + private static final long serialVersionUID = 1L; + + EModelElement result; + } + + try + { + ElementHandler.execute(getRootPackages(), new ElementRunnable() + { + public void run(EModelElement modelElement) + { + if (ObjectUtil.equals(id, getElementID(modelElement))) + { + ResultException ex = new ResultException(); + ex.result = modelElement; + throw ex; + } + } + }); + } + catch (ResultException ex) + { + return (T)ex.result; + } + + return null; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + public String getElementID(EModelElement modelElement) + { + return getElementID(modelElement, false); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + public String getElementID(EModelElement modelElement, boolean considerOldIDs) + { + if (containsElement(modelElement)) + { + return IDAnnotation.getValue(modelElement, considerOldIDs); + } + + return null; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + public ModelSetChange compare(ModelSet other) + { + ModelSet[] modelSetChain = createModelSetChain(this, other); + ModelSetChangeImpl result = (ModelSetChangeImpl)EvolutionFactory.eINSTANCE.createModelSetChange(modelSetChain); + + compareElements(result, null); + return result; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + public Migration getMigration(String diagnosticID) + { + if (diagnosticID != null) + { + for (Migration migration : getMigrations()) + { + if (diagnosticID.equals(migration.getDiagnosticID())) + { + return migration; + } + } + } + + return null; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) + { + switch (featureID) + { + case EvolutionPackage.MODEL_SET__MIGRATIONS: + return ((InternalEList<InternalEObject>)(InternalEList<?>)getMigrations()).basicAdd(otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) + { + switch (featureID) + { + case EvolutionPackage.MODEL_SET__CHANGE: + return basicUnsetChange(msgs); + case EvolutionPackage.MODEL_SET__MIGRATIONS: + return ((InternalEList<?>)getMigrations()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) + { + switch (featureID) + { + case EvolutionPackage.MODEL_SET__CHANGE: + return getChange(); + case EvolutionPackage.MODEL_SET__MIGRATIONS: + return getMigrations(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) + { + switch (featureID) + { + case EvolutionPackage.MODEL_SET__CHANGE: + setChange((ModelSetChange)newValue); + return; + case EvolutionPackage.MODEL_SET__MIGRATIONS: + getMigrations().clear(); + getMigrations().addAll((Collection<? extends Migration>)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) + { + switch (featureID) + { + case EvolutionPackage.MODEL_SET__CHANGE: + unsetChange(); + return; + case EvolutionPackage.MODEL_SET__MIGRATIONS: + getMigrations().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) + { + switch (featureID) + { + case EvolutionPackage.MODEL_SET__CHANGE: + return isSetChange(); + case EvolutionPackage.MODEL_SET__MIGRATIONS: + return !getMigrations().isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException + { + switch (operationID) + { + case EvolutionPackage.MODEL_SET___GET_EVOLUTION: + return getEvolution(); + case EvolutionPackage.MODEL_SET___GET_VERSION: + return getVersion(); + case EvolutionPackage.MODEL_SET___GET_PREVIOUS_RELEASE: + return getPreviousRelease(); + case EvolutionPackage.MODEL_SET___GET_ROOT_PACKAGES: + return getRootPackages(); + case EvolutionPackage.MODEL_SET___GET_ALL_PACKAGES: + return getAllPackages(); + case EvolutionPackage.MODEL_SET___CONTAINS_ELEMENT__EMODELELEMENT: + return containsElement((EModelElement)arguments.get(0)); + case EvolutionPackage.MODEL_SET___GET_ELEMENT__STRING: + return getElement((String)arguments.get(0)); + case EvolutionPackage.MODEL_SET___GET_ELEMENT_ID__EMODELELEMENT: + return getElementID((EModelElement)arguments.get(0)); + case EvolutionPackage.MODEL_SET___GET_ELEMENT_ID__EMODELELEMENT_BOOLEAN: + return getElementID((EModelElement)arguments.get(0), (Boolean)arguments.get(1)); + case EvolutionPackage.MODEL_SET___COMPARE__MODELSET: + return compare((ModelSet)arguments.get(0)); + case EvolutionPackage.MODEL_SET___GET_MIGRATION__STRING: + return getMigration((String)arguments.get(0)); + } + return super.eInvoke(operationID, arguments); + } + + public void invalidateChange() + { + changeInvalid = true; + } + + private ModelSet getOldModelSet() + { + Release previousRelease = getPreviousRelease(); + return previousRelease != null ? previousRelease : getEmptyModelSet(); + } + + private ModelSet getEmptyModelSet() + { + if (emptyModelSet == null) + { + emptyModelSet = new ModelSetImpl() + { + @Override + public int getVersion() + { + return 0; + } + + @Override + public EList<EPackage> getRootPackages() + { + return ECollections.emptyEList(); + } + + @Override + public Release getPreviousRelease() + { + return null; + } + + @Override + public Evolution getEvolution() + { + return ModelSetImpl.this.getEvolution(); + } + + @Override + public EList<EPackage> getAllPackages() + { + return ECollections.emptyEList(); + } + + @Override + public boolean containsElement(EModelElement modelElement) + { + return false; + } + }; + } + + return emptyModelSet; + } + + private static void compareElements(final ModelSetChangeImpl result, final Map<EModelElement, ElementChange> previousElementChanges) + { + final ModelSet[] modelSets = result.getModelSetChain(); + final ModelSet oldModelSet = result.getOldModelSet(); + final ModelSet newModelSet = result.getNewModelSet(); + + ElementHandler.execute(newModelSet.getRootPackages(), new ElementRunnable() + { + public void run(EModelElement newElement) + { + EModelElement oldElement = newElement; + + for (int i = modelSets.length - 1; i > 0; --i) + { + String id = modelSets[i].getElementID(oldElement, true); + oldElement = modelSets[i - 1].getElement(id); + if (oldElement == null) + { + break; + } + } + + if (oldElement != null) + { + String newID = IDAnnotation.getValue(newElement); + String oldID = IDAnnotation.getValue(oldElement); + + ChangeKind kind = ObjectUtil.equals(newID, oldID) ? ChangeKind.NONE : ChangeKind.COPIED; + if (kind == ChangeKind.COPIED) + { + if (newModelSet.getElement(oldID) == null) + { + kind = ChangeKind.MOVED; + } + } + + if (DEBUG_MATCH) + { + System.out.println(kind + " " + getLabel(oldElement) + " --> " + getLabel(newElement)); + } + + ElementChange elementChange = getElementChange(newElement, oldElement, kind, previousElementChanges); + getParentChange(elementChange, result).getChildren().add(elementChange); + result.getElementChanges().put(oldElement, elementChange); + result.getElementChanges().put(newElement, elementChange); + result.getNewToOldElements().put(newElement, oldElement); + CollectionUtil.add(result.getOldToNewElements(), oldElement, newElement); + } + else + { + if (DEBUG_MATCH) + { + System.out.println("ADDED " + getLabel(newElement)); + } + + ElementChange elementChange = getElementChange(null, newElement, ChangeKind.ADDED, previousElementChanges); + getParentChange(elementChange, result).getChildren().add(elementChange); + result.getElementChanges().put(newElement, elementChange); + result.getAddedElements().add(newElement); + } + } + }); + + ElementHandler.execute(oldModelSet.getRootPackages(), new ElementRunnable() + { + public void run(EModelElement oldElement) + { + if (isRemoved(oldElement)) + { + if (DEBUG_MATCH) + { + System.out.println("REMOVED " + getLabel(oldElement)); + } + + ElementChange elementChange = getElementChange(oldElement, null, ChangeKind.REMOVED, previousElementChanges); + getParentChange(elementChange, result).getChildren().add(elementChange); + result.getElementChanges().put(oldElement, elementChange); + result.getRemovedElements().add(oldElement); + } + } + + private boolean isRemoved(EModelElement oldElement) + { + Set<EModelElement> newElements = result.getOldToNewElements().get(oldElement); + if (newElements == null || newElements.isEmpty()) + { + return true; + } + + String oldID = oldModelSet.getElementID(oldElement); + for (EModelElement newElement : newElements) + { + String newID = newModelSet.getElementID(newElement); + if (ObjectUtil.equals(newID, oldID)) + { + return false; + } + } + + return true; + } + }); + + for (Map.Entry<EModelElement, EModelElement> entry : result.getNewToOldElements().entrySet()) + { + EModelElement newElement = entry.getKey(); + EModelElement oldElement = entry.getValue(); + + compareProperties(result, newElement, oldElement); + } + + for (EModelElement newElement : result.getAddedElements()) + { + compareProperties(result, newElement, null); + } + + cleanupChanges(result); + } + + private static void compareProperties(ModelSetChange result, EModelElement newElement, EModelElement oldElement) + { + EClass eClass = newElement.eClass(); + + if (oldElement == null) + { + oldElement = (EModelElement)EcoreUtil.create(eClass); + } + else if (oldElement.eClass() != eClass) + { + int xxx; + throw new IllegalArgumentException(); + } + + Map<EModelElement, EModelElement> newToOldElements = result.getNewToOldElements(); + + for (EStructuralFeature feature : eClass.getEAllStructuralFeatures()) + { + if (feature.isDerived()) + { + continue; + } + + if (feature == EcorePackage.Literals.EPACKAGE__EFACTORY_INSTANCE) + { + continue; + } + + if (feature == EcorePackage.Literals.EENUM_LITERAL__INSTANCE) + { + continue; + } + + EReference eReference = feature instanceof EReference ? (EReference)feature : null; + if (COMPARE_CONTAINMENT) + { + if (feature == EcorePackage.Literals.EMODEL_ELEMENT__EANNOTATIONS) + { + continue; + } + + if (feature == EcorePackage.Literals.ETYPED_ELEMENT__EGENERIC_TYPE) + { + continue; + } + + if (feature == EcorePackage.Literals.ECLASS__EGENERIC_SUPER_TYPES) + { + continue; + } + } + else + { + if (eReference != null && eReference.isContainment()) + { + continue; + } + } + + Object newValue = newElement.eGet(feature); + if (eReference != null) + { + if (eReference.isMany()) + { + @SuppressWarnings("unchecked") + EList<EObject> list = (EList<EObject>)newValue; + + // TODO As an optimization, defer list creation. + EList<EObject> newList = new BasicEList<EObject>(list.size()); + + for (EObject eObject : list) + { + if (eObject instanceof EModelElement) + { + EModelElement newListElement = (EModelElement)eObject; + EModelElement oldListElement = newToOldElements.get(newListElement); + if (oldListElement != null && oldListElement != newListElement) + { + eObject = oldListElement; + } + } + + newList.add(eObject); + } + + newValue = newList; + } + else + { + if (newValue instanceof EModelElement) + { + EModelElement oldValue = newToOldElements.get(newValue); + if (oldValue != null && oldValue != newValue) + { + newValue = oldValue; + } + } + } + } + + Object oldValue = oldElement.eGet(feature); + if (!ObjectUtil.equals(newValue, oldValue)) + { + if (DEBUG_COMPARE) + { + System.out.println("PROPERTY CHANGE " + getLabel(newElement) + " --> " + feature.getName()); + } + + PropertyChange propertyChange = EvolutionFactory.eINSTANCE.createPropertyChange(feature, oldValue, newValue); + ElementChange elementChange = result.getElementChanges().get(newElement); + elementChange.getChildren().add(0, propertyChange); + } + } + } + + private static void cleanupChanges(Change change) + { + for (Iterator<Change> it = change.getChildren().iterator(); it.hasNext();) + { + Change child = it.next(); + if (child instanceof ElementChange) + { + ElementChange elementChange = (ElementChange)child; + cleanupChanges(elementChange); + + if (elementChange.getKind() == ChangeKind.NONE && elementChange.getChildren().isEmpty()) + { + if (DEBUG_CLEANUP) + { + System.out.println("CLEANUP " + getLabel(elementChange.getElement())); + } + + it.remove(); + } + } + } + } + + private static Change getParentChange(ElementChange elementChange, ModelSetChange modelSetChange) + { + EModelElement element = elementChange.getElement(); + EObject eContainer = element.eContainer(); + if (eContainer instanceof EModelElement) + { + EModelElement parentElement = (EModelElement)eContainer; + ElementChange parentChange = modelSetChange.getElementChanges().get(parentElement); + if (parentChange != null) + { + return parentChange; + } + } + + return modelSetChange; + } + + private static ElementChange getElementChange(EModelElement newElement, EModelElement oldElement, ChangeKind kind, + Map<EModelElement, ElementChange> previousElementChanges) + { + if (previousElementChanges != null) + { + ElementChangeImpl elementChange = (ElementChangeImpl)previousElementChanges.remove(newElement); + if (elementChange == null) + { + elementChange = (ElementChangeImpl)previousElementChanges.remove(oldElement); + } + + if (elementChange != null) + { + // Make sure that the ElementChange can't be used later through any other lookup. + for (Iterator<Map.Entry<EModelElement, ElementChange>> it = previousElementChanges.entrySet().iterator(); it.hasNext();) + { + Map.Entry<EModelElement, ElementChange> entry = it.next(); + if (entry.getValue() == elementChange) + { + it.remove(); + } + } + + elementChange.setOldElement(oldElement); + elementChange.setNewElement(newElement); + elementChange.setKind(kind); + return elementChange; + } + } + + return EvolutionFactory.eINSTANCE.createElementChange(oldElement, newElement, kind); + } + + private static String getLabel(EModelElement element) + { + String label = ElementHandler.getLabel(element); + + if (DEBUG_IDS) + { + String id = IDAnnotation.getValue(element); + if (id != null) + { + label += "[" + id + "]"; + } + } + + return label; + } + + private static ModelSet[] createModelSetChain(ModelSet modelSetA, ModelSet modelSetB) + { + int versionA = modelSetA.getVersion(); + int versionB = modelSetB.getVersion(); + + EList<ModelSet> result = new BasicEList<ModelSet>(); + if (versionA < versionB) + { + result.add(modelSetA); + result.add(modelSetB); + } + else + { + result.add(modelSetB); + result.add(modelSetA); + } + + ModelSet first = result.get(0); + ModelSet second; + while ((second = result.get(1).getPreviousRelease()) != first) + { + if (second == null) + { + break; + } + + result.add(1, second); + } + + return result.toArray(new ModelSet[result.size()]); + } + +} // ModelSetImpl diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/PropertyChangeImpl.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/PropertyChangeImpl.java new file mode 100644 index 0000000000..d8e7d9b720 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/PropertyChangeImpl.java @@ -0,0 +1,301 @@ +/** + */ +package org.eclipse.emf.cdo.evolution.impl; + +import org.eclipse.emf.cdo.evolution.Change; +import org.eclipse.emf.cdo.evolution.ChangeKind; +import org.eclipse.emf.cdo.evolution.EvolutionPackage; +import org.eclipse.emf.cdo.evolution.ModelSet; +import org.eclipse.emf.cdo.evolution.PropertyChange; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EStructuralFeature; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Property Change</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * </p> + * <ul> + * <li>{@link org.eclipse.emf.cdo.evolution.impl.PropertyChangeImpl#getFeature <em>Feature</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.impl.PropertyChangeImpl#getOldValue <em>Old Value</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.impl.PropertyChangeImpl#getNewValue <em>New Value</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.impl.PropertyChangeImpl#getKind <em>Kind</em>}</li> + * </ul> + * + * @generated + */ +public class PropertyChangeImpl extends ChangeImpl implements PropertyChange +{ + /** + * The default value of the '{@link #getOldValue() <em>Old Value</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getOldValue() + * @generated + * @ordered + */ + protected static final Object OLD_VALUE_EDEFAULT = null; + + /** + * The default value of the '{@link #getNewValue() <em>New Value</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getNewValue() + * @generated + * @ordered + */ + protected static final Object NEW_VALUE_EDEFAULT = null; + + /** + * The default value of the '{@link #getKind() <em>Kind</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getKind() + * @generated + * @ordered + */ + protected static final ChangeKind KIND_EDEFAULT = ChangeKind.NONE; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected PropertyChangeImpl() + { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() + { + return EvolutionPackage.Literals.PROPERTY_CHANGE; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EStructuralFeature getFeature() + { + return (EStructuralFeature)eDynamicGet(EvolutionPackage.PROPERTY_CHANGE__FEATURE, EvolutionPackage.Literals.PROPERTY_CHANGE__FEATURE, true, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EStructuralFeature basicGetFeature() + { + return (EStructuralFeature)eDynamicGet(EvolutionPackage.PROPERTY_CHANGE__FEATURE, EvolutionPackage.Literals.PROPERTY_CHANGE__FEATURE, false, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setFeature(EStructuralFeature newFeature) + { + eDynamicSet(EvolutionPackage.PROPERTY_CHANGE__FEATURE, EvolutionPackage.Literals.PROPERTY_CHANGE__FEATURE, newFeature); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public Object getOldValue() + { + return eDynamicGet(EvolutionPackage.PROPERTY_CHANGE__OLD_VALUE, EvolutionPackage.Literals.PROPERTY_CHANGE__OLD_VALUE, true, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setOldValue(Object newOldValue) + { + eDynamicSet(EvolutionPackage.PROPERTY_CHANGE__OLD_VALUE, EvolutionPackage.Literals.PROPERTY_CHANGE__OLD_VALUE, newOldValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public Object getNewValue() + { + return eDynamicGet(EvolutionPackage.PROPERTY_CHANGE__NEW_VALUE, EvolutionPackage.Literals.PROPERTY_CHANGE__NEW_VALUE, true, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setNewValue(Object newNewValue) + { + eDynamicSet(EvolutionPackage.PROPERTY_CHANGE__NEW_VALUE, EvolutionPackage.Literals.PROPERTY_CHANGE__NEW_VALUE, newNewValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + public ChangeKind getKind() + { + Object oldValue = getOldValue(); + Object newValue = getNewValue(); + + if (oldValue == null) + { + if (newValue == null) + { + return ChangeKind.NONE; + } + + return ChangeKind.ADDED; + } + else + { + if (newValue == null) + { + return ChangeKind.REMOVED; + } + + return ChangeKind.CHANGED; + } + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) + { + switch (featureID) + { + case EvolutionPackage.PROPERTY_CHANGE__FEATURE: + if (resolve) + { + return getFeature(); + } + return basicGetFeature(); + case EvolutionPackage.PROPERTY_CHANGE__OLD_VALUE: + return getOldValue(); + case EvolutionPackage.PROPERTY_CHANGE__NEW_VALUE: + return getNewValue(); + case EvolutionPackage.PROPERTY_CHANGE__KIND: + return getKind(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) + { + switch (featureID) + { + case EvolutionPackage.PROPERTY_CHANGE__FEATURE: + setFeature((EStructuralFeature)newValue); + return; + case EvolutionPackage.PROPERTY_CHANGE__OLD_VALUE: + setOldValue(newValue); + return; + case EvolutionPackage.PROPERTY_CHANGE__NEW_VALUE: + setNewValue(newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) + { + switch (featureID) + { + case EvolutionPackage.PROPERTY_CHANGE__FEATURE: + setFeature((EStructuralFeature)null); + return; + case EvolutionPackage.PROPERTY_CHANGE__OLD_VALUE: + setOldValue(OLD_VALUE_EDEFAULT); + return; + case EvolutionPackage.PROPERTY_CHANGE__NEW_VALUE: + setNewValue(NEW_VALUE_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) + { + switch (featureID) + { + case EvolutionPackage.PROPERTY_CHANGE__FEATURE: + return basicGetFeature() != null; + case EvolutionPackage.PROPERTY_CHANGE__OLD_VALUE: + return OLD_VALUE_EDEFAULT == null ? getOldValue() != null : !OLD_VALUE_EDEFAULT.equals(getOldValue()); + case EvolutionPackage.PROPERTY_CHANGE__NEW_VALUE: + return NEW_VALUE_EDEFAULT == null ? getNewValue() != null : !NEW_VALUE_EDEFAULT.equals(getNewValue()); + case EvolutionPackage.PROPERTY_CHANGE__KIND: + return getKind() != KIND_EDEFAULT; + } + return super.eIsSet(featureID); + } + + @Override + public ModelSet getOldModelSet() + { + Change parent = getParent(); + if (parent != null) + { + return parent.getOldModelSet(); + } + + return null; + } + + @Override + public ModelSet getNewModelSet() + { + Change parent = getParent(); + if (parent != null) + { + return parent.getNewModelSet(); + } + + return null; + } + +} // PropertyChangeImpl diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/ReleaseImpl.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/ReleaseImpl.java new file mode 100644 index 0000000000..f219630386 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/impl/ReleaseImpl.java @@ -0,0 +1,463 @@ +/** + */ +package org.eclipse.emf.cdo.evolution.impl; + +import org.eclipse.emf.cdo.evolution.Evolution; +import org.eclipse.emf.cdo.evolution.EvolutionPackage; +import org.eclipse.emf.cdo.evolution.Release; +import org.eclipse.emf.cdo.evolution.util.ElementHandler; +import org.eclipse.emf.cdo.evolution.util.ElementRunnable; + +import org.eclipse.emf.common.notify.NotificationChain; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EModelElement; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.util.EcoreEList; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.emf.ecore.util.InternalEList; + +import java.util.Collection; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Release</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * </p> + * <ul> + * <li>{@link org.eclipse.emf.cdo.evolution.impl.ReleaseImpl#getEvolution <em>Evolution</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.impl.ReleaseImpl#getVersion <em>Version</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.impl.ReleaseImpl#getDate <em>Date</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.impl.ReleaseImpl#getNextRelease <em>Next Release</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.impl.ReleaseImpl#getPreviousRelease <em>Previous Release</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.impl.ReleaseImpl#getRootPackages <em>Root Packages</em>}</li> + * <li>{@link org.eclipse.emf.cdo.evolution.impl.ReleaseImpl#getAllPackages <em>All Packages</em>}</li> + * </ul> + * + * @generated + */ +public class ReleaseImpl extends ModelSetImpl implements Release +{ + /** + * The default value of the '{@link #getVersion() <em>Version</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getVersion() + * @generated + * @ordered + */ + protected static final int VERSION_EDEFAULT = 0; + + /** + * The default value of the '{@link #getDate() <em>Date</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getDate() + * @generated + * @ordered + */ + protected static final Date DATE_EDEFAULT = null; + + private Map<String, EModelElement> idCache; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected ReleaseImpl() + { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() + { + return EvolutionPackage.Literals.RELEASE; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public Date getDate() + { + return (Date)eDynamicGet(EvolutionPackage.RELEASE__DATE, EvolutionPackage.Literals.RELEASE__DATE, true, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setDate(Date newDate) + { + eDynamicSet(EvolutionPackage.RELEASE__DATE, EvolutionPackage.Literals.RELEASE__DATE, newDate); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public Release getNextRelease() + { + Release nextRelease = basicGetNextRelease(); + return nextRelease != null && ((EObject)nextRelease).eIsProxy() ? (Release)eResolveProxy((InternalEObject)nextRelease) : nextRelease; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + public Release basicGetNextRelease() + { + int nextVersion = getVersion() + 1; + return getEvolution().getRelease(nextVersion); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Release getPreviousRelease() + { + Release previousRelease = basicGetPreviousRelease(); + return previousRelease != null && ((EObject)previousRelease).eIsProxy() ? (Release)eResolveProxy((InternalEObject)previousRelease) : previousRelease; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + public Release basicGetPreviousRelease() + { + int previousVersion = getVersion() - 1; + if (previousVersion < 1) + { + return null; + } + + return getEvolution().getRelease(previousVersion); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public int getVersion() + { + return (Integer)eDynamicGet(EvolutionPackage.RELEASE__VERSION, EvolutionPackage.Literals.RELEASE__VERSION, true, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setVersion(int newVersion) + { + eDynamicSet(EvolutionPackage.RELEASE__VERSION, EvolutionPackage.Literals.RELEASE__VERSION, newVersion); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + @SuppressWarnings("unchecked") + public EList<EPackage> getRootPackages() + { + return (EList<EPackage>)eDynamicGet(EvolutionPackage.RELEASE__ROOT_PACKAGES, EvolutionPackage.Literals.RELEASE__ROOT_PACKAGES, true, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Evolution getEvolution() + { + return (Evolution)eDynamicGet(EvolutionPackage.RELEASE__EVOLUTION, EvolutionPackage.Literals.RELEASE__EVOLUTION, true, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public NotificationChain basicSetEvolution(Evolution newEvolution, NotificationChain msgs) + { + msgs = eBasicSetContainer((InternalEObject)newEvolution, EvolutionPackage.RELEASE__EVOLUTION, msgs); + return msgs; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setEvolution(Evolution newEvolution) + { + eDynamicSet(EvolutionPackage.RELEASE__EVOLUTION, EvolutionPackage.Literals.RELEASE__EVOLUTION, newEvolution); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + @Override + public EList<EPackage> getAllPackages() + { + EcoreEList<EPackage> list = new EcoreEList<EPackage>(EPackage.class, this) + { + private static final long serialVersionUID = 1L; + + @Override + public int getFeatureID() + { + return EvolutionPackage.MODEL__ALL_PACKAGES; + } + }; + + for (EPackage rootPackage : getRootPackages()) + { + ModelImpl.collectAllPackages(rootPackage, list); + } + + return list; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) + { + switch (featureID) + { + case EvolutionPackage.RELEASE__EVOLUTION: + if (eInternalContainer() != null) + { + msgs = eBasicRemoveFromContainer(msgs); + } + return basicSetEvolution((Evolution)otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) + { + switch (featureID) + { + case EvolutionPackage.RELEASE__EVOLUTION: + return basicSetEvolution(null, msgs); + case EvolutionPackage.RELEASE__ROOT_PACKAGES: + return ((InternalEList<?>)getRootPackages()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) + { + switch (eContainerFeatureID()) + { + case EvolutionPackage.RELEASE__EVOLUTION: + return eInternalContainer().eInverseRemove(this, EvolutionPackage.EVOLUTION__RELEASES, Evolution.class, msgs); + } + return super.eBasicRemoveFromContainerFeature(msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) + { + switch (featureID) + { + case EvolutionPackage.RELEASE__EVOLUTION: + return getEvolution(); + case EvolutionPackage.RELEASE__VERSION: + return getVersion(); + case EvolutionPackage.RELEASE__DATE: + return getDate(); + case EvolutionPackage.RELEASE__NEXT_RELEASE: + if (resolve) + { + return getNextRelease(); + } + return basicGetNextRelease(); + case EvolutionPackage.RELEASE__PREVIOUS_RELEASE: + if (resolve) + { + return getPreviousRelease(); + } + return basicGetPreviousRelease(); + case EvolutionPackage.RELEASE__ROOT_PACKAGES: + return getRootPackages(); + case EvolutionPackage.RELEASE__ALL_PACKAGES: + return getAllPackages(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) + { + switch (featureID) + { + case EvolutionPackage.RELEASE__EVOLUTION: + setEvolution((Evolution)newValue); + return; + case EvolutionPackage.RELEASE__VERSION: + setVersion((Integer)newValue); + return; + case EvolutionPackage.RELEASE__DATE: + setDate((Date)newValue); + return; + case EvolutionPackage.RELEASE__ROOT_PACKAGES: + getRootPackages().clear(); + getRootPackages().addAll((Collection<? extends EPackage>)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) + { + switch (featureID) + { + case EvolutionPackage.RELEASE__EVOLUTION: + setEvolution((Evolution)null); + return; + case EvolutionPackage.RELEASE__VERSION: + setVersion(VERSION_EDEFAULT); + return; + case EvolutionPackage.RELEASE__DATE: + setDate(DATE_EDEFAULT); + return; + case EvolutionPackage.RELEASE__ROOT_PACKAGES: + getRootPackages().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) + { + switch (featureID) + { + case EvolutionPackage.RELEASE__EVOLUTION: + return getEvolution() != null; + case EvolutionPackage.RELEASE__VERSION: + return getVersion() != VERSION_EDEFAULT; + case EvolutionPackage.RELEASE__DATE: + return DATE_EDEFAULT == null ? getDate() != null : !DATE_EDEFAULT.equals(getDate()); + case EvolutionPackage.RELEASE__NEXT_RELEASE: + return basicGetNextRelease() != null; + case EvolutionPackage.RELEASE__PREVIOUS_RELEASE: + return basicGetPreviousRelease() != null; + case EvolutionPackage.RELEASE__ROOT_PACKAGES: + return !getRootPackages().isEmpty(); + case EvolutionPackage.RELEASE__ALL_PACKAGES: + return !getAllPackages().isEmpty(); + } + return super.eIsSet(featureID); + } + + public int compareTo(Release o) + { + return o.getVersion() - getVersion(); + } + + @Override + public void invalidateChange() + { + // Do nothing. + } + + @Override + public boolean containsElement(EModelElement modelElement) + { + return EcoreUtil.isAncestor(this, modelElement); + } + + @SuppressWarnings("unchecked") + @Override + public <T extends EModelElement> T getElement(String id) + { + if (idCache == null) + { + idCache = new HashMap<String, EModelElement>(); + + ElementHandler.execute(getRootPackages(), new ElementRunnable() + { + public void run(EModelElement modelElement) + { + String id = getElementID(modelElement); + idCache.put(id, modelElement); + } + }); + } + + return (T)idCache.get(id); + } + +} // ReleaseImpl diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/DiagnosticID.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/DiagnosticID.java new file mode 100644 index 0000000000..eaea7ad7cb --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/DiagnosticID.java @@ -0,0 +1,147 @@ +/* + * Copyright (c) 2004-2018 Eike Stepper (Loehne, Germany) and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Eike Stepper - initial API and implementation + */ +package org.eclipse.emf.cdo.evolution.util; + +import org.eclipse.emf.common.util.Diagnostic; +import org.eclipse.emf.ecore.EModelElement; + +/** + * @author Eike Stepper + */ +public final class DiagnosticID +{ + private final String value; + + public DiagnosticID(String value) + { + this.value = value; + } + + public String getValue() + { + return value; + } + + @Override + public int hashCode() + { + return 31 + (value == null ? 0 : value.hashCode()); + } + + @Override + public boolean equals(Object obj) + { + if (this == obj) + { + return true; + } + + if (obj == null) + { + return false; + } + + if (getClass() != obj.getClass()) + { + return false; + } + + DiagnosticID other = (DiagnosticID)obj; + if (value == null) + { + if (other.value != null) + { + return false; + } + } + else if (!value.equals(other.value)) + { + return false; + } + + return true; + } + + @Override + public String toString() + { + return "DiagnosticID[" + value + "]"; + } + + public static DiagnosticID get(Diagnostic diagnostic) + { + for (Object data : diagnostic.getData()) + { + if (data instanceof DiagnosticID) + { + return (DiagnosticID)data; + } + } + + StringBuilder builder = new StringBuilder(); + builder.append(diagnostic.getSource()); + builder.append("|"); + builder.append(diagnostic.getCode()); + + for (Object data : diagnostic.getData()) + { + appendData(builder, data); + } + + return new DiagnosticID(builder.toString()); + } + + private static void appendData(final StringBuilder builder, Object data) + { + if (data instanceof Provider) + { + Provider provider = (Provider)data; + provider.extractDiagnosticData(new Provider.Context() + { + public void add(String data) + { + builder.append("|"); + builder.append(data); + } + }); + + return; + } + + if (data instanceof EModelElement) + { + EModelElement modelElement = (EModelElement)data; + String label = ElementHandler.getLabel(modelElement); + if (label != null) + { + builder.append("|"); + builder.append(label); + return; + } + } + } + + /** + * @author Eike Stepper + */ + public interface Provider + { + public void extractDiagnosticData(Context context); + + /** + * @author Eike Stepper + */ + public interface Context + { + public void add(String data); + } + } +} diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/DiagnosticType.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/DiagnosticType.java new file mode 100644 index 0000000000..34e0bd4dba --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/DiagnosticType.java @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2004-2018 Eike Stepper (Loehne, Germany) and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Eike Stepper - initial API and implementation + */ +package org.eclipse.emf.cdo.evolution.util; + +import org.eclipse.emf.common.util.Diagnostic; + +/** + * @author Eike Stepper + */ +public final class DiagnosticType +{ + private final String source; + + private final int code; + + public DiagnosticType(String source, int code) + { + this.source = source; + this.code = code; + } + + public String getSource() + { + return source; + } + + public int getCode() + { + return code; + } + + public boolean appliesTo(Diagnostic diagnostic) + { + return code == diagnostic.getCode() && source.equals(diagnostic.getSource()); + } + + @Override + public int hashCode() + { + final int prime = 31; + int result = 1; + result = prime * result + code; + result = prime * result + (source == null ? 0 : source.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) + { + if (this == obj) + { + return true; + } + + if (obj == null) + { + return false; + } + + if (getClass() != obj.getClass()) + { + return false; + } + + DiagnosticType other = (DiagnosticType)obj; + if (code != other.code) + { + return false; + } + + if (source == null) + { + if (other.source != null) + { + return false; + } + } + else if (!source.equals(other.source)) + { + return false; + } + + return true; + } + + @Override + public String toString() + { + StringBuilder builder = new StringBuilder(); + builder.append("DiagnosticType["); + builder.append(source); + builder.append(":"); + builder.append(code); + builder.append("]"); + return builder.toString(); + } + + public static DiagnosticType from(Diagnostic diagnostic) + { + return new DiagnosticType(diagnostic.getSource(), diagnostic.getCode()); + } +} diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/ElementHandler.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/ElementHandler.java new file mode 100644 index 0000000000..f5176925e4 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/ElementHandler.java @@ -0,0 +1,465 @@ +/* + * Copyright (c) 2004-2018 Eike Stepper (Loehne, Germany) and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Eike Stepper - initial API and implementation + */ +package org.eclipse.emf.cdo.evolution.util; + +import org.eclipse.emf.cdo.evolution.ModelSet; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EClassifier; +import org.eclipse.emf.ecore.EDataType; +import org.eclipse.emf.ecore.EEnum; +import org.eclipse.emf.ecore.EEnumLiteral; +import org.eclipse.emf.ecore.EModelElement; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.ecore.EcorePackage; + +import java.util.List; + +/** + * @author Eike Stepper + */ +public abstract class ElementHandler +{ + private static ElementHandler PACKAGE = new PackageHandler(); + + private static ElementHandler CLASS = new ClassHandler(); + + private static ElementHandler ATTRIBUTE = new AttributeHandler(); + + private static ElementHandler REFERENCE = new ReferenceHandler(); + + private static ElementHandler DATA_TYPE = new DataTypeHandler(); + + private static ElementHandler ENUM = new EnumHandler(); + + private static ElementHandler ENUM_LITERAL = new EnumLiteralHandler(); + + private static final EReference[] NO_CHILD_FEATURES = {}; + + private ElementHandler() + { + } + + public abstract EClass getEClass(); + + public EReference[] getChildFeatures() + { + return NO_CHILD_FEATURES; + } + + public boolean hasChildFeatures() + { + return getChildFeatures().length != 0; + } + + protected abstract String computeLabel(EModelElement element); + + public static ElementHandler getHandler(EClass eClass) + { + if (eClass.getEPackage() == EcorePackage.eINSTANCE) + { + switch (eClass.getClassifierID()) + { + case EcorePackage.EPACKAGE: + return PACKAGE; + + case EcorePackage.ECLASS: + return CLASS; + + case EcorePackage.EATTRIBUTE: + return ATTRIBUTE; + + case EcorePackage.EREFERENCE: + return REFERENCE; + + case EcorePackage.EDATA_TYPE: + return DATA_TYPE; + + case EcorePackage.EENUM: + return ENUM; + + case EcorePackage.EENUM_LITERAL: + return ENUM_LITERAL; + } + } + + return null; + } + + public static String getLabel(EModelElement element) + { + ElementHandler handler = getHandler(element.eClass()); + if (handler != null) + { + return handler.computeLabel(element); + } + + return String.valueOf(element); + } + + public static ModelSet getModelSet(EModelElement element) + { + EObject eContainer; + while ((eContainer = element.eContainer()) != null) + { + if (eContainer instanceof ModelSet) + { + return (ModelSet)eContainer; + } + } + + return null; + } + + public static void execute(EModelElement element, ElementRunnable runnable) + { + runnable.run(element); + + EClass eClass = element.eClass(); + ElementHandler handler = getHandler(eClass); + if (handler != null) + { + EReference[] childFeatures = handler.getChildFeatures(); + for (int i = 0; i < childFeatures.length; i++) + { + EReference childFeature = childFeatures[i]; + + List<?> children = (List<?>)element.eGet(childFeature); + for (Object child : children) + { + if (child instanceof EModelElement) + { + execute((EModelElement)child, runnable); + } + } + } + } + } + + public static void execute(List<? extends EModelElement> elements, ElementRunnable runnable) + { + for (EModelElement element : elements) + { + execute(element, runnable); + } + } + + public static void main(String[] args) + { + // dumpRelevantContainments(); + dumpManyValuedNonContainments(); + } + + private static void dumpRelevantContainments() + { + for (EClassifier eClassifier : EcorePackage.eINSTANCE.getEClassifiers()) + { + if (eClassifier instanceof EClass) + { + EClass eClass = (EClass)eClassifier; + + if (eClass == EcorePackage.Literals.EOPERATION) + { + continue; + } + + if (eClass == EcorePackage.Literals.EGENERIC_TYPE) + { + continue; + } + + if (eClass == EcorePackage.Literals.ETYPE_PARAMETER) + { + continue; + } + + boolean first = true; + for (EStructuralFeature eStructuralFeature : eClass.getEStructuralFeatures()) + { + if (eStructuralFeature instanceof EReference) + { + EReference eReference = (EReference)eStructuralFeature; + if (eReference.isContainment()) + { + if (eReference == EcorePackage.Literals.ECLASS__EOPERATIONS) + { + continue; + } + + if (eReference == EcorePackage.Literals.ECLASS__EGENERIC_SUPER_TYPES) + { + continue; + } + + if (eReference == EcorePackage.Literals.ECLASSIFIER__ETYPE_PARAMETERS) + { + continue; + } + + if (eReference == EcorePackage.Literals.ETYPED_ELEMENT__EGENERIC_TYPE) + { + continue; + } + + if (first) + { + System.out.println(eClass.getName()); + first = false; + } + + System.out.println(" " + eReference.getName() + (eReference.isDerived() ? " DERIVED" : "")); + } + } + } + } + } + } + + private static void dumpManyValuedNonContainments() + { + for (EClassifier eClassifier : EcorePackage.eINSTANCE.getEClassifiers()) + { + if (eClassifier instanceof EClass) + { + EClass eClass = (EClass)eClassifier; + + boolean first = true; + for (EStructuralFeature eStructuralFeature : eClass.getEStructuralFeatures()) + { + if (!eStructuralFeature.isMany()) + { + continue; + } + + if (eStructuralFeature instanceof EReference) + { + EReference eReference = (EReference)eStructuralFeature; + if (eReference.isContainment()) + { + continue; + } + } + + if (first) + { + System.out.println(eClass.getName()); + first = false; + } + + System.out.println(" " + eStructuralFeature.getName() + (eStructuralFeature.isDerived() ? " DERIVED" : "")); + } + } + } + } + + /** + * @author Eike Stepper + */ + private static final class PackageHandler extends ElementHandler + { + private static final EReference[] CHILDREN = { EcorePackage.Literals.EPACKAGE__ECLASSIFIERS, EcorePackage.Literals.EPACKAGE__ESUBPACKAGES }; + + @Override + public EClass getEClass() + { + return EcorePackage.Literals.EPACKAGE; + } + + @Override + public EReference[] getChildFeatures() + { + return CHILDREN; + } + + @Override + protected String computeLabel(EModelElement element) + { + EPackage ePackage = (EPackage)element; + EPackage eSuperPackage = ePackage.getESuperPackage(); + if (eSuperPackage != null) + { + return computeLabel(eSuperPackage) + "." + ePackage.getName(); + } + + return ePackage.getName(); + } + } + + /** + * @author Eike Stepper + */ + private static final class ClassHandler extends ElementHandler + { + private static final EReference[] CHILDREN = { EcorePackage.Literals.ECLASS__ESTRUCTURAL_FEATURES }; + + @Override + public EClass getEClass() + { + return EcorePackage.Literals.ECLASS; + } + + @Override + public EReference[] getChildFeatures() + { + return CHILDREN; + } + + @Override + protected String computeLabel(EModelElement element) + { + EClass eClass = (EClass)element; + EPackage ePackage = eClass.getEPackage(); + if (ePackage != null) + { + return getLabel(ePackage) + "." + eClass.getName(); + } + + return eClass.getName(); + } + } + + /** + * @author Eike Stepper + */ + private static class AttributeHandler extends ElementHandler + { + @Override + public EClass getEClass() + { + return EcorePackage.Literals.EATTRIBUTE; + } + + @Override + protected String computeLabel(EModelElement element) + { + EAttribute eAttribute = (EAttribute)element; + EClass eClass = eAttribute.getEContainingClass(); + if (eClass != null) + { + return getLabel(eClass) + "." + eAttribute.getName(); + } + + return eAttribute.getName(); + } + } + + /** + * @author Eike Stepper + */ + private static class ReferenceHandler extends ElementHandler + { + @Override + public EClass getEClass() + { + return EcorePackage.Literals.EREFERENCE; + } + + @Override + protected String computeLabel(EModelElement element) + { + EReference eReference = (EReference)element; + EClass eClass = eReference.getEContainingClass(); + if (eClass != null) + { + return getLabel(eClass) + "." + eReference.getName(); + } + + return eReference.getName(); + } + } + + /** + * @author Eike Stepper + */ + private static final class DataTypeHandler extends ElementHandler + { + @Override + public EClass getEClass() + { + return EcorePackage.Literals.EDATA_TYPE; + } + + @Override + protected String computeLabel(EModelElement element) + { + EDataType eDataType = (EDataType)element; + EPackage ePackage = eDataType.getEPackage(); + if (ePackage != null) + { + return getLabel(ePackage) + "." + eDataType.getName(); + } + + return eDataType.getName(); + } + } + + /** + * @author Eike Stepper + */ + private static final class EnumHandler extends ElementHandler + { + private static final EReference[] CHILDREN = { EcorePackage.Literals.EENUM__ELITERALS }; + + @Override + public EClass getEClass() + { + return EcorePackage.Literals.EENUM; + } + + @Override + public EReference[] getChildFeatures() + { + return CHILDREN; + } + + @Override + protected String computeLabel(EModelElement element) + { + EEnum eEnum = (EEnum)element; + EPackage ePackage = eEnum.getEPackage(); + if (ePackage != null) + { + return getLabel(ePackage) + "." + eEnum.getName(); + } + + return eEnum.getName(); + } + } + + /** + * @author Eike Stepper + */ + private static final class EnumLiteralHandler extends ElementHandler + { + @Override + public EClass getEClass() + { + return EcorePackage.Literals.EENUM_LITERAL; + } + + @Override + protected String computeLabel(EModelElement element) + { + EEnumLiteral eLiteral = (EEnumLiteral)element; + EEnum eEnum = eLiteral.getEEnum(); + if (eEnum != null) + { + return getLabel(eEnum) + "." + eLiteral.getName(); + } + + return eLiteral.getName(); + } + } +} diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/ElementRunnable.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/ElementRunnable.java new file mode 100644 index 0000000000..f5907cb02d --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/ElementRunnable.java @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2004-2018 Eike Stepper (Loehne, Germany) and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Eike Stepper - initial API and implementation + */ +package org.eclipse.emf.cdo.evolution.util; + +import org.eclipse.emf.ecore.EModelElement; + +/** + * @author Eike Stepper + */ +public interface ElementRunnable +{ + public void run(EModelElement modelElement); +} diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/EvolutionAdapterFactory.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/EvolutionAdapterFactory.java new file mode 100644 index 0000000000..c9a6d166f7 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/EvolutionAdapterFactory.java @@ -0,0 +1,328 @@ +/** + */ +package org.eclipse.emf.cdo.evolution.util; + +import org.eclipse.emf.cdo.evolution.Change; +import org.eclipse.emf.cdo.evolution.ElementChange; +import org.eclipse.emf.cdo.evolution.Evolution; +import org.eclipse.emf.cdo.evolution.EvolutionPackage; +import org.eclipse.emf.cdo.evolution.FeaturePathMigration; +import org.eclipse.emf.cdo.evolution.Migration; +import org.eclipse.emf.cdo.evolution.Model; +import org.eclipse.emf.cdo.evolution.ModelSet; +import org.eclipse.emf.cdo.evolution.ModelSetChange; +import org.eclipse.emf.cdo.evolution.PropertyChange; +import org.eclipse.emf.cdo.evolution.Release; + +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notifier; +import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; +import org.eclipse.emf.ecore.EObject; + +/** + * <!-- begin-user-doc --> + * The <b>Adapter Factory</b> for the model. + * It provides an adapter <code>createXXX</code> method for each class of the model. + * <!-- end-user-doc --> + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage + * @generated + */ +public class EvolutionAdapterFactory extends AdapterFactoryImpl +{ + /** + * The cached model package. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected static EvolutionPackage modelPackage; + + /** + * Creates an instance of the adapter factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EvolutionAdapterFactory() + { + if (modelPackage == null) + { + modelPackage = EvolutionPackage.eINSTANCE; + } + } + + /** + * Returns whether this factory is applicable for the type of the object. + * <!-- begin-user-doc --> + * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model. + * <!-- end-user-doc --> + * @return whether this factory is applicable for the type of the object. + * @generated + */ + @Override + public boolean isFactoryForType(Object object) + { + if (object == modelPackage) + { + return true; + } + if (object instanceof EObject) + { + return ((EObject)object).eClass().getEPackage() == modelPackage; + } + return false; + } + + /** + * The switch that delegates to the <code>createXXX</code> methods. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected EvolutionSwitch<Adapter> modelSwitch = new EvolutionSwitch<Adapter>() + { + @Override + public Adapter caseModelSet(ModelSet object) + { + return createModelSetAdapter(); + } + + @Override + public Adapter caseModel(Model object) + { + return createModelAdapter(); + } + + @Override + public Adapter caseEvolution(Evolution object) + { + return createEvolutionAdapter(); + } + + @Override + public Adapter caseRelease(Release object) + { + return createReleaseAdapter(); + } + + @Override + public Adapter caseChange(Change object) + { + return createChangeAdapter(); + } + + @Override + public Adapter caseModelSetChange(ModelSetChange object) + { + return createModelSetChangeAdapter(); + } + + @Override + public Adapter caseElementChange(ElementChange object) + { + return createElementChangeAdapter(); + } + + @Override + public Adapter casePropertyChange(PropertyChange object) + { + return createPropertyChangeAdapter(); + } + + @Override + public Adapter caseMigration(Migration object) + { + return createMigrationAdapter(); + } + + @Override + public Adapter caseFeaturePathMigration(FeaturePathMigration object) + { + return createFeaturePathMigrationAdapter(); + } + + @Override + public Adapter defaultCase(EObject object) + { + return createEObjectAdapter(); + } + }; + + /** + * Creates an adapter for the <code>target</code>. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param target the object to adapt. + * @return the adapter for the <code>target</code>. + * @generated + */ + @Override + public Adapter createAdapter(Notifier target) + { + return modelSwitch.doSwitch((EObject)target); + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.evolution.ModelSet <em>Model Set</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * @return the new adapter. + * @see org.eclipse.emf.cdo.evolution.ModelSet + * @generated + */ + public Adapter createModelSetAdapter() + { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.evolution.Model <em>Model</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * @return the new adapter. + * @see org.eclipse.emf.cdo.evolution.Model + * @generated + */ + public Adapter createModelAdapter() + { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.evolution.Evolution <em>Evolution</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * @return the new adapter. + * @see org.eclipse.emf.cdo.evolution.Evolution + * @generated + */ + public Adapter createEvolutionAdapter() + { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.evolution.Release <em>Release</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * @return the new adapter. + * @see org.eclipse.emf.cdo.evolution.Release + * @generated + */ + public Adapter createReleaseAdapter() + { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.evolution.Change <em>Change</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * @return the new adapter. + * @see org.eclipse.emf.cdo.evolution.Change + * @generated + */ + public Adapter createChangeAdapter() + { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.evolution.ModelSetChange <em>Model Set Change</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * @return the new adapter. + * @see org.eclipse.emf.cdo.evolution.ModelSetChange + * @generated + */ + public Adapter createModelSetChangeAdapter() + { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.evolution.ElementChange <em>Element Change</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * @return the new adapter. + * @see org.eclipse.emf.cdo.evolution.ElementChange + * @generated + */ + public Adapter createElementChangeAdapter() + { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.evolution.PropertyChange <em>Property Change</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * @return the new adapter. + * @see org.eclipse.emf.cdo.evolution.PropertyChange + * @generated + */ + public Adapter createPropertyChangeAdapter() + { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.evolution.Migration <em>Migration</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * @return the new adapter. + * @see org.eclipse.emf.cdo.evolution.Migration + * @generated + */ + public Adapter createMigrationAdapter() + { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.evolution.FeaturePathMigration <em>Feature Path Migration</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * @return the new adapter. + * @see org.eclipse.emf.cdo.evolution.FeaturePathMigration + * @generated + */ + public Adapter createFeaturePathMigrationAdapter() + { + return null; + } + + /** + * Creates a new adapter for the default case. + * <!-- begin-user-doc --> + * This default implementation returns null. + * <!-- end-user-doc --> + * @return the new adapter. + * @generated + */ + public Adapter createEObjectAdapter() + { + return null; + } + +} // EvolutionAdapterFactory diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/EvolutionSwitch.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/EvolutionSwitch.java new file mode 100644 index 0000000000..e630b1f7ef --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/EvolutionSwitch.java @@ -0,0 +1,390 @@ +/** + */ +package org.eclipse.emf.cdo.evolution.util; + +import org.eclipse.emf.cdo.evolution.Change; +import org.eclipse.emf.cdo.evolution.ElementChange; +import org.eclipse.emf.cdo.evolution.Evolution; +import org.eclipse.emf.cdo.evolution.EvolutionPackage; +import org.eclipse.emf.cdo.evolution.FeaturePathMigration; +import org.eclipse.emf.cdo.evolution.Migration; +import org.eclipse.emf.cdo.evolution.Model; +import org.eclipse.emf.cdo.evolution.ModelSet; +import org.eclipse.emf.cdo.evolution.ModelSetChange; +import org.eclipse.emf.cdo.evolution.PropertyChange; +import org.eclipse.emf.cdo.evolution.Release; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.util.Switch; + +/** + * <!-- begin-user-doc --> + * The <b>Switch</b> for the model's inheritance hierarchy. + * It supports the call {@link #doSwitch(EObject) doSwitch(object)} + * to invoke the <code>caseXXX</code> method for each class of the model, + * starting with the actual class of the object + * and proceeding up the inheritance hierarchy + * until a non-null result is returned, + * which is the result of the switch. + * <!-- end-user-doc --> + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage + * @generated + */ +public class EvolutionSwitch<T> extends Switch<T> +{ + /** + * The cached model package + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected static EvolutionPackage modelPackage; + + /** + * Creates an instance of the switch. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EvolutionSwitch() + { + if (modelPackage == null) + { + modelPackage = EvolutionPackage.eINSTANCE; + } + } + + /** + * Checks whether this is a switch for the given package. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param ePackage the package in question. + * @return whether this is a switch for the given package. + * @generated + */ + @Override + protected boolean isSwitchFor(EPackage ePackage) + { + return ePackage == modelPackage; + } + + /** + * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the first non-null result returned by a <code>caseXXX</code> call. + * @generated + */ + @Override + protected T doSwitch(int classifierID, EObject theEObject) + { + switch (classifierID) + { + case EvolutionPackage.MODEL_SET: + { + ModelSet modelSet = (ModelSet)theEObject; + T result = caseModelSet(modelSet); + if (result == null) + { + result = defaultCase(theEObject); + } + return result; + } + case EvolutionPackage.MODEL: + { + Model model = (Model)theEObject; + T result = caseModel(model); + if (result == null) + { + result = defaultCase(theEObject); + } + return result; + } + case EvolutionPackage.EVOLUTION: + { + Evolution evolution = (Evolution)theEObject; + T result = caseEvolution(evolution); + if (result == null) + { + result = caseModelSet(evolution); + } + if (result == null) + { + result = defaultCase(theEObject); + } + return result; + } + case EvolutionPackage.RELEASE: + { + Release release = (Release)theEObject; + T result = caseRelease(release); + if (result == null) + { + result = caseModelSet(release); + } + if (result == null) + { + result = defaultCase(theEObject); + } + return result; + } + case EvolutionPackage.CHANGE: + { + Change change = (Change)theEObject; + T result = caseChange(change); + if (result == null) + { + result = defaultCase(theEObject); + } + return result; + } + case EvolutionPackage.MODEL_SET_CHANGE: + { + ModelSetChange modelSetChange = (ModelSetChange)theEObject; + T result = caseModelSetChange(modelSetChange); + if (result == null) + { + result = caseChange(modelSetChange); + } + if (result == null) + { + result = defaultCase(theEObject); + } + return result; + } + case EvolutionPackage.ELEMENT_CHANGE: + { + ElementChange elementChange = (ElementChange)theEObject; + T result = caseElementChange(elementChange); + if (result == null) + { + result = caseChange(elementChange); + } + if (result == null) + { + result = defaultCase(theEObject); + } + return result; + } + case EvolutionPackage.PROPERTY_CHANGE: + { + PropertyChange propertyChange = (PropertyChange)theEObject; + T result = casePropertyChange(propertyChange); + if (result == null) + { + result = caseChange(propertyChange); + } + if (result == null) + { + result = defaultCase(theEObject); + } + return result; + } + case EvolutionPackage.MIGRATION: + { + Migration migration = (Migration)theEObject; + T result = caseMigration(migration); + if (result == null) + { + result = defaultCase(theEObject); + } + return result; + } + case EvolutionPackage.FEATURE_PATH_MIGRATION: + { + FeaturePathMigration featurePathMigration = (FeaturePathMigration)theEObject; + T result = caseFeaturePathMigration(featurePathMigration); + if (result == null) + { + result = caseMigration(featurePathMigration); + } + if (result == null) + { + result = defaultCase(theEObject); + } + return result; + } + default: + return defaultCase(theEObject); + } + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Model Set</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>Model Set</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseModelSet(ModelSet object) + { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Model</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>Model</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseModel(Model object) + { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Evolution</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>Evolution</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseEvolution(Evolution object) + { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Release</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>Release</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseRelease(Release object) + { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Change</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>Change</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseChange(Change object) + { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Model Set Change</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>Model Set Change</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseModelSetChange(ModelSetChange object) + { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Element Change</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>Element Change</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseElementChange(ElementChange object) + { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Property Change</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>Property Change</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T casePropertyChange(PropertyChange object) + { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Migration</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>Migration</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseMigration(Migration object) + { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Feature Path Migration</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>Feature Path Migration</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseFeaturePathMigration(FeaturePathMigration object) + { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>EObject</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch, but this is the last case anyway. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>EObject</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) + * @generated + */ + @Override + public T defaultCase(EObject object) + { + return null; + } + +} // EvolutionSwitch diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/EvolutionValidator.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/EvolutionValidator.java new file mode 100644 index 0000000000..d16997899a --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/EvolutionValidator.java @@ -0,0 +1,1032 @@ +/** + */ +package org.eclipse.emf.cdo.evolution.util; + +import org.eclipse.emf.cdo.evolution.Change; +import org.eclipse.emf.cdo.evolution.ChangeKind; +import org.eclipse.emf.cdo.evolution.ElementChange; +import org.eclipse.emf.cdo.evolution.Evolution; +import org.eclipse.emf.cdo.evolution.EvolutionPackage; +import org.eclipse.emf.cdo.evolution.FeaturePathMigration; +import org.eclipse.emf.cdo.evolution.Migration; +import org.eclipse.emf.cdo.evolution.Model; +import org.eclipse.emf.cdo.evolution.ModelSet; +import org.eclipse.emf.cdo.evolution.ModelSetChange; +import org.eclipse.emf.cdo.evolution.PropertyChange; +import org.eclipse.emf.cdo.evolution.Release; +import org.eclipse.emf.cdo.evolution.impl.EvolutionPlugin; + +import org.eclipse.net4j.util.collection.CollectionUtil; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.common.util.Diagnostic; +import org.eclipse.emf.common.util.DiagnosticChain; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.ResourceLocator; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EModelElement; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.ecore.EcorePackage; +import org.eclipse.emf.ecore.util.EObjectValidator; +import org.eclipse.emf.ecore.util.EcoreUtil.EqualityHelper; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * <!-- begin-user-doc --> + * The <b>Validator</b> for the model. + * <!-- end-user-doc --> + * @see org.eclipse.emf.cdo.evolution.EvolutionPackage + * @generated + */ +public class EvolutionValidator extends EObjectValidator +{ + /** + * The cached model package + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static final EvolutionValidator INSTANCE = new EvolutionValidator(); + + /** + * A constant for the {@link org.eclipse.emf.common.util.Diagnostic#getSource() source} of diagnostic {@link org.eclipse.emf.common.util.Diagnostic#getCode() codes} from this package. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.common.util.Diagnostic#getSource() + * @see org.eclipse.emf.common.util.Diagnostic#getCode() + * @generated + */ + public static final String DIAGNOSTIC_SOURCE = "org.eclipse.emf.cdo.evolution"; + + /** + * A constant with a fixed name that can be used as the base value for additional hand written constants. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + protected static final int GENERATED_DIAGNOSTIC_CODE_COUNT = 0; + + public static final int CODE_NO_MODEL = GENERATED_DIAGNOSTIC_CODE_COUNT + 1; + + public static final int CODE_NO_URI = CODE_NO_MODEL + 1; + + public static final int CODE_NO_RESOURCE_SET = CODE_NO_URI + 1; + + public static final int CODE_RESOURCE_NOT_FOUND = CODE_NO_RESOURCE_SET + 1; + + public static final int CODE_LOAD_PROBLEM = CODE_RESOURCE_NOT_FOUND + 1; + + public static final int CODE_CONTENT_PROBLEM = CODE_LOAD_PROBLEM + 1; + + public static final int CODE_PACKAGE_MISSING = CODE_CONTENT_PROBLEM + 1; + + public static final int CODE_PACKAGE_NOT_UNIQUE = CODE_PACKAGE_MISSING + 1; + + public static final int CODE_NSURI_NOT_UNIQUE = CODE_PACKAGE_NOT_UNIQUE + 1; + + public static final int CODE_NSURI_NOT_CHANGED = CODE_NSURI_NOT_UNIQUE + 1; + + public static final int CODE_ID_ANNOTATION_MISSING = CODE_NSURI_NOT_CHANGED + 1; + + public static final int CODE_ID_WITHOUT_VALUE = CODE_ID_ANNOTATION_MISSING + 1; + + public static final int CODE_ID_NOT_UNIQUE = CODE_ID_WITHOUT_VALUE + 1; + + public static final int CODE_MIGRATION_UNUSED = CODE_ID_NOT_UNIQUE + 1; + + public static final int CODE_FEATURE_PATH_UNKNOWN = CODE_MIGRATION_UNUSED + 1; + + // Insert new codes above. + + public static final int CODE_UNCHANGED = CODE_FEATURE_PATH_UNKNOWN + 1; + + public static final int CODE_RELEASE = CODE_UNCHANGED + 1; + + /** + * A constant with a fixed name that can be used as the base value for additional hand written constants in a derived class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + protected static final int DIAGNOSTIC_CODE_COUNT = CODE_RELEASE; + + /** + * Creates an instance of the switch. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EvolutionValidator() + { + super(); + } + + @Override + public boolean validate_EveryReferenceIsContained(EObject eObject, DiagnosticChain diagnostics, Map<Object, Object> context) + { + return true; + } + + @Override + public boolean validate_EveryProxyResolves(EObject eObject, DiagnosticChain diagnostics, Map<Object, Object> context) + { + return true; + } + + /** + * Returns the package of this validator switch. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EPackage getEPackage() + { + return EvolutionPackage.eINSTANCE; + } + + /** + * Calls <code>validateXXX</code> for the corresponding classifier of the model. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected boolean validateGen(int classifierID, Object value, DiagnosticChain diagnostics, Map<Object, Object> context) + { + switch (classifierID) + { + case EvolutionPackage.MODEL_SET: + return validateModelSet((ModelSet)value, diagnostics, context); + case EvolutionPackage.MODEL: + return validateModel((Model)value, diagnostics, context); + case EvolutionPackage.EVOLUTION: + return validateEvolution((Evolution)value, diagnostics, context); + case EvolutionPackage.RELEASE: + return validateRelease((Release)value, diagnostics, context); + case EvolutionPackage.CHANGE: + return validateChange((Change)value, diagnostics, context); + case EvolutionPackage.MODEL_SET_CHANGE: + return validateModelSetChange((ModelSetChange)value, diagnostics, context); + case EvolutionPackage.ELEMENT_CHANGE: + return validateElementChange((ElementChange)value, diagnostics, context); + case EvolutionPackage.PROPERTY_CHANGE: + return validatePropertyChange((PropertyChange)value, diagnostics, context); + case EvolutionPackage.MIGRATION: + return validateMigration((Migration)value, diagnostics, context); + case EvolutionPackage.FEATURE_PATH_MIGRATION: + return validateFeaturePathMigration((FeaturePathMigration)value, diagnostics, context); + case EvolutionPackage.CHANGE_KIND: + return validateChangeKind((ChangeKind)value, diagnostics, context); + case EvolutionPackage.URI: + return validateURI((URI)value, diagnostics, context); + default: + return true; + } + } + + @Override + protected boolean validate(int classifierID, Object value, DiagnosticChain diagnostics, Map<Object, Object> context) + { + if (diagnostics == null) + { + return true; + } + + if (context == null) + { + return true; + } + + return validateGen(classifierID, value, diagnostics, context); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean validateModelSetGen(ModelSet modelSet, DiagnosticChain diagnostics, Map<Object, Object> context) + { + return validate_EveryDefaultConstraint(modelSet, diagnostics, context); + } + + public boolean validateModelSet(ModelSet modelSet, DiagnosticChain diagnostics, Map<Object, Object> context) + { + if (ValidationContext.isPhase(context, ValidationPhase.RELEASE)) + { + diagnostics.add( + createDiagnostic(Diagnostic.INFO, DIAGNOSTIC_SOURCE, CODE_RELEASE, "_UI_Release_diagnostic", new Object[] {}, new Object[] { modelSet }, context)); + return true; + } + + return validateModelSetGen(modelSet, diagnostics, context); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean validateModel(Model model, DiagnosticChain diagnostics, Map<Object, Object> context) + { + if (!validate_NoCircularContainment(model, diagnostics, context)) + { + return false; + } + boolean result = validate_EveryMultiplicityConforms(model, diagnostics, context); + if (result || diagnostics != null) + { + result &= validate_EveryDataValueConforms(model, diagnostics, context); + } + if (result || diagnostics != null) + { + result &= validate_EveryReferenceIsContained(model, diagnostics, context); + } + if (result || diagnostics != null) + { + result &= validate_EveryBidirectionalReferenceIsPaired(model, diagnostics, context); + } + if (result || diagnostics != null) + { + result &= validate_EveryProxyResolves(model, diagnostics, context); + } + if (result || diagnostics != null) + { + result &= validate_UniqueID(model, diagnostics, context); + } + if (result || diagnostics != null) + { + result &= validate_EveryKeyUnique(model, diagnostics, context); + } + if (result || diagnostics != null) + { + result &= validate_EveryMapEntryUnique(model, diagnostics, context); + } + if (result || diagnostics != null) + { + result &= validateModel_ModelLoaded(model, diagnostics, context); + } + if (result || diagnostics != null) + { + result &= validateModel_IDs_Exist(model, diagnostics, context); + } + if (result || diagnostics != null) + { + result &= validateModel_NamespaceReflectsChange(model, diagnostics, context); + } + return result; + } + + /** + * Validates the ModelLoaded constraint of '<em>Model</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + * @category MODEL_AVAILABILITY + */ + public boolean validateModel_ModelLoaded(Model model, DiagnosticChain diagnostics, Map<Object, Object> context) + { + if (ValidationContext.isPhase(context, ValidationPhase.MODEL_AVAILABILITY)) + { + switch (model.getStatus()) + { + case NO_URI: + diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CODE_NO_URI, "_UI_NO_URI_diagnostic", new Object[] {}, + new Object[] { model, EvolutionPackage.Literals.MODEL__URI }, context)); + return false; + + case NO_RESOURCE_SET: + diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CODE_NO_RESOURCE_SET, "_UI_NO_RESOURCE_SET_diagnostic", new Object[] {}, + new Object[] { model }, context)); + return false; + + case RESOURCE_NOT_FOUND: + diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CODE_RESOURCE_NOT_FOUND, "_UI_RESOURCE_NOT_FOUND_diagnostic", + new Object[] { model.getURI().toString() }, new Object[] { model, EvolutionPackage.Literals.MODEL__URI }, context)); + return false; + + case LOAD_PROBLEM: + diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CODE_RESOURCE_NOT_FOUND, "_UI_LOAD_PROBLEM_diagnostic", + new Object[] { model.getURI().toString() }, new Object[] { model, EvolutionPackage.Literals.MODEL__URI }, context)); + return false; + + case CONTENT_PROBLEM: + diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CODE_CONTENT_PROBLEM, "_UI_CONTENT_PROBLEM_diagnostic", + new Object[] { model.getURI().toString() }, new Object[] { model, EvolutionPackage.Literals.MODEL__URI }, context)); + return false; + } + } + + return true; + } + + /** + * Validates the IDs_Exist constraint of '<em>Model</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + * @category IDENTITY_COMPLETENESS + */ + public boolean validateModel_IDs_Exist(Model model, final DiagnosticChain diagnostics, final Map<Object, Object> context) + { + ValidationContext validationContext = ValidationContext.getFrom(context); + if (validationContext != null && validationContext.getPhase() == ValidationPhase.IDENTITY_COMPLETENESS) + { + final Map<String, Object> identifiedElements = validationContext.getIdentifiedElements(); + EPackage rootPackage = model.getRootPackage(); + + final boolean[] result = { true }; + ElementHandler.execute(rootPackage, new ElementRunnable() + { + public void run(EModelElement modelElement) + { + if (IDAnnotation.getFrom(modelElement, false) == null) + { + diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CODE_ID_ANNOTATION_MISSING, "_UI_IDsExist_AnnotationMissing_diagnostic", + new Object[] {}, new Object[] { modelElement, EcorePackage.Literals.EMODEL_ELEMENT__EANNOTATIONS }, context)); + result[0] = false; + } + else + { + String value = IDAnnotation.getValue(modelElement); + if (value == null) + { + diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CODE_ID_WITHOUT_VALUE, "_UI_IDsExist_NoValue_diagnostic", new Object[] {}, + new Object[] { modelElement, EcorePackage.Literals.EMODEL_ELEMENT__EANNOTATIONS }, context)); + result[0] = false; + } + else + { + Object element = identifiedElements.get(value); + if (element == null) + { + identifiedElements.put(value, modelElement); + } + else if (element instanceof List<?>) + { + @SuppressWarnings("unchecked") + List<EModelElement> elements = (List<EModelElement>)element; + elements.add(modelElement); + } + else + { + List<EModelElement> elements = new ArrayList<EModelElement>(); + elements.add((EModelElement)element); + elements.add(modelElement); + identifiedElements.put(value, elements); + } + } + } + } + }); + + return result[0]; + } + return true; + } + + /** + * Validates the NamespaceReflectsChange constraint of '<em>Model</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + * @category MODEL_UNIQUENESS + */ + public boolean validateModel_NamespaceReflectsChange(Model model, DiagnosticChain diagnostics, Map<Object, Object> context) + { + if (ValidationContext.isPhase(context, ValidationPhase.MODEL_UNIQUENESS)) + { + Evolution evolution = model.getEvolution(); + if (evolution.isUniqueNamespaces()) + { + Map<String, Set<EPackage>> releasedPackages = evolution.getReleasedPackages(); + boolean result = true; + + for (EPackage ePackage : model.getAllPackages()) + { + Set<EPackage> set = releasedPackages.get(ePackage.getNsURI()); + if (set != null) + { + for (EPackage releasedPackage : set) + { + EqualityHelper equalityHelper = new EqualityHelper() + { + private static final long serialVersionUID = 1L; + + @Override + protected boolean haveEqualFeature(EObject eObject1, EObject eObject2, EStructuralFeature feature) + { + if (feature == EcorePackage.Literals.EPACKAGE__ESUBPACKAGES) + { + // Compare packages without their subpackages. + return true; + } + + return super.haveEqualFeature(eObject1, eObject2, feature); + } + }; + + if (!equalityHelper.equals(ePackage, releasedPackage)) + { + Release release = (Release)ElementHandler.getModelSet(releasedPackage); + + diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CODE_NSURI_NOT_CHANGED, "_UI_NsUriMustChange_diagnostic", + new Object[] { ePackage.getNsURI(), release.getVersion() }, + new Object[] { ePackage, EcorePackage.Literals.EPACKAGE__NS_URI, releasedPackage, evolution }, context)); + result = false; + break; + } + } + } + } + + return result; + } + } + + return true; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean validateEvolutionGen(Evolution evolution, DiagnosticChain diagnostics, Map<Object, Object> context) + { + if (!validate_NoCircularContainment(evolution, diagnostics, context)) + { + return false; + } + boolean result = validate_EveryMultiplicityConforms(evolution, diagnostics, context); + if (result || diagnostics != null) + { + result &= validate_EveryDataValueConforms(evolution, diagnostics, context); + } + if (result || diagnostics != null) + { + result &= validate_EveryReferenceIsContained(evolution, diagnostics, context); + } + if (result || diagnostics != null) + { + result &= validate_EveryBidirectionalReferenceIsPaired(evolution, diagnostics, context); + } + if (result || diagnostics != null) + { + result &= validate_EveryProxyResolves(evolution, diagnostics, context); + } + if (result || diagnostics != null) + { + result &= validate_UniqueID(evolution, diagnostics, context); + } + if (result || diagnostics != null) + { + result &= validate_EveryKeyUnique(evolution, diagnostics, context); + } + if (result || diagnostics != null) + { + result &= validate_EveryMapEntryUnique(evolution, diagnostics, context); + } + if (result || diagnostics != null) + { + result &= validateEvolution_NotEmpty(evolution, diagnostics, context); + } + if (result || diagnostics != null) + { + result &= validateEvolution_PackagesUnique(evolution, diagnostics, context); + } + if (result || diagnostics != null) + { + result &= validateEvolution_NoMissingPackages(evolution, diagnostics, context); + } + if (result || diagnostics != null) + { + result &= validateEvolution_IDsUnique(evolution, diagnostics, context); + } + return result; + } + + public boolean validateEvolution(Evolution evolution, DiagnosticChain diagnostics, Map<Object, Object> context) + { + if (ValidationContext.isPhase(context, ValidationPhase.RELEASE)) + { + ModelSetChange change = evolution.getChange(); + + if (change == null || change.getChildren().isEmpty()) + { + Release latestRelease = evolution.getLatestRelease(); + if (latestRelease == null) + { + diagnostics.add(createDiagnostic(Diagnostic.INFO, DIAGNOSTIC_SOURCE, CODE_UNCHANGED, "_UI_Unchanged_diagnostic", new Object[] {}, + new Object[] { evolution }, context)); + } + else + { + diagnostics.add(createDiagnostic(Diagnostic.INFO, DIAGNOSTIC_SOURCE, CODE_UNCHANGED, "_UI_UnchangedSince_diagnostic", + new Object[] { latestRelease.getVersion() }, new Object[] { evolution }, context)); + } + } + else + { + diagnostics.add( + createDiagnostic(Diagnostic.INFO, DIAGNOSTIC_SOURCE, CODE_RELEASE, "_UI_Release_diagnostic", new Object[] {}, new Object[] { evolution }, context)); + } + return true; + } + + return validateEvolutionGen(evolution, diagnostics, context); + } + + /** + * Validates the NotEmpty constraint of '<em>Evolution</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + * @category MODEL_AVAILABILITY + */ + public boolean validateEvolution_NotEmpty(Evolution evolution, DiagnosticChain diagnostics, Map<Object, Object> context) + { + if (ValidationContext.isPhase(context, ValidationPhase.MODEL_AVAILABILITY)) + { + if (evolution.getModels().isEmpty()) + { + diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CODE_NO_MODEL, "_UI_NoModel_diagnostic", new Object[] {}, + new Object[] { evolution }, context)); + return false; + } + } + + return true; + } + + /** + * Validates the PackagesUnique constraint of '<em>Evolution</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + * @category MODEL_UNIQUENESS + */ + public boolean validateEvolution_PackagesUnique(Evolution evolution, DiagnosticChain diagnostics, Map<Object, Object> context) + { + if (ValidationContext.isPhase(context, ValidationPhase.MODEL_UNIQUENESS)) + { + boolean result = true; + + Map<URI, Set<Model>> models = new HashMap<URI, Set<Model>>(); + for (Model model : evolution.getModels()) + { + CollectionUtil.add(models, model.getURI(), model); + } + + for (Set<Model> set : models.values()) + { + if (set.size() > 1) + { + for (Model model : set) + { + diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CODE_PACKAGE_NOT_UNIQUE, "_UI_PackageNotUnique_diagnostic", + new Object[] { model.getURI().toString() }, new Object[] { model, EvolutionPackage.Literals.MODEL__URI, model.getURI() }, context)); + result = false; + } + } + } + + Map<String, Set<EPackage>> packages = new HashMap<String, Set<EPackage>>(); + for (EPackage ePackage : evolution.getAllPackages()) + { + CollectionUtil.add(packages, ePackage.getNsURI(), ePackage); + } + + for (Set<EPackage> set : packages.values()) + { + if (set.size() > 1) + { + for (EPackage ePackage : set) + { + diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CODE_NSURI_NOT_UNIQUE, "_UI_NsuriNotUnique_diagnostic", + new Object[] { ePackage.getNsURI() }, new Object[] { ePackage, EcorePackage.Literals.EPACKAGE__NS_URI, ePackage.getNsURI() }, context)); + result = false; + } + } + } + + return result; + } + + return true; + } + + /** + * Validates the NoMissingPackages constraint of '<em>Evolution</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + * @category MODEL_INTEGRITY + */ + public boolean validateEvolution_NoMissingPackages(Evolution evolution, DiagnosticChain diagnostics, Map<Object, Object> context) + { + if (ValidationContext.isPhase(context, ValidationPhase.MODEL_INTEGRITY)) + { + EList<EPackage> missingPackages = evolution.getMissingPackages(); + if (missingPackages.size() != 0) + { + for (EPackage missingPackage : missingPackages) + { + diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CODE_PACKAGE_MISSING, "_UI_MissingPackage_diagnostic", + new Object[] { missingPackage.getName() }, new Object[] { evolution, EvolutionPackage.Literals.EVOLUTION__MISSING_PACKAGES, missingPackage }, + context)); + } + + return false; + } + } + + return true; + } + + /** + * Validates the IDsUnique constraint of '<em>Evolution</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + * @category IDENTITY_UNIQUENESS + */ + public boolean validateEvolution_IDsUnique(Evolution evolution, DiagnosticChain diagnostics, Map<Object, Object> context) + { + // TODO Validate oldValue. + // TODO Validate oldElement.eClass() == newElement.eClass(). + int xxx; + + ValidationContext validationContext = ValidationContext.getFrom(context); + if (validationContext != null && validationContext.getPhase() == ValidationPhase.IDENTITY_UNIQUENESS) + { + boolean result = true; + for (Map.Entry<String, Object> entry : validationContext.getIdentifiedElements().entrySet()) + { + Object element = entry.getValue(); + if (element instanceof List<?>) + { + String id = entry.getKey(); + + @SuppressWarnings("unchecked") + List<EModelElement> elements = (List<EModelElement>)element; + for (EModelElement modelElement : elements) + { + List<Object> data = new ArrayList<Object>(); + data.add(modelElement); + data.add(EcorePackage.Literals.EMODEL_ELEMENT__EANNOTATIONS); + data.add(id); + + for (EModelElement conflictingElement : elements) + { + if (conflictingElement != modelElement) + { + data.add(conflictingElement); + } + } + + diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CODE_ID_NOT_UNIQUE, "_UI_IDNotUnique_diagnostic", new Object[] { id }, + data.toArray(new Object[data.size()]), context)); + result = false; + } + } + } + + return result; + } + + return true; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean validateRelease(Release release, DiagnosticChain diagnostics, Map<Object, Object> context) + { + return validate_EveryDefaultConstraint(release, diagnostics, context); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean validateChange(Change change, DiagnosticChain diagnostics, Map<Object, Object> context) + { + return validate_EveryDefaultConstraint(change, diagnostics, context); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean validateModelSetChange(ModelSetChange modelSetChange, DiagnosticChain diagnostics, Map<Object, Object> context) + { + return validate_EveryDefaultConstraint(modelSetChange, diagnostics, context); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean validateElementChange(ElementChange elementChange, DiagnosticChain diagnostics, Map<Object, Object> context) + { + if (!validate_NoCircularContainment(elementChange, diagnostics, context)) + { + return false; + } + boolean result = validate_EveryMultiplicityConforms(elementChange, diagnostics, context); + if (result || diagnostics != null) + { + result &= validate_EveryDataValueConforms(elementChange, diagnostics, context); + } + if (result || diagnostics != null) + { + result &= validate_EveryReferenceIsContained(elementChange, diagnostics, context); + } + if (result || diagnostics != null) + { + result &= validate_EveryBidirectionalReferenceIsPaired(elementChange, diagnostics, context); + } + if (result || diagnostics != null) + { + result &= validate_EveryProxyResolves(elementChange, diagnostics, context); + } + if (result || diagnostics != null) + { + result &= validate_UniqueID(elementChange, diagnostics, context); + } + if (result || diagnostics != null) + { + result &= validate_EveryKeyUnique(elementChange, diagnostics, context); + } + if (result || diagnostics != null) + { + result &= validate_EveryMapEntryUnique(elementChange, diagnostics, context); + } + if (result || diagnostics != null) + { + result &= validateElementChange_FeaturePathIsKnown(elementChange, diagnostics, context); + } + return result; + } + + /** + * Validates the FeaturePathIsKnown constraint of '<em>Element Change</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + * @category CHANGE_VALIDITY + */ + public boolean validateElementChange_FeaturePathIsKnown(ElementChange elementChange, DiagnosticChain diagnostics, Map<Object, Object> context) + { + ValidationContext validationContext = ValidationContext.getFrom(context); + if (validationContext != null && validationContext.getPhase() == ValidationPhase.CHANGE_VALIDITY) + { + ChangeKind kind = elementChange.getKind(); + if (kind == ChangeKind.COPIED || kind == ChangeKind.MOVED) + { + EModelElement newElement = elementChange.getNewElement(); + if (newElement instanceof EStructuralFeature) + { + EStructuralFeature newFeature = (EStructuralFeature)newElement; + EStructuralFeature oldFeature = (EStructuralFeature)elementChange.getOldElement(); + + EClass newContainingClass = newFeature.getEContainingClass(); + EClass oldContainingClass = oldFeature.getEContainingClass(); + if (elementChange.getOldElementFor(newContainingClass) != oldContainingClass) + { + BasicDiagnostic diagnostic = createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CODE_FEATURE_PATH_UNKNOWN, "_UI_FeaturePathIsKnown_diagnostic", + new Object[] { ElementHandler.getLabel(newFeature), kind.getName().toLowerCase(), ElementHandler.getLabel(oldFeature) }, + new Object[] { elementChange, newFeature }, context); + + Evolution evolution = validationContext.getEvolution(); + DiagnosticID diagnosticID = DiagnosticID.get(diagnostic); + + Migration migration = evolution.getMigration(diagnosticID.getValue()); + if (migration != null) + { + validationContext.getUsedMigrations().put(diagnosticID, migration); + return true; + } + + diagnostics.add(diagnostic); + return false; + } + } + } + } + + return true; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean validatePropertyChange(PropertyChange propertyChange, DiagnosticChain diagnostics, Map<Object, Object> context) + { + return validate_EveryDefaultConstraint(propertyChange, diagnostics, context); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean validateMigration(Migration migration, DiagnosticChain diagnostics, Map<Object, Object> context) + { + if (!validate_NoCircularContainment(migration, diagnostics, context)) + { + return false; + } + boolean result = validate_EveryMultiplicityConforms(migration, diagnostics, context); + if (result || diagnostics != null) + { + result &= validate_EveryDataValueConforms(migration, diagnostics, context); + } + if (result || diagnostics != null) + { + result &= validate_EveryReferenceIsContained(migration, diagnostics, context); + } + if (result || diagnostics != null) + { + result &= validate_EveryBidirectionalReferenceIsPaired(migration, diagnostics, context); + } + if (result || diagnostics != null) + { + result &= validate_EveryProxyResolves(migration, diagnostics, context); + } + if (result || diagnostics != null) + { + result &= validate_UniqueID(migration, diagnostics, context); + } + if (result || diagnostics != null) + { + result &= validate_EveryKeyUnique(migration, diagnostics, context); + } + if (result || diagnostics != null) + { + result &= validate_EveryMapEntryUnique(migration, diagnostics, context); + } + if (result || diagnostics != null) + { + result &= validateMigration_NotObsolete(migration, diagnostics, context); + } + return result; + } + + /** + * Validates the NotObsolete constraint of '<em>Migration</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + * @category MIGRATION_OBSOLETENESS + */ + public boolean validateMigration_NotObsolete(Migration migration, DiagnosticChain diagnostics, Map<Object, Object> context) + { + ValidationContext validationContext = ValidationContext.getFrom(context); + if (validationContext != null && validationContext.getPhase() == ValidationPhase.MIGRATION_OBSOLETENESS) + { + String idValue = migration.getDiagnosticID(); + if (idValue != null && idValue.length() != 0) + { + DiagnosticID diagnosticID = new DiagnosticID(idValue); + if (!validationContext.getUsedMigrations().containsKey(diagnosticID)) + { + diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CODE_MIGRATION_UNUSED, "_UI_MigrationUnused_diagnostic", + new Object[] { migration }, new Object[] { migration, diagnosticID }, context)); + return false; + } + } + } + + return true; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean validateFeaturePathMigration(FeaturePathMigration featurePathMigration, DiagnosticChain diagnostics, Map<Object, Object> context) + { + if (!validate_NoCircularContainment(featurePathMigration, diagnostics, context)) + { + return false; + } + boolean result = validate_EveryMultiplicityConforms(featurePathMigration, diagnostics, context); + if (result || diagnostics != null) + { + result &= validate_EveryDataValueConforms(featurePathMigration, diagnostics, context); + } + if (result || diagnostics != null) + { + result &= validate_EveryReferenceIsContained(featurePathMigration, diagnostics, context); + } + if (result || diagnostics != null) + { + result &= validate_EveryBidirectionalReferenceIsPaired(featurePathMigration, diagnostics, context); + } + if (result || diagnostics != null) + { + result &= validate_EveryProxyResolves(featurePathMigration, diagnostics, context); + } + if (result || diagnostics != null) + { + result &= validate_UniqueID(featurePathMigration, diagnostics, context); + } + if (result || diagnostics != null) + { + result &= validate_EveryKeyUnique(featurePathMigration, diagnostics, context); + } + if (result || diagnostics != null) + { + result &= validate_EveryMapEntryUnique(featurePathMigration, diagnostics, context); + } + if (result || diagnostics != null) + { + result &= validateMigration_NotObsolete(featurePathMigration, diagnostics, context); + } + if (result || diagnostics != null) + { + result &= validateFeaturePathMigration_NewFeatureReachable(featurePathMigration, diagnostics, context); + } + return result; + } + + /** + * Validates the NewFeatureReachable constraint of '<em>Feature Path Migration</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + * @category MIGRATION_VALIDITY + */ + public boolean validateFeaturePathMigration_NewFeatureReachable(FeaturePathMigration featurePathMigration, DiagnosticChain diagnostics, + Map<Object, Object> context) + { + if (ValidationContext.isPhase(context, ValidationPhase.MIGRATION_VALIDITY)) + { + } + // TODO implement the constraint + // -> specify the condition that violates the constraint + // -> verify the diagnostic details, including severity, code, and message + // Ensure that you remove @generated or mark it @generated NOT + if (false) + { + if (diagnostics != null) + { + diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, 0, "_UI_GenericConstraint_diagnostic", + new Object[] { "NewFeatureReachable", getObjectLabel(featurePathMigration, context) }, new Object[] { featurePathMigration }, context)); + } + return false; + } + return true; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean validateChangeKind(ChangeKind changeKind, DiagnosticChain diagnostics, Map<Object, Object> context) + { + return true; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean validateURI(URI uri, DiagnosticChain diagnostics, Map<Object, Object> context) + { + return true; + } + + /** + * Returns the resource locator that will be used to fetch messages for this validator's diagnostics. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public ResourceLocator getResourceLocator() + { + return EvolutionPlugin.INSTANCE; + } + +} // EvolutionValidator diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/IDAnnotation.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/IDAnnotation.java new file mode 100644 index 0000000000..961921345c --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/IDAnnotation.java @@ -0,0 +1,151 @@ +/* + * Copyright (c) 2004-2018 Eike Stepper (Loehne, Germany) and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Eike Stepper - initial API and implementation + */ +package org.eclipse.emf.cdo.evolution.util; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.EMap; +import org.eclipse.emf.ecore.EAnnotation; +import org.eclipse.emf.ecore.EModelElement; +import org.eclipse.emf.ecore.EcoreFactory; +import org.eclipse.emf.ecore.util.EcoreUtil; + +import java.util.ListIterator; + +/** + * @author Eike Stepper + */ +public class IDAnnotation +{ + public static final String SOURCE = "http://www.eclipse.org/CDO/evolution/ID"; + + public static final String VALUE_KEY = "value"; + + public static final String OLD_VALUE_KEY = "oldValue"; + + public static EAnnotation getFrom(EModelElement element, boolean createOnDemand) + { + EList<EAnnotation> annotations = element.getEAnnotations(); + for (ListIterator<EAnnotation> it = annotations.listIterator(); it.hasNext();) + { + EAnnotation annotation = it.next(); + if (SOURCE.equals(annotation.getSource())) + { + return annotation; + } + } + + if (createOnDemand) + { + EAnnotation annotation = EcoreFactory.eINSTANCE.createEAnnotation(); + annotation.setSource(IDAnnotation.SOURCE); + annotations.add(annotation); + return annotation; + } + + return null; + } + + public static boolean removeFrom(EModelElement element) + { + boolean removed = false; + + for (ListIterator<EAnnotation> it = element.getEAnnotations().listIterator(); it.hasNext();) + { + EAnnotation annotation = it.next(); + if (IDAnnotation.SOURCE.equals(annotation.getSource())) + { + it.remove(); + removed = true; + } + } + + return removed; + } + + public static String getOldValue(EModelElement element) + { + EAnnotation annotation = getFrom(element, false); + if (annotation != null) + { + return annotation.getDetails().get(OLD_VALUE_KEY); + } + + return null; + } + + public static String setOldValue(EModelElement element, String oldValue) + { + EAnnotation annotation = getFrom(element, true); + if (oldValue == null || oldValue.length() == 0) + { + oldValue = annotation.getDetails().get(OLD_VALUE_KEY); + annotation.getDetails().remove(OLD_VALUE_KEY); + return oldValue; + } + + return annotation.getDetails().put(OLD_VALUE_KEY, oldValue); + } + + public static String getValue(EModelElement element) + { + return getValue(element, false); + } + + public static String getValue(EModelElement element, boolean considerOldValue) + { + EAnnotation annotation = getFrom(element, false); + if (annotation != null) + { + EMap<String, String> details = annotation.getDetails(); + if (considerOldValue) + { + String oldValue = details.get(OLD_VALUE_KEY); + if (oldValue != null && oldValue.length() != 0) + { + return oldValue; + } + } + + return details.get(VALUE_KEY); + } + + return null; + } + + public static String setValue(EModelElement element, String value) + { + EAnnotation annotation = getFrom(element, true); + if (value == null || value.length() == 0) + { + value = annotation.getDetails().get(VALUE_KEY); + annotation.getDetails().remove(VALUE_KEY); + return value; + } + + return annotation.getDetails().put(VALUE_KEY, value); + } + + public static String ensureValue(EModelElement element) + { + EAnnotation annotation = getFrom(element, true); + EMap<String, String> details = annotation.getDetails(); + + String value = details.get(VALUE_KEY); + if (value != null && value.length() != 0) + { + return null; + } + + value = EcoreUtil.generateUUID(); + details.put(VALUE_KEY, value); + return value; + } +} diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/ValidationContext.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/ValidationContext.java new file mode 100644 index 0000000000..002f90a3c2 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/ValidationContext.java @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2004-2018 Eike Stepper (Loehne, Germany) and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Eike Stepper - initial API and implementation + */ +package org.eclipse.emf.cdo.evolution.util; + +import org.eclipse.emf.cdo.evolution.Evolution; +import org.eclipse.emf.cdo.evolution.Migration; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.resource.Resource; + +import java.util.HashMap; +import java.util.Map; + +/** + * @author Eike Stepper + */ +public final class ValidationContext +{ + private static final String KEY = ValidationContext.class.getName(); + + private final Evolution evolution; + + private ValidationPhase phase; + + private final Map<Resource, BasicDiagnostic> resourceDiagnostics = new HashMap<Resource, BasicDiagnostic>(); + + private final Map<String, Object> identifiedElements = new HashMap<String, Object>(); + + private final Map<DiagnosticID, Migration> usedMigrations = new HashMap<DiagnosticID, Migration>(); + + public ValidationContext(Evolution evolution) + { + this.evolution = evolution; + phase = ValidationPhase.values()[0]; + } + + public Evolution getEvolution() + { + return evolution; + } + + public ValidationPhase getPhase() + { + return phase; + } + + public void setPhase(ValidationPhase phase) + { + this.phase = phase; + } + + public Map<Resource, BasicDiagnostic> getResourceDiagnostics() + { + return resourceDiagnostics; + } + + public Map<String, Object> getIdentifiedElements() + { + return identifiedElements; + } + + public Map<DiagnosticID, Migration> getUsedMigrations() + { + return usedMigrations; + } + + public void putInto(Map<Object, Object> context) + { + context.put(KEY, this); + } + + public static ValidationContext getFrom(Map<Object, Object> context) + { + Object contextObject = context.get(KEY); + if (contextObject instanceof ValidationContext) + { + return (ValidationContext)contextObject; + } + + return null; + } + + public static void removeFrom(Map<Object, Object> context) + { + context.remove(KEY); + } + + public static boolean isPhase(Map<Object, Object> context, ValidationPhase phase) + { + ValidationContext validationContext = getFrom(context); + return validationContext != null && validationContext.getPhase() == phase; + } +} diff --git a/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/ValidationPhase.java b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/ValidationPhase.java new file mode 100644 index 0000000000..1b2c86cbaf --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.evolution/src/org/eclipse/emf/cdo/evolution/util/ValidationPhase.java @@ -0,0 +1,191 @@ +/* + * Copyright (c) 2004-2018 Eike Stepper (Loehne, Germany) and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Eike Stepper - initial API and implementation + */ +package org.eclipse.emf.cdo.evolution.util; + +import org.eclipse.emf.cdo.evolution.Change; +import org.eclipse.emf.cdo.evolution.Evolution; +import org.eclipse.emf.cdo.evolution.Migration; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.util.Diagnostician; +import org.eclipse.emf.ecore.util.EcoreUtil; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +/** + * @author Eike Stepper + */ +public enum ValidationPhase +{ + MODEL_AVAILABILITY + { + @Override + public List<? extends EObject> getContentsToValidate(Diagnostician diagnostician, Evolution evolution, EObject eObject, Map<Object, Object> context) + { + if (eObject == evolution) + { + return evolution.getModels(); + } + + return Collections.emptyList(); + } + }, + + MODEL_UNIQUENESS + { + @Override + public List<? extends EObject> getContentsToValidate(Diagnostician diagnostician, Evolution evolution, EObject eObject, Map<Object, Object> context) + { + if (eObject == evolution) + { + return evolution.getModels(); + } + + return Collections.emptyList(); + } + }, + + MODEL_INTEGRITY + { + @Override + public List<? extends EObject> getContentsToValidate(Diagnostician diagnostician, Evolution evolution, EObject eObject, Map<Object, Object> context) + { + return Collections.emptyList(); + } + }, + + MODEL_VALIDITY + { + @Override + public List<? extends EObject> getContentsToValidate(Diagnostician diagnostician, Evolution evolution, EObject eObject, Map<Object, Object> context) + { + if (eObject == evolution) + { + return evolution.getRootPackages(); + } + + if (isPackageElement(evolution, eObject)) + { + return super.getContentsToValidate(diagnostician, evolution, eObject, context); + } + + return Collections.emptyList(); + } + }, + + IDENTITY_COMPLETENESS + { + @Override + public List<? extends EObject> getContentsToValidate(Diagnostician diagnostician, Evolution evolution, EObject eObject, Map<Object, Object> context) + { + return MODEL_AVAILABILITY.getContentsToValidate(diagnostician, evolution, eObject, context); + } + }, + + IDENTITY_UNIQUENESS + { + @Override + public List<? extends EObject> getContentsToValidate(Diagnostician diagnostician, Evolution evolution, EObject eObject, Map<Object, Object> context) + { + return Collections.emptyList(); + } + }, + + CHANGE_VALIDITY + { + @Override + public List<? extends EObject> getContentsToValidate(Diagnostician diagnostician, Evolution evolution, EObject eObject, Map<Object, Object> context) + { + if (eObject == evolution) + { + return Collections.singletonList(evolution.getChange()); + } + + if (eObject instanceof Change) + { + Change change = (Change)eObject; + if (EcoreUtil.isAncestor(evolution.getChange(), change)) + { + return change.getChildren(); + } + } + + return Collections.emptyList(); + } + }, + + MIGRATION_OBSOLETENESS + { + @Override + public List<? extends EObject> getContentsToValidate(Diagnostician diagnostician, Evolution evolution, EObject eObject, Map<Object, Object> context) + { + if (eObject == evolution) + { + return evolution.getMigrations(); + } + + return Collections.emptyList(); + } + }, + + MIGRATION_VALIDITY + { + @Override + public List<? extends EObject> getContentsToValidate(Diagnostician diagnostician, Evolution evolution, EObject eObject, Map<Object, Object> context) + { + if (eObject == evolution) + { + return evolution.getMigrations(); + } + + if (eObject instanceof Migration) + { + return super.getContentsToValidate(diagnostician, evolution, eObject, context); + } + + return Collections.emptyList(); + } + }, + + RELEASE + { + @Override + public List<? extends EObject> getContentsToValidate(Diagnostician diagnostician, Evolution evolution, EObject eObject, Map<Object, Object> context) + { + return Collections.emptyList(); + } + }; + + public static final List<ValidationPhase> ALL = Arrays.asList(ValidationPhase.values()); + + public List<? extends EObject> getContentsToValidate(Diagnostician diagnostician, Evolution evolution, EObject eObject, Map<Object, Object> context) + { + return eObject.eContents(); + } + + private static boolean isPackageElement(Evolution evolution, EObject eObject) + { + EObject rootContainer = EcoreUtil.getRootContainer(eObject); + for (EPackage rootPackage : evolution.getRootPackages()) + { + if (rootContainer == rootPackage) + { + return true; + } + } + + return false; + } +} |