org.eclipse.ocl.examples.pivot.manager
Class TemplateSpecialisation
java.lang.Object
org.eclipse.ocl.examples.pivot.manager.TemplateSpecialisation
public class TemplateSpecialisation
- extends java.lang.Object
A TemplateSpecialisation supports resolution of template parameter within an element referenced from an OCL expression.
For instance a PropertyCallExp.referredProperty references the unspecialised Property and consequently the type and owningType
of the referredProperty may have unresolved template parameters. These may be resolved by exploiting the bindings of
the ProperyCallExp.source.
Invocation should first invoke needsSpecialisation() to discover whether the cost of constructing a TemplateSpecialisation
can be bypassed. If specialisation is needed a TemplateSpecialisation should be constructed for the prevailing OCL Standard
Library, and known type equivalences installed by invoking installEquivalence() for each. getSpecialisation may then be used
to resolve the type.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
standardLibrary
@NonNull
protected final DomainStandardLibrary standardLibrary
bindings
protected java.util.Map<DomainTemplateParameter,DomainType> bindings
TemplateSpecialisation
public TemplateSpecialisation(@NonNull
DomainStandardLibrary standardLibrary)
needsSpecialisation
public static boolean needsSpecialisation(@Nullable
DomainType referencedType)
- Return true if a referencedType needs specialisation to resolve a template parameter.
getSpecialisation
public DomainType getSpecialisation(@NonNull
DomainType referredType)
installEquivalence
public void installEquivalence(@Nullable
DomainType resolvedType,
@Nullable
DomainType referencedType)