org.eclipse.uml2.uml.util
Class UMLUtil.PackageMerger

java.lang.Object
  extended byjava.util.AbstractMap
      extended byjava.util.HashMap
          extended byorg.eclipse.emf.ecore.util.EcoreUtil.Copier
              extended byorg.eclipse.uml2.uml.util.UMLUtil.PackageMerger
All Implemented Interfaces:
Cloneable, Map, Serializable
Enclosing class:
UMLUtil

public static class UMLUtil.PackageMerger
extends EcoreUtil.Copier

A copier that merges the contents of packages involved in package merge relationships based on the rules defined in the UML specification.

See Also:
Serialized Form

Nested Class Summary
protected  class UMLUtil.PackageMerger.BodyMatcher
           
protected  class UMLUtil.PackageMerger.KeyMatcher
           
protected  class UMLUtil.PackageMerger.NameMatcher
           
protected  class UMLUtil.PackageMerger.ResultingQNameMatcher
           
protected  class UMLUtil.PackageMerger.SourceMatcher
           
protected  class UMLUtil.PackageMerger.StringValueMatcher
           
protected  class UMLUtil.PackageMerger.TypeMatcher
           
 
Field Summary
static int ASSOCIATION_SPECIALIZATION
          The diagnostic code for cases where an association specialization is missing.
static int CAPABILITY
          The diagnostic code for cases where capability information is missing.
static int DIFFERENT_PROPERTY_STATICITY
          The diagnostic code for cases where the staticity of merged properties does not match.
static int DIFFERENT_PROPERTY_UNIQUENESS
          The diagnostic code for cases where the uniqueness of merged properties does not match.
static int EMPTY_UNION
          The diagnostic code for cases where an empty union is detected.
static int IMPLICIT_REDEFINITION
          The diagnostic code for cases where an implicit redefinition is detected.
static int INVALID_REDEFINITION
          The diagnostic code for cases where an invalid redefinition is detected.
static int INVALID_SUBSET
          The diagnostic code for cases where an invalid subset is detected.
protected  Collection mergedPackages
           
static String OPTION__ASSOCIATION_SPECIALIZATIONS
          The option for handling cases where an association specialization is missing.
static String OPTION__CAPABILITIES
          The option for handling cases where capability information is missing.
static String OPTION__DIFFERENT_PROPERTY_STATICITY
          The option for handling cases where the staticity of merged properties does not match.
static String OPTION__DIFFERENT_PROPERTY_UNIQUENESS
          The option for handling cases where the uniqueness of merged properties does not match.
static String OPTION__EMPTY_UNIONS
          The option for handling cases where an empty union is detected.
static String OPTION__IMPLICIT_REDEFINITIONS
          The option for handling cases where an implicit redefinition is detected.
static String OPTION__INVALID_REDEFINITIONS
          The option for handling cases where an invalid redefinition is detected.
static String OPTION__INVALID_SUBSETS
          The option for handling cases where an invalid subset is detected.
static String OPTION__REDUNDANT_GENERALIZATIONS
          The option for handling cases where a redundant generalization is detected.
protected  Package receivingPackage
           
static int REDUNDANT_GENERALIZATION
          The diagnostic code for cases where a redundant generalization is detected.
protected  Map resultingToMergedEObjectMap
           
 
Fields inherited from class org.eclipse.emf.ecore.util.EcoreUtil.Copier
resolveProxies
 
Constructor Summary
UMLUtil.PackageMerger()
           
 
Method Summary
 void clear()
           
 boolean containsKey(Object key)
           
 boolean containsValue(Object value)
           
 EObject copy(EObject eObject)
           
 Collection copyAll(Collection eObjects)
           
protected  void copyAttribute(EAttribute eAttribute, EObject eObject, EObject copyEObject)
           
protected  void copyContainment(EReference eReference, EObject eObject, EObject copyEObject)
           
protected  void copyReference(EReference eReference, EObject eObject, EObject copyEObject)
           
protected  EObject createCopy(EObject eObject)
           
 Set entrySet()
           
 Object get(Object key)
           
protected  Collection getAllMergedPackages(Package package_)
           
protected  List getMatchCandidates(EObject eObject)
           
protected  List getMergedEObjects(EObject resultingEObject)
           
protected  EObject getPreviouslyMergedEObject(EObject resultingEObject)
           
