|
||||||||||
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)
Deprecated. Use the checkMutuallyComparable(Object, Environment, Object, Object, int)
method, instead |
|
static
|
checkMutuallyComparable(java.lang.Object problemObject,
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 of = and <> operations. |
|
static
|
commonSuperType(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C type1,
C type2)
Deprecated. Use the commonSuperType(Object, Environment, Object, Object)
method, instead. |
|
static
|
commonSuperType(java.lang.Object problemObject,
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
|
compatibleTypeMatch(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C type1,
C type2)
Compare two types. |
|
static
|
exactTypeMatch(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C type1,
C type2)
Compare two types. |
|
static
|
findAttribute(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C owner,
java.lang.String name)
Finds the most specific (re)definition of an attribute in the specified classifier. |
|
static
|
findOperationMatching(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C owner,
java.lang.String name,
java.util.List<? extends TypedElement<C>> args)
Finds the most specific (re)definition of 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,
java.util.List<C> signals,
java.lang.String name,
java.util.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)
Deprecated. Use the getResultType(Object, Environment, Object, Object)
method, instead |
|
static
|
getResultType(java.lang.Object problemObject,
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C owner,
O oper)
Deprecated. Use the getResultType(Object, Environment, Object, Object, List)
method, instead, which resolves generic operation signatures
against actual arguments |
|
static
|
getResultType(java.lang.Object problemObject,
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
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. |
|
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
|
isStandardLibraryFeature(Environment<?,C,?,?,?,?,?,?,?,?,?,?> env,
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). |
|
static
|
matchArgs(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
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. |
|
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,
org.eclipse.emf.common.util.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 tuple-type against the tuple-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)
Deprecated. Use the compatibleTypeMatch(Environment, Object, Object)
method, instead, to check whether the cast is acceptable |
|
static
|
typeCompare(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C type1,
C type2)
Deprecated. Use the getRelationship(Environment, Object, Object)
method, instead. |
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
, otherwisepublic 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, java.lang.String name, java.util.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 foundpublic 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, java.util.List<C> signals, java.lang.String name, java.util.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 foundpublic static <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> java.util.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> P findAttribute(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, C owner, java.lang.String name)
env
- the OCL environmentowner
- the classifier to searchname
- the name of the operation
null
if not foundpublic static <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> java.util.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> boolean matchArgs(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, C owner, java.util.List<?> paramsOrProperties, java.util.List<? extends TypedElement<C>> args)
env
- the OCL environmentowner
- 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
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
@Deprecated 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)
getResultType(Object, Environment, Object, Object)
method, instead
env
- the OCL environmentowner
- the type of the operation call sourceoper
- the operation
@Deprecated public static <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> C getResultType(java.lang.Object problemObject, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, C owner, O oper)
getResultType(Object, Environment, Object, Object, List)
method, instead, which resolves generic operation signatures
against actual arguments
problemObject
- the object which could have problems.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> C getResultType(java.lang.Object problemObject, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, 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 nodeenv
- the OCL environmentowner
- 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
@Deprecated 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
compatibleTypeMatch(Environment, Object, Object)
method, instead, to check whether the cast is acceptable
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> boolean exactTypeMatch(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, C type1, C type2)
env
- the OCL environmenttype1
- a typetype2
- another type
public static <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> boolean compatibleTypeMatch(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, C type1, C type2)
env
- the OCL environmenttype1
- a typetype2
- another type
@Deprecated 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)
getRelationship(Environment, Object, Object)
method, instead.
type1
- a typetype2
- another type
java.lang.IllegalArgumentException
- if the types are not conformant one way
or the other@Deprecated 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
checkMutuallyComparable(Object, Environment, Object, Object, int)
method, instead
env
- the OCL environmenttype1
- a typetype2
- another typeopcode
- the operation code
SemanticException
- if the types are not comparablepublic static <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> boolean checkMutuallyComparable(java.lang.Object problemObject, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, C type1, C type2, int opcode)
problemObject
- the object which could have problems.env
- the OCL environmenttype1
- a typetype2
- another typeopcode
- the operation code
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)
@Deprecated 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
commonSuperType(Object, Environment, Object, Object)
method, instead.
UMLReflection.getCommonSuperType(Object, Object)
method does not.
type1
- a typetype2
- another type
SemanticException
- if the two types have no common supertypepublic static <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> C commonSuperType(java.lang.Object problemObject, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, C type1, C type2)
UMLReflection.getCommonSuperType(Object, Object)
method does not.
problemObject
- the object which could have problems.env
- the OCL environmenttype1
- a typetype2
- another type
UMLReflection.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, org.eclipse.emf.common.util.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
public static <C> boolean isStandardLibraryFeature(Environment<?,C,?,?,?,?,?,?,?,?,?,?> env, 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 |