public class TemplateParameterSubstitutionVisitor extends AbstractExtendingVisitor<java.lang.Object,java.util.Map<java.lang.Integer,Type>> implements TemplateParameterSubstitutions
The visitor should be constructed with a MetamodelManager in case any synthetic types need contructing, and the identity of the self type incase one of the substitutions uses OclSelf.
TemplateParameterSubstitutions.Empty
context
EMPTY
Constructor and Description |
---|
TemplateParameterSubstitutionVisitor(EnvironmentFactoryInternal environmentFactory,
Type selfType,
Type selfTypeValue) |
Modifier and Type | Method and Description |
---|---|
protected void |
analyzeFeature(Feature formalFeature,
TypedElement actualElement) |
protected void |
analyzeType(Type newFormal,
Element newActual) |
protected void |
analyzeTypedElement(TypedElement newFormal,
TypedElement newActual) |
protected void |
analyzeTypedElements(java.util.List<? extends TypedElement> formalElements,
java.util.List<? extends TypedElement> actualElements) |
protected void |
analyzeTypes(java.util.List<? extends Type> formalElements,
java.util.List<? extends Type> actualElements) |
static TemplateParameterSubstitutions |
createBindings(EnvironmentFactoryInternal environmentFactory,
Type formalType,
Type actualType) |
static TemplateParameterSubstitutions |
createBindings(EnvironmentFactoryInternal environmentFactory,
Type sourceType,
Type sourceTypeValue,
Operation candidateOperation) |
protected static TemplateParameterSubstitutionVisitor |
createVisitor(org.eclipse.emf.ecore.EObject eObject,
EnvironmentFactoryInternal environmentFactory,
Type selfType,
Type selfTypeValue) |
Type |
get(TemplateParameter templateParameter)
Return the highest common actual type of the formal templateParameter, returning null if unknown.
|
protected TemplateParameterSubstitutionHelper |
getHelper(Operation operation) |
protected TupleType |
getSpecializedTupleType(TupleType type) |
boolean |
isEmpty()
Return true if there are no formal TemplateParameters with actual values.
|
void |
put(int templateParameterIndex,
Type actualType) |
Type |
put(TemplateParameter formalTemplateParameter,
Type actualType)
Install actualType as the resolutions of formalTemplateParameter, returning the highest common type of actualType
and any pre-existing resolution.
|
Type |
specializeType(Type type) |
static Type |
specializeType(Type type,
CallExp callExp,
EnvironmentFactoryInternal environmentFactory,
Type selfType,
Type selfTypeValue)
Return the specialized form of type analyzing expr to determine the formal to actual parameter mappings under the
supervision of a metamodelManager and using selfType as the value of OclSelf.
|
java.lang.String |
toString() |
java.lang.Object |
visitClass(Class object) |
java.lang.Object |
visitCollectionType(CollectionType object) |
java.lang.String |
visiting(Visitable visitable)
Return the result of visiting a visitable for which no more specific pivot type method
is available.
|
java.lang.Object |
visitIterateExp(IterateExp object) |
java.lang.Object |
visitIteratorExp(IteratorExp object) |
java.lang.Object |
visitLambdaType(LambdaType object) |
java.lang.Object |
visitMapType(MapType object) |
java.lang.Object |
visitOperationCallExp(OperationCallExp object) |
java.lang.Object |
visitOppositePropertyCallExp(OppositePropertyCallExp object) |
java.lang.Object |
visitParameter(Parameter object) |
java.lang.Object |
visitPrimitiveType(PrimitiveType object) |
java.lang.Object |
visitPropertyCallExp(PropertyCallExp object) |
java.lang.Object |
visitSelfType(SelfType object) |
java.lang.Object |
visitTemplateParameter(TemplateParameter object) |
java.lang.Object |
visitTupleType(TupleType object) |
java.lang.Object |
visitTypedElement(TypedElement object) |
visitAnnotation, visitAnyType, visitAssociationClass, visitAssociationClassCallExp, visitBagType, visitBehavior, visitBooleanLiteralExp, visitCallExp, visitCallOperationAction, visitCollectionItem, visitCollectionLiteralExp, visitCollectionLiteralPart, visitCollectionRange, visitComment, visitCompleteClass, visitCompleteEnvironment, visitCompleteModel, visitCompletePackage, visitConnectionPointReference, visitConstraint, visitDataType, visitDetail, visitDynamicBehavior, visitDynamicElement, visitDynamicProperty, visitDynamicType, visitDynamicValueSpecification, visitElement, visitElementExtension, visitEnumeration, visitEnumerationLiteral, visitEnumLiteralExp, visitExpressionInOCL, visitFeature, visitFeatureCallExp, visitFinalState, visitIfExp, visitImport, visitInstanceSpecification, visitIntegerLiteralExp, visitInvalidLiteralExp, visitInvalidType, visitIteration, visitIteratorVariable, visitLanguageExpression, visitLetExp, visitLetVariable, visitLibrary, visitLiteralExp, visitLoopExp, visitMapLiteralExp, visitMapLiteralPart, visitMessageExp, visitMessageType, visitModel, visitNamedElement, visitNamespace, visitNavigationCallExp, visitNullLiteralExp, visitNumericLiteralExp, visitOCLExpression, visitOperation, visitOrderedSetType, visitOrphanCompletePackage, visitPackage, visitParameterVariable, visitPrecedence, visitPrimitiveCompletePackage, visitPrimitiveLiteralExp, visitProfile, visitProfileApplication, visitProperty, visitPseudostate, visitRealLiteralExp, visitRegion, visitResultVariable, visitSendSignalAction, visitSequenceType, visitSetType, visitShadowExp, visitShadowPart, visitSignal, visitSlot, visitStandardLibrary, visitState, visitStateExp, visitStateMachine, visitStereotype, visitStereotypeExtender, visitStringLiteralExp, visitTemplateableElement, visitTemplateBinding, visitTemplateParameterSubstitution, visitTemplateSignature, visitTransition, visitTrigger, visitTupleLiteralExp, visitTupleLiteralPart, visitType, visitTypeExp, visitUnlimitedNaturalLiteralExp, visitUnspecifiedValueExp, visitValueSpecification, visitVariable, visitVariableDeclaration, visitVariableExp, visitVertex, visitVoidType, visitWildcardType
getAdapter, safeVisit, visit
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getAdapter
public TemplateParameterSubstitutionVisitor(@NonNull EnvironmentFactoryInternal environmentFactory, @Nullable Type selfType, @Nullable Type selfTypeValue)
@NonNull public static TemplateParameterSubstitutions createBindings(@NonNull EnvironmentFactoryInternal environmentFactory, @NonNull Type formalType, @NonNull Type actualType)
@NonNull public static TemplateParameterSubstitutions createBindings(@NonNull EnvironmentFactoryInternal environmentFactory, @Nullable Type sourceType, @Nullable Type sourceTypeValue, @NonNull Operation candidateOperation)
@NonNull protected static TemplateParameterSubstitutionVisitor createVisitor(@NonNull org.eclipse.emf.ecore.EObject eObject, @NonNull EnvironmentFactoryInternal environmentFactory, @Nullable Type selfType, @Nullable Type selfTypeValue)
@NonNull public static Type specializeType(@NonNull Type type, @NonNull CallExp callExp, @NonNull EnvironmentFactoryInternal environmentFactory, @Nullable Type selfType, @Nullable Type selfTypeValue)
protected void analyzeFeature(@Nullable Feature formalFeature, @Nullable TypedElement actualElement)
protected void analyzeTypedElement(@Nullable TypedElement newFormal, @Nullable TypedElement newActual)
protected void analyzeTypedElements(@NonNull java.util.List<? extends TypedElement> formalElements, @Nullable java.util.List<? extends TypedElement> actualElements)
protected void analyzeTypes(@NonNull java.util.List<? extends Type> formalElements, @NonNull java.util.List<? extends Type> actualElements)
@Nullable public Type get(@Nullable TemplateParameter templateParameter)
TemplateParameterSubstitutions
get
in interface TemplateParameterSubstitutions
@Nullable protected TemplateParameterSubstitutionHelper getHelper(@NonNull Operation operation)
@NonNull protected TupleType getSpecializedTupleType(@NonNull TupleType type)
public boolean isEmpty()
TemplateParameterSubstitutions
isEmpty
in interface TemplateParameterSubstitutions
public void put(int templateParameterIndex, @Nullable Type actualType)
@NonNull public Type put(@NonNull TemplateParameter formalTemplateParameter, @NonNull Type actualType)
TemplateParameterSubstitutions
put
in interface TemplateParameterSubstitutions
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String visiting(@NonNull Visitable visitable)
Visitor
@Nullable public java.lang.Object visitClass(Class object)
visitClass
in interface Visitor<java.lang.Object>
visitClass
in class AbstractExtendingVisitor<java.lang.Object,java.util.Map<java.lang.Integer,Type>>
@Nullable public java.lang.Object visitCollectionType(@NonNull CollectionType object)
visitCollectionType
in interface Visitor<java.lang.Object>
visitCollectionType
in class AbstractExtendingVisitor<java.lang.Object,java.util.Map<java.lang.Integer,Type>>
@Nullable public java.lang.Object visitIterateExp(@NonNull IterateExp object)
visitIterateExp
in interface Visitor<java.lang.Object>
visitIterateExp
in class AbstractExtendingVisitor<java.lang.Object,java.util.Map<java.lang.Integer,Type>>
@Nullable public java.lang.Object visitIteratorExp(@NonNull IteratorExp object)
visitIteratorExp
in interface Visitor<java.lang.Object>
visitIteratorExp
in class AbstractExtendingVisitor<java.lang.Object,java.util.Map<java.lang.Integer,Type>>
@Nullable public java.lang.Object visitLambdaType(@NonNull LambdaType object)
visitLambdaType
in interface Visitor<java.lang.Object>
visitLambdaType
in class AbstractExtendingVisitor<java.lang.Object,java.util.Map<java.lang.Integer,Type>>
@Nullable public java.lang.Object visitMapType(@NonNull MapType object)
visitMapType
in interface Visitor<java.lang.Object>
visitMapType
in class AbstractExtendingVisitor<java.lang.Object,java.util.Map<java.lang.Integer,Type>>
@Nullable public java.lang.Object visitOperationCallExp(@NonNull OperationCallExp object)
visitOperationCallExp
in interface Visitor<java.lang.Object>
visitOperationCallExp
in class AbstractExtendingVisitor<java.lang.Object,java.util.Map<java.lang.Integer,Type>>
@Nullable public java.lang.Object visitOppositePropertyCallExp(@NonNull OppositePropertyCallExp object)
visitOppositePropertyCallExp
in interface Visitor<java.lang.Object>
visitOppositePropertyCallExp
in class AbstractExtendingVisitor<java.lang.Object,java.util.Map<java.lang.Integer,Type>>
@Nullable public java.lang.Object visitParameter(@NonNull Parameter object)
visitParameter
in interface Visitor<java.lang.Object>
visitParameter
in class AbstractExtendingVisitor<java.lang.Object,java.util.Map<java.lang.Integer,Type>>
@Nullable public java.lang.Object visitPrimitiveType(@NonNull PrimitiveType object)
visitPrimitiveType
in interface Visitor<java.lang.Object>
visitPrimitiveType
in class AbstractExtendingVisitor<java.lang.Object,java.util.Map<java.lang.Integer,Type>>
@Nullable public java.lang.Object visitPropertyCallExp(@NonNull PropertyCallExp object)
visitPropertyCallExp
in interface Visitor<java.lang.Object>
visitPropertyCallExp
in class AbstractExtendingVisitor<java.lang.Object,java.util.Map<java.lang.Integer,Type>>
@Nullable public java.lang.Object visitSelfType(@NonNull SelfType object)
visitSelfType
in interface Visitor<java.lang.Object>
visitSelfType
in class AbstractExtendingVisitor<java.lang.Object,java.util.Map<java.lang.Integer,Type>>
@Nullable public java.lang.Object visitTemplateParameter(@NonNull TemplateParameter object)
visitTemplateParameter
in interface Visitor<java.lang.Object>
visitTemplateParameter
in class AbstractExtendingVisitor<java.lang.Object,java.util.Map<java.lang.Integer,Type>>
@Nullable public java.lang.Object visitTupleType(@NonNull TupleType object)
visitTupleType
in interface Visitor<java.lang.Object>
visitTupleType
in class AbstractExtendingVisitor<java.lang.Object,java.util.Map<java.lang.Integer,Type>>
@Nullable public java.lang.Object visitTypedElement(@NonNull TypedElement object)
visitTypedElement
in interface Visitor<java.lang.Object>
visitTypedElement
in class AbstractExtendingVisitor<java.lang.Object,java.util.Map<java.lang.Integer,Type>>