protected  String getResultingQName(EObject eObject)
           
 boolean isEmpty()
           
 Set keySet()
           
 void merge(Package package_, Map options, DiagnosticChain diagnostics, Map context)
          Merges the contents of (all of) the packages merged by the specified package using the specified options, reporting problems to the specified diagnostics, within the specified context.
protected  void mergeAssociation_IsDerived(Association receivingAssociation, Association mergedAssociation)
           
protected  void mergeClassifier_IsAbstract(Classifier receivingClassifier, Classifier mergedClassifier)
           
protected  void mergeLiteralInteger_Value(LiteralInteger receivingLiteralInteger, LiteralInteger mergedLiteralInteger)
           
protected  void mergeLiteralUnlimitedNatural_Value(LiteralUnlimitedNatural receivingLiteralUnlimitedNatural, LiteralUnlimitedNatural mergedLiteralUnlimitedNatural)
           
protected  void mergeMultiplicityElement_IsOrdered(MultiplicityElement receivingMultiplicityElement, MultiplicityElement mergedMultiplicityElement)
           
protected  void mergeMultiplicityElement_IsUnique(MultiplicityElement receivingMultiplicityElement, MultiplicityElement mergedMultiplicityElement)
           
protected  void mergeNamedElement_Visibility(NamedElement receivingNamedElement, NamedElement mergedNamedElement)
           
protected  void mergeProperty_IsDerived(Property receivingProperty, Property mergedProperty)
           
protected  void mergeProperty_IsDerivedUnion(Property receivingProperty, Property mergedProperty)
           
protected  void mergeStructuralFeature_IsReadOnly(StructuralFeature receivingStructuralFeature, StructuralFeature mergedStructuralFeature)
           
protected  void mergeTypedElement_Type(TypedElement receivingTypedElement, TypedElement mergedTypedElement)
           
protected  void processAssociationSpecializations(Map options, DiagnosticChain diagnostics, Map context)
           
protected  void processCapabilities(Map options, DiagnosticChain diagnostics, Map context)
           
protected  void processDifferentPropertyStaticity(Map options, DiagnosticChain diagnostics, Map context)
           
protected  void processDifferentPropertyUniqueness(Map options, DiagnosticChain diagnostics, Map context)
           
protected  void processEmptyUnions(Map options, DiagnosticChain diagnostics, Map context)
           
protected  void processImplicitRedefinitions(Map options, DiagnosticChain diagnostics, Map context)
           
protected  void processInvalidRedefinitions(Map options, DiagnosticChain diagnostics, Map context)
           
protected  void processInvalidSubsets(Map options, DiagnosticChain diagnostics, Map context)
           
protected  void processOptions(Map options, DiagnosticChain diagnostics, Map context)
           
protected  void processRedundantGeneralizations(Map options, DiagnosticChain diagnostics, Map context)
           
 Object put(Object key, Object value)
           
 void putAll(Map t)
           
 Object remove(Object key)
           
 int size()
           
 Collection values()
           
 
Methods inherited from class org.eclipse.emf.ecore.util.EcoreUtil.Copier
copyProxyURI, copyReferences, getTarget, getTarget
 
Methods inherited from class java.util.HashMap
clone
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Field Detail

OPTION__DIFFERENT_PROPERTY_STATICITY

public static final String OPTION__DIFFERENT_PROPERTY_STATICITY
The option for handling cases where the staticity of merged properties does not match. Supported choices are OPTION__IGNORE and OPTION__REPORT.

See Also:
Constant Field Values

OPTION__DIFFERENT_PROPERTY_UNIQUENESS

public static final String OPTION__DIFFERENT_PROPERTY_UNIQUENESS
The option for handling cases where the uniqueness of merged properties does not match. Supported choices are OPTION__IGNORE and OPTION__REPORT.

See Also:
Constant Field Values

OPTION__REDUNDANT_GENERALIZATIONS

public static final String OPTION__REDUNDANT_GENERALIZATIONS
The option for handling cases where a redundant generalization is detected. Supported choices are OPTION__IGNORE, OPTION__REPORT, and OPTION__DISCARD.

See Also:
Constant Field Values

OPTION__IMPLICIT_REDEFINITIONS

public static final String OPTION__IMPLICIT_REDEFINITIONS
The option for handling cases where an implicit redefinition is detected. Supported choices are OPTION__IGNORE, OPTION__REPORT, and OPTION__PROCESS.

See Also:
Constant Field Values

OPTION__INVALID_REDEFINITIONS

public static final String OPTION__INVALID_REDEFINITIONS
The option for handling cases where an invalid redefinition is detected. Supported choices are OPTION__IGNORE, OPTION__REPORT, OPTION__DISCARD, and OPTION__PROCESS.

See Also:
Constant Field Values

OPTION__INVALID_SUBSETS

public static final String OPTION__INVALID_SUBSETS
The option for handling cases where an invalid subset is detected. Supported choices are OPTION__IGNORE, OPTION__REPORT, OPTION__DISCARD, and OPTION__PROCESS.

See Also:
Constant Field Values

OPTION__EMPTY_UNIONS

public static final String OPTION__EMPTY_UNIONS
The option for handling cases where an empty union is detected. Supported choices are OPTION__IGNORE, OPTION__REPORT, and OPTION__PROCESS.

See Also:
Constant Field Values

OPTION__ASSOCIATION_SPECIALIZATIONS

public static final String OPTION__ASSOCIATION_SPECIALIZATIONS
The option for handling cases where an association specialization is missing. Supported choices are OPTION__IGNORE, OPTION__REPORT, and OPTION__PROCESS.

See Also:
Constant Field Values

OPTION__CAPABILITIES

public static final String OPTION__CAPABILITIES
The option for handling cases where capability information is missing. Supported choices are OPTION__IGNORE, OPTION__REPORT, and OPTION__PROCESS.

See Also:
Constant Field Values

DIFFERENT_PROPERTY_STATICITY

public static final int DIFFERENT_PROPERTY_STATICITY
The diagnostic code for cases where the staticity of merged properties does not match.

See Also:
Constant Field Values

DIFFERENT_PROPERTY_UNIQUENESS

public static final int DIFFERENT_PROPERTY_UNIQUENESS
The diagnostic code for cases where the uniqueness of merged properties does not match.

See Also:
Constant Field Values

REDUNDANT_GENERALIZATION

public static final int REDUNDANT_GENERALIZATION
The diagnostic code for cases where a redundant generalization is detected.

See Also:
Constant Field Values

IMPLICIT_REDEFINITION

public static final int IMPLICIT_REDEFINITION
The diagnostic code for cases where an implicit redefinition is detected.

See Also:
Constant Field Values

INVALID_REDEFINITION

public static final int INVALID_REDEFINITION
The diagnostic code for cases where an invalid redefinition is detected.

See Also:
Constant Field Values

INVALID_SUBSET

public static final int INVALID_SUBSET
The diagnostic code for cases where an invalid subset is detected.

See Also:
Constant Field Values

EMPTY_UNION

public static final int EMPTY_UNION
The diagnostic code for cases where an empty union is detected.

See Also:
Constant Field Values

ASSOCIATION_SPECIALIZATION

public static final int ASSOCIATION_SPECIALIZATION
The diagnostic code for cases where an association specialization is missing.

See Also:
Constant Field Values

CAPABILITY

public static final int CAPABILITY
The diagnostic code for cases where capability information is missing.

See Also:
Constant Field Values

receivingPackage

protected Package receivingPackage

mergedPackages

protected Collection mergedPackages

resultingToMergedEObjectMap

protected final Map resultingToMergedEObjectMap
Constructor Detail

UMLUtil.PackageMerger

public UMLUtil.PackageMerger()
Method Detail

clear

public void clear()

containsKey

public boolean containsKey(Object key)

containsValue

public boolean containsValue(Object value)

entrySet

public Set entrySet()

get

public Object get(Object key)

isEmpty

public boolean isEmpty()

keySet

public Set keySet()

put

public Object put(Object key,
                  Object value)

putAll

public void putAll(Map t)

remove

public Object remove(Object key)

size

public int size()

values

public Collection values()

getMatchCandidates

protected List getMatchCandidates(EObject eObject)

getMergedEObjects

protected List getMergedEObjects(EObject resultingEObject)

getPreviouslyMergedEObject

protected EObject getPreviouslyMergedEObject(EObject resultingEObject)

getResultingQName

protected String getResultingQName(EObject eObject)

mergeAssociation_IsDerived

protected void mergeAssociation_IsDerived(Association receivingAssociation,
                                          Association mergedAssociation)

