|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.ocl.util.TypeUtil
public class TypeUtil
Static utilities for introspecting OCL types.
See the Environment class for a description of the
generic type parameters of this class's methods.
| Method Summary | ||
|---|---|---|
static
|
checkMutuallyComparable(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C type1,
C type2,
int opcode)
Checks whether two types are mutually comparable in the determination of the applicability = and <> operations. |
|
static
|
commonSuperType(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C type1,
C type2)
Get the common supertype of two types. |
|
static
|
findOperationMatching(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C owner,
String name,
List<? extends TypedElement<C>> args)
Finds an operation by signature in the specified classifier. |
|
static
|
findSignalMatching(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C receiver,
List<C> signals,
String name,
List<? extends TypedElement<C>> args)
Find a matching signal in the specified list. |
|
static
|
getAttributes(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
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. |
|
static
|
getOperations(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
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. |
|
static
|
getPropertyType(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
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. |
|
static
|
getRelationship(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C type1,
C type2)
Queries the relationship, according to generalizations, of two types. |
|
static
|
getResultType(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C owner,
O oper)
Obtains the result type of the specified operation, which in the case of collection operations sometimes depends on the element type of the source collection. |
|
static
|
isOclAnyOperation(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
O operation)
Queries whether an operation is defined by the OclAny type. |
|
static
|
resolveBagType(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C elementType)
Resolves a Bag type against the baf types previously generated and persisted in the environment. |
|
static
|
resolveCollectionType(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
CollectionKind kind,
C elementType)
Resolves a collection type against the collection types previously generated and persisted in the environment. |
|
static
|
resolveGenericSignature(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
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. |
|
static
|
resolveOperationMessageType(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
O operation)
Resolves an operation message type against the message types previously generated and persisted in the environment. |
|
static
|
resolveOrderedSetType(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C elementType)
Resolves a OrderedSet type against the types previously generated and persisted in the environment. |
|
static
|
resolveSequenceType(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C elementType)
Resolves a Sequence type against the sequence types previously generated and persisted in the environment. |
|
static
|
resolveSetType(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C elementType)
Resolves a Set type against the set types previously generated and persisted in the environment. |
|
static
|
resolveSignalMessageType(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C signal)
Resolves a signal message type against the message types previously generated and persisted in the environment. |
|
static
|
resolveTupleType(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
EList<? extends TypedElement<C>> parts)
Resolves a tuple type against the tuple types previously generated and persisted in the environment. |
|
static
|
resolveType(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C type)
Resolves the specified type against the model-based types defined by the specified environment's type resolver, for consistency with the environment (especially for persistence). |
|
static
|
resolveTypeType(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C type)
Resolves a tupe-type against the tupe-types previously generated and persisted in the environment. |
|
static
|
type1AsType2(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C type1,
C type2)
Casts a value of one type as another type, if compatible. |
|
static
|
typeCompare(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C type1,
C type2)
Compare two types. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> boolean isOclAnyOperation(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
O operation)
env - the OCL environmentoperation - an operation
true if it is defined by OclAny;
false, otherwise
public static <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> O findOperationMatching(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C owner,
String name,
List<? extends TypedElement<C>> args)
env - the OCL environmentowner - 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 found
public static <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> C findSignalMatching(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C receiver,
List<C> signals,
String name,
List<? extends TypedElement<C>> args)
env - the OCL environmentreceiver - 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 found
public static <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> List<O> getOperations(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C owner)
env - the OCL environmentowner - the operation owner type
public static <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> List<P> getAttributes(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C owner)
env - the OCL environmentowner - the attribute owner type
public static <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> O resolveGenericSignature(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C owner,
O oper)
env - the OCL environmentowner - the operation source typeoper - the generic operation
public static <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> C getPropertyType(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C owner,
P property)
env - the OCL environmentowner - the source of the navigation of the property, which may
be an association class (the interesting scenario)property - the property to navigate
public static <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> C getResultType(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C owner,
O oper)
env - the OCL environmentowner - the type of the operation call sourceoper - the operation
public static <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> boolean type1AsType2(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C type1,
C type2)
throws SemanticException
env - the OCL environmenttype1 - a typetype2 - another type
true if the cast is successful
SemanticException - if the cast fails (because the types are
not conformant)
public static <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> int typeCompare(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C type1,
C type2)
type1 - a typetype2 - another type
IllegalArgumentException - if the types are not conformant one way
or the other
public static <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> void checkMutuallyComparable(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C type1,
C type2,
int opcode)
throws SemanticException
env - the OCL environmenttype1 - a typetype2 - another typeopcode - the operation code
SemanticException - if the types are not comparable
public static <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> int getRelationship(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C type1,
C type2)
UMLReflection.getRelationship(Object, Object)
method does not.
env - the OCL environmenttype1 - a typetype2 - another type
UMLReflection interfaceUMLReflection.getRelationship(Object, Object)
public static <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> C commonSuperType(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C type1,
C type2)
throws SemanticException
UMLReflection.getCommonSuperType(Object, Object)
method does not.
type1 - a typetype2 - another type
SemanticException - if the two types have no common supertypeUMLReflection.getCommonSuperType(Object, Object)
public static <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> C resolveType(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C type)
env - the OCL environmenttype - the type to resolve
public static <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> C resolveSetType(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C elementType)
env - the OCL environmentelementType - the element type of the set type to resolve
public static <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> C resolveOrderedSetType(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C elementType)
env - the OCL environmentelementType - the element type of the ordered set type to resolve
public static <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> C resolveBagType(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C elementType)
env - the OCL environmentelementType - the element type of the baf type to resolve
public static <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> C resolveSequenceType(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C elementType)
env - the OCL environmentelementType - the element type of the sequence type to resolve
public static <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> C resolveCollectionType(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
CollectionKind kind,
C elementType)
env - the OCL environmentkind - the collection kind to resolveelementType - the element type of the collection type to resolve
public static <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> C resolveTupleType(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
EList<? extends TypedElement<C>> parts)
env - the OCL environmentparts - the expressions or variables describing the parts of the
tuple type to resolve
public static <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> C resolveTypeType(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C type)
env - the OCL environmenttype - the referred type of the type-type to resolve
public static <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> C resolveOperationMessageType(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
O operation)
env - the OCL environmentoperation - the operation referenced by the message type to resolve
public static <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> C resolveSignalMessageType(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C signal)
env - the OCL environmentsignal - the signal referenced by the message type to resolve
|
Copyright 2002, 2007 IBM Corporation and others. All Rights Reserved. |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||