public static class UMLUtil.TemplateExpander extends UMLUtil.PackageMerger
TemplateableElement
s to apply
the bindings' parameter substitutions within a bound element. The template bindings
are then destroyed as it is effectively replaced by a realization of the
template; this is in many ways similar to the way that the
UMLUtil.PackageMerger
works to effect a
Package
's PackageMerge
s.UMLUtil.PackageMerger.BodyMatcher, UMLUtil.PackageMerger.ImplicitAssociationNameMatcher, UMLUtil.PackageMerger.KeyMatcher, UMLUtil.PackageMerger.NameMatcher, UMLUtil.PackageMerger.ResultingQNameMatcher, UMLUtil.PackageMerger.SourceMatcher, UMLUtil.PackageMerger.StringValueMatcher, UMLUtil.PackageMerger.TypeMatcher
Modifier and Type | Field and Description |
---|---|
protected TemplateBinding |
binding |
static int |
MISSING_PARAMETER_SUBSTITUTION
The diagnostic code for cases where parameter substitutions are
missing.
|
static java.lang.String |
OPTION__MISSING_PARAMETER_SUBSTITUTIONS
The option for handling cases where a template binding does not have
a substitution for some parameter and that parameter does not have a
default substitution.
|
protected java.util.Map<ParameterableElement,ParameterableElement> |
substitutionMap |
ASSOCIATION_SPECIALIZATION, ATTRIBUTE_TRANSFORMATION, CAPABILITY, context, diagnostics, DIFFERENT_PROPERTY_STATICITY, DIFFERENT_PROPERTY_UNIQUENESS, EMPTY_QUALIFIED_NAME, EMPTY_UNION, IMPLICIT_REDEFINITION, INDISTINGUISHABLE_CLASSIFIER, INVALID_REDEFINITION, INVALID_SUBSET, mergedElements, mergedPackages, OPTION__ASSOCIATION_SPECIALIZATIONS, OPTION__ATTRIBUTE_TRANSFORMATIONS, OPTION__CAPABILITIES, OPTION__DIFFERENT_PROPERTY_STATICITY, OPTION__DIFFERENT_PROPERTY_UNIQUENESS, OPTION__EMPTY_QUALIFIED_NAMES, OPTION__EMPTY_UNIONS, OPTION__IMPLICIT_REDEFINITIONS, OPTION__INDISTINGUISHABLE_CLASSIFIERS, OPTION__INVALID_REDEFINITIONS, OPTION__INVALID_SUBSETS, OPTION__REDUNDANT_GENERALIZATIONS, options, receivingElement, receivingPackage, REDUNDANT_GENERALIZATION, resultingToMergedEObjectMap
Constructor and Description |
---|
TemplateExpander() |
Modifier and Type | Method and Description |
---|---|
protected void |
cleanupMergeRelationships()
Cleans up (removing or otherwise trimming as necessary) the
relationships on the
UMLUtil.PackageMerger.receivingElement that define the merges
that were performed. |
protected void |
copyAttribute(org.eclipse.emf.ecore.EAttribute eAttribute,
org.eclipse.emf.ecore.EObject eObject,
org.eclipse.emf.ecore.EObject copyEObject) |
protected void |
copyContainment(org.eclipse.emf.ecore.EReference eReference,
org.eclipse.emf.ecore.EObject eObject,
org.eclipse.emf.ecore.EObject copyEObject) |
void |
copyReferences() |
protected org.eclipse.emf.ecore.EObject |
createCopy(org.eclipse.emf.ecore.EObject eObject) |
java.util.Map<org.eclipse.emf.ecore.EObject,java.util.List<org.eclipse.emf.ecore.EObject>> |
expand(TemplateableElement boundElement,
java.util.Map<java.lang.String,java.lang.String> options,
org.eclipse.emf.common.util.DiagnosticChain diagnostics,
java.util.Map<java.lang.Object,java.lang.Object> context) |
protected java.util.Map<org.eclipse.emf.ecore.EObject,java.util.List<org.eclipse.emf.ecore.EObject>> |
expand(TemplateBinding binding,
TemplateableElement receivingElement,
java.util.Map<java.lang.String,java.lang.String> options,
org.eclipse.emf.common.util.DiagnosticChain diagnostics,
java.util.Map<java.lang.Object,java.lang.Object> context) |
protected TemplateParameterSubstitution |
findSubstitution(TemplateParameter templateParameter) |
protected UML2Util.EObjectMatcher |
getAssociationMatcher(Association association) |
protected NamedElement |
getCapability(org.eclipse.emf.ecore.EObject mergedEObject)
Queries the template in our scope that is or contains (recursively)
the given object.
|
protected NamedElement |
getReceivingElement(org.eclipse.emf.ecore.EObject resultingEObject)
Queries the bound template in our scope that is or contains
(recursively) the given object.
|
protected ParameterableElement |
getSubstitution(ParameterableElement parameterableElement) |
protected void |
mergeLiteralString_Value(LiteralString receivingLiteralString,
LiteralString mergedLiteralString) |
protected void |
mergeNamedElement_Name(NamedElement receivingNamedElement,
NamedElement mergedNamedElement) |
protected void |
processMissingParameterSubstitutions(java.util.Map<java.lang.String,java.lang.String> options,
org.eclipse.emf.common.util.DiagnosticChain diagnostics,
java.util.Map<java.lang.Object,java.lang.Object> context) |
protected void |
processNameExpressions()
Replace named element names with (template-expanded) name expressions
where appropriate.
|
protected void |
processOptions(java.util.Map<java.lang.String,java.lang.String> options,
org.eclipse.emf.common.util.DiagnosticChain diagnostics,
java.util.Map<java.lang.Object,java.lang.Object> context) |
copy, copyAll, copyReference, getAllMergedPackages, getMatchCandidates, getMergedEObjects, getPreviouslyMergedEObject, getResultingQName, isPackageMerge, merge, merge, mergeAssociation_IsDerived, mergeClassifier_IsAbstract, mergeClassifier_IsFinalSpecialization, mergeLiteralInteger_Value, mergeLiteralUnlimitedNatural_Value, mergeMultiplicityElement_IsOrdered, mergeMultiplicityElement_IsUnique, mergeMultiplicityElement_Lower, mergeMultiplicityElement_Upper, mergeNamedElement_Visibility, mergeProperty_IsDerived, mergeProperty_IsDerivedUnion, mergeRedefinableElement_IsLeaf, mergeStructuralFeature_IsReadOnly, mergeTypedElement_Type, processAssociationSpecializations, processCapabilities, processDifferentPropertyStaticity, processDifferentPropertyUniqueness, processEmptyQualifiedNames, processEmptyUnions, processImplicitRedefinitions, processIndistinguishableClassifiers, processInvalidRedefinitions, processInvalidSubsets, processRedundantGeneralizations, updateReferences
copyAttributeValue, copyFeatureMap, copyProxyURI, getTarget, getTarget, getTarget, getTarget
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, removeEldestEntry, replaceAll, values
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
public static final java.lang.String OPTION__MISSING_PARAMETER_SUBSTITUTIONS
OPTION__IGNORE
and OPTION__REPORT
.public static final int MISSING_PARAMETER_SUBSTITUTION
protected TemplateBinding binding
protected java.util.Map<ParameterableElement,ParameterableElement> substitutionMap
protected TemplateParameterSubstitution findSubstitution(TemplateParameter templateParameter)
protected ParameterableElement getSubstitution(ParameterableElement parameterableElement)
protected void mergeNamedElement_Name(NamedElement receivingNamedElement, NamedElement mergedNamedElement)
protected void mergeLiteralString_Value(LiteralString receivingLiteralString, LiteralString mergedLiteralString)
protected void copyAttribute(org.eclipse.emf.ecore.EAttribute eAttribute, org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EObject copyEObject)
copyAttribute
in class UMLUtil.PackageMerger
protected void copyContainment(org.eclipse.emf.ecore.EReference eReference, org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EObject copyEObject)
copyContainment
in class UMLUtil.PackageMerger
protected UML2Util.EObjectMatcher getAssociationMatcher(Association association)
getAssociationMatcher
in class UMLUtil.PackageMerger
protected org.eclipse.emf.ecore.EObject createCopy(org.eclipse.emf.ecore.EObject eObject)
createCopy
in class UMLUtil.PackageMerger
public void copyReferences()
copyReferences
in class org.eclipse.emf.ecore.util.EcoreUtil.Copier
protected void processMissingParameterSubstitutions(java.util.Map<java.lang.String,java.lang.String> options, org.eclipse.emf.common.util.DiagnosticChain diagnostics, java.util.Map<java.lang.Object,java.lang.Object> context)
protected void processNameExpressions()
protected NamedElement getCapability(org.eclipse.emf.ecore.EObject mergedEObject)
getCapability
in class UMLUtil.PackageMerger
mergedEObject
- an objectprotected NamedElement getReceivingElement(org.eclipse.emf.ecore.EObject resultingEObject)
getReceivingElement
in class UMLUtil.PackageMerger
resultingEObject
- an objectprotected void processOptions(java.util.Map<java.lang.String,java.lang.String> options, org.eclipse.emf.common.util.DiagnosticChain diagnostics, java.util.Map<java.lang.Object,java.lang.Object> context)
processOptions
in class UMLUtil.PackageMerger
protected void cleanupMergeRelationships()
UMLUtil.PackageMerger
UMLUtil.PackageMerger.receivingElement
that define the merges
that were performed.cleanupMergeRelationships
in class UMLUtil.PackageMerger
protected java.util.Map<org.eclipse.emf.ecore.EObject,java.util.List<org.eclipse.emf.ecore.EObject>> expand(TemplateBinding binding, TemplateableElement receivingElement, java.util.Map<java.lang.String,java.lang.String> options, org.eclipse.emf.common.util.DiagnosticChain diagnostics, java.util.Map<java.lang.Object,java.lang.Object> context)
public java.util.Map<org.eclipse.emf.ecore.EObject,java.util.List<org.eclipse.emf.ecore.EObject>> expand(TemplateableElement boundElement, java.util.Map<java.lang.String,java.lang.String> options, org.eclipse.emf.common.util.DiagnosticChain diagnostics, java.util.Map<java.lang.Object,java.lang.Object> context)