mergeClassifier_IsAbstract

protected void mergeClassifier_IsAbstract(Classifier receivingClassifier,
                                          Classifier mergedClassifier)

mergeLiteralInteger_Value

protected void mergeLiteralInteger_Value(LiteralInteger receivingLiteralInteger,
                                         LiteralInteger mergedLiteralInteger)

mergeLiteralUnlimitedNatural_Value

protected void mergeLiteralUnlimitedNatural_Value(LiteralUnlimitedNatural receivingLiteralUnlimitedNatural,
                                                  LiteralUnlimitedNatural mergedLiteralUnlimitedNatural)

mergeMultiplicityElement_IsOrdered

protected void mergeMultiplicityElement_IsOrdered(MultiplicityElement receivingMultiplicityElement,
                                                  MultiplicityElement mergedMultiplicityElement)

mergeMultiplicityElement_IsUnique

protected void mergeMultiplicityElement_IsUnique(MultiplicityElement receivingMultiplicityElement,
                                                 MultiplicityElement mergedMultiplicityElement)

mergeNamedElement_Visibility

protected void mergeNamedElement_Visibility(NamedElement receivingNamedElement,
                                            NamedElement mergedNamedElement)

mergeProperty_IsDerived

protected void mergeProperty_IsDerived(Property receivingProperty,
                                       Property mergedProperty)

mergeProperty_IsDerivedUnion

protected void mergeProperty_IsDerivedUnion(Property receivingProperty,
                                            Property mergedProperty)

mergeStructuralFeature_IsReadOnly

protected void mergeStructuralFeature_IsReadOnly(StructuralFeature receivingStructuralFeature,
                                                 StructuralFeature mergedStructuralFeature)

copyAttribute

protected void copyAttribute(EAttribute eAttribute,
                             EObject eObject,
                             EObject copyEObject)

copyContainment

protected void copyContainment(EReference eReference,
                               EObject eObject,
                               EObject copyEObject)

mergeTypedElement_Type

protected void mergeTypedElement_Type(TypedElement receivingTypedElement,
                                      TypedElement mergedTypedElement)

copyReference

protected void copyReference(EReference eReference,
                             EObject eObject,
                             EObject copyEObject)

createCopy

protected EObject createCopy(EObject eObject)

copy

public EObject copy(EObject eObject)

copyAll

public Collection copyAll(Collection eObjects)

getAllMergedPackages

protected Collection getAllMergedPackages(Package package_)

processDifferentPropertyStaticity

protected void processDifferentPropertyStaticity(Map options,
                                                 DiagnosticChain diagnostics,
                                                 Map context)

processDifferentPropertyUniqueness

protected void processDifferentPropertyUniqueness(Map options,
                                                  DiagnosticChain diagnostics,
                                                  Map context)

processImplicitRedefinitions

protected void processImplicitRedefinitions(Map options,
                                            DiagnosticChain diagnostics,
                                            Map context)

processInvalidRedefinitions

protected void processInvalidRedefinitions(Map options,
                                           DiagnosticChain diagnostics,
                                           Map context)

processInvalidSubsets

protected void processInvalidSubsets(Map options,
                                     DiagnosticChain diagnostics,
                                     Map context)

processEmptyUnions

protected void processEmptyUnions(Map options,
                                  DiagnosticChain diagnostics,
                                  Map context)

processRedundantGeneralizations

protected void processRedundantGeneralizations(Map options,
                                               DiagnosticChain diagnostics,
                                               Map context)

processAssociationSpecializations

protected void processAssociationSpecializations(Map options,
                                                 DiagnosticChain diagnostics,
                                                 Map context)

processCapabilities

protected void processCapabilities(Map options,
                                   DiagnosticChain diagnostics,
                                   Map context)

processOptions

protected void processOptions(Map options,
                              DiagnosticChain diagnostics,
                              Map context)

merge

public void merge(Package package_,
                  Map options,
                  DiagnosticChain diagnostics,
                  Map context)
Merges the contents of (all of) the packages merged by the specified package using the specified options, reporting problems to the specified diagnostics, within the specified context.

Parameters:
package_ - The receiving package.
options - The options to use.
diagnostics - The chain of diagnostics to which problems are to be appended.
context - The cache of context-specific information.

Copyright 2003, 2006 IBM Corporation and others.
All Rights Reserved.