|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TypeChecker<C,O,P>
This optional interface is to be implemented by clients that want to add type
checking capabilities to their Environment
.
The AbstractTypeChecker
provides the default implementation for the
OCL type system. Rather than implement this interface, it is suggested that,
if at al possible, clients extend the AbstractTypeChecker
class,
instead.
See the Environment
interface for a description of the generic type
parameters of this class. See the AbstractTypeChecker
class for
classes for implementation details.
AbstractTypeChecker
Method Summary | |
---|---|
boolean |
checkMutuallyComparable(java.lang.Object problemObject,
C type1,
C type2,
int opcode)
Checks whether two types are mutually comparable in the determination of the applicability of = and <> operations. |
C |
commonSuperType(java.lang.Object problemObject,
C type1,
C type2)
Get the common supertype of two types. |
boolean |
compatibleTypeMatch(C type1,
C type2)
Compare two types. |
boolean |
exactTypeMatch(C type1,
C type2)
Compare two types. |
P |
findAttribute(C owner,
java.lang.String name)
Finds the most specific (re)definition of an attribute in the specified classifier. |
O |
findOperationMatching(C owner,
java.lang.String name,
java.util.List<? extends TypedElement<C>> args)
Finds an operation by signature in the specified classifier. |
C |
findSignalMatching(C receiver,
java.util.List<C> signals,
java.lang.String name,
java.util.List<? extends TypedElement<C>> args)
Find a matching signal in the specified list. |
java.util.List<P> |
getAttributes(C owner)
Obtains all of the OCL attributes applicable to the specified owner type, including any that were defined in the OCL environment as additional attributes. |
java.util.List<O> |
getOperations(C owner)
Obtains all of the OCL operations applicable to the specified owner type, including any that were defined in the OCL environment as additional operations. |
C |
getPropertyType(C owner,
P property)
Gets the type of a property, accounting for the fact that we may be navigating to it from an association class (in which the member ends of an association always have multiplicity 1) or not. |
int |
getRelationship(C type1,
C type2)
Queries the relationship, according to generalizations, of two types. |
C |
getResultType(java.lang.Object problemObject,
C owner,
O operation,
java.util.List<? extends TypedElement<C>> args)
Obtains the effective result type of the specified operation, which may or may not have parameters type by generic type variables. |
boolean |
isStandardLibraryFeature(C owner,
java.lang.Object feature)
Queries whether the specified feature (operation or attribute), as applied to a particular owner classifier, is defined by the standard library or not (in which case it would, presumably, be user-defined). |
boolean |
matchArgs(C owner,
java.util.List<?> paramsOrProperties,
java.util.List<? extends TypedElement<C>> args)
Compares an actual argument list against the signature of an operation or a signal. |
O |
resolveGenericSignature(C owner,
O oper)
Resolves the signature of a generic operation (where it has parameters of type and/or T or T2) against the source type of the operation, as appropriate. |
Method Detail |
---|
int getRelationship(C type1, C type2)
UMLReflection.getRelationship(Object, Object)
method does not.
type1
- a typetype2
- another type
UMLReflection
interfaceUMLReflection.getRelationship(Object, Object)
C getResultType(java.lang.Object problemObject, C owner, O operation, java.util.List<? extends TypedElement<C>> args)
problemObject
- the context object on which to report any problem that we may
find in computing the result type. Usually this is some
abstract or concrete syntax tree nodeowner
- the owner of the operation (type on which the operation is
called)operation
- the operation signatureargs
- the arguments of the operation call, which are expressions or
variables
C getPropertyType(C owner, P property)
owner
- the source of the navigation of the property, which may be an
association class (the interesting scenario)property
- the property to navigate
C commonSuperType(java.lang.Object problemObject, C type1, C type2)
UMLReflection.getCommonSuperType(Object, Object)
method does not.
problemObject
- the object which could have problems.type1
- a typetype2
- another type
UMLReflection.getCommonSuperType(Object, Object)
boolean checkMutuallyComparable(java.lang.Object problemObject, C type1, C type2, int opcode)
problemObject
- the object which could have problems.type1
- a typetype2
- another typeopcode
- the operation code
boolean exactTypeMatch(C type1, C type2)
type1
- a typetype2
- another type
boolean compatibleTypeMatch(C type1, C type2)
type1
- a typetype2
- another type
java.util.List<O> getOperations(C owner)
owner
- the operation owner type
java.util.List<P> getAttributes(C owner)
owner
- the attribute owner type
O resolveGenericSignature(C owner, O oper)
owner
- the operation source typeoper
- the generic operation
C findSignalMatching(C receiver, java.util.List<C> signals, java.lang.String name, java.util.List<? extends TypedElement<C>> args)
receiver
- the type that receives the signalsignals
- the signals to searchname
- name of signal to findargs
- list of arguments to match against the signal signature
null
if not foundO findOperationMatching(C owner, java.lang.String name, java.util.List<? extends TypedElement<C>> args)
owner
- the classifier to searchname
- the name of the operationargs
- a list of arguments to match against the operation signature,
as either expressions or variables
null
if not foundboolean matchArgs(C owner, java.util.List<?> paramsOrProperties, java.util.List<? extends TypedElement<C>> args)
owner
- the type that owns the operationparamsOrProperties
- the operation parameters or signal attributes to match against
the argumentsargs
- a list of OCLExpression
s or Variable
s
P findAttribute(C owner, java.lang.String name)
owner
- the classifier to searchname
- the name of the operation
null
if not foundboolean isStandardLibraryFeature(C owner, java.lang.Object feature)
owner
- a classifier on which a feature is to be accessedfeature
- the feature to be accessed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |