public class TypeUtil extends Object
See the Environment class for a description of the
generic type parameters of this class's methods.
| Modifier and Type | Method and Description |
|---|---|
static <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
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 <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
checkMutuallyComparable(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 <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
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 <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
commonSuperType(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 <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
compatibleTypeMatch(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C type1,
C type2)
Compare two types.
|
static <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
exactTypeMatch(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C type1,
C type2)
Compare two types.
|
static <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
findAttribute(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C owner,
String name)
Finds the most specific (re)definition of an attribute in the specified
classifier.
|
static <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
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 the most specific (re)definition of an operation by signature in the
specified classifier.
|
static <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
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 <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
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 <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
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 <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
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 <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
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 <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
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 <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
getResultType(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 <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
getResultType(Object problemObject,
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C owner,
O operation,
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 <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
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 <C> boolean |
isStandardLibraryFeature(Environment<?,C,?,?,?,?,?,?,?,?,?,?> env,
C owner,
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 <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
matchArgs(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C owner,
List<?> paramsOrProperties,
List<? extends TypedElement<C>> args)
Compares an actual argument list against the signature of an operation
or a signal.
|
static <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
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 <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
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 <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
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 <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
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 <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
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 <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
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 <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
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 <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
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 <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
resolveTupleType(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
<any> parts)
Resolves a tuple type against the tuple types previously generated
and persisted in the environment.
|
static <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
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 <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
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 <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
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 <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
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. |
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 operationtrue 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, 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 variablesnull 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, 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 signaturenull if not foundpublic 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 typepublic 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, String name)
env - the OCL environmentowner - the classifier to searchname - the name of the operationnull if not foundpublic 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 typepublic 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, List<?> paramsOrProperties, 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 OCLExpressions or Variablespublic 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 operationpublic 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, insteadenv - 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(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 argumentsproblemObject - the object which could have problems.env - the OCL environmentowner - the type of the operation call sourceoper - the operationpublic static <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> C getResultType(Object problemObject, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, C owner, O operation, 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 acceptableenv - the OCL environmenttype1 - a typetype2 - another typetrue if the cast is successfulSemanticException - 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 typepublic 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 typeIllegalArgumentException - 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, insteadenv - the OCL environmenttype1 - a typetype2 - another typeopcode - the operation codeSemanticException - if the types are not comparablepublic static <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> boolean checkMutuallyComparable(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 codepublic 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 typeUMLReflection 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 typeSemanticException - if the two types have no common supertypepublic static <PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> C commonSuperType(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 typeUMLReflection.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 resolvepublic 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 resolvepublic 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 resolvepublic 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 resolvepublic 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 resolvepublic 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 resolvepublic 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, <any> parts)
env - the OCL environmentparts - the expressions or variables describing the parts of the
tuple type to resolvepublic 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 resolvepublic 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 resolvepublic 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 resolvepublic static <C> boolean isStandardLibraryFeature(Environment<?,C,?,?,?,?,?,?,?,?,?,?> env, C owner, Object feature)
owner - a classifier on which a feature is to be accessedfeature - the feature to be accessedCopyright © 2005, 2018 IBM Corporation and others. All Rights Reserved.