|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.emf.ocl.types.impl.TypeUtil
public class TypeUtil
Static utilities for introspecting OCL types.
Method Summary | |
---|---|
static EClassifier |
commonSuperType(EClassifier type1,
EClassifier type2)
Get the common supertype of two types. |
static EOperation |
defineOperation(EClassifier owner,
String name,
EList params,
EClassifier type)
|
static EStructuralFeature |
defineProperty(EClassifier owner,
Variable variable)
|
static EOperation |
findOperationMatching(EClassifier owner,
String name,
EList args)
Find the operation in the specified classifier |
static EClass |
findSignalMatching(EClassifier receiver,
EList signals,
String name,
EList args)
Find a matching signal in the specified list. |
static EList |
getAdditionalOperations(EClassifier owner)
|
static EList |
getAdditionalProperties(EClassifier owner)
|
static EClassifier |
getOCLCollectionType(EClassifier type,
boolean isOrdered,
boolean isUnique)
Obtains the appropriate OCL collection type for an EClassifier ,
according to the collection's orderedness and uniqueness. |
static EClassifier |
getOCLType(EClassifier type)
Obtains the appropriate OCL type for an EClassifier , if it
corresponds to an OCL primitive type. |
static EClassifier |
getOCLType(ETypedElement typedElement)
Obtains the appropriate OCL type for an Ecore typed element, according to its type, multiplicity, orderedness, and uniqueness. |
static EList |
getOperations(EClassifier owner)
Obtains all of the OCL operations applicable to the specified owner type. |
static EList |
getProperties(EClassifier owner)
|
static int |
getRelationship(EClassifier type1,
EClassifier type2)
Computes the relationship between two types. |
static EClassifier |
getResultType(EClassifier owner,
EOperation oper)
|
static boolean |
isMany(ETypedElement typedElement)
Custom is-many determination to assume that XSD unspecified multiplicities are many. |
static void |
resolveAdditionalFeatures(EClassifier owner,
Environment env)
|
static EOperation |
resolveGenericSignature(EClassifier owner,
EOperation oper)
|
static EClassifier |
resolveType(Environment env,
EClassifier 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 boolean |
type1AsType2(EClassifier type1,
EClassifier type2)
|
static int |
typeCompare(EClassifier type1,
EClassifier type2)
Compare 2 types. |
static void |
undefineAdditionalFeatures(EClassifier owner)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static EOperation findOperationMatching(EClassifier owner, String name, EList args)
owner
- EClassifier owning operationsname
- name of operationargs
- list of arguments to match against the operation signature
null
if not foundpublic static EClass findSignalMatching(EClassifier receiver, EList signals, String name, EList 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 foundpublic static EList getOperations(EClassifier owner)
owner
- the operation owner type
public static EList getProperties(EClassifier owner)
public static EOperation resolveGenericSignature(EClassifier owner, EOperation oper)
public static EClassifier getResultType(EClassifier owner, EOperation oper)
public static boolean type1AsType2(EClassifier type1, EClassifier type2) throws SemanticException
SemanticException
public static int typeCompare(EClassifier type1, EClassifier type2)
type1
- -
EClassifiertype2
- -
EClassifier
public static EClassifier commonSuperType(EClassifier type1, EClassifier type2) throws SemanticException
type1
- type2
-
SemanticException
public static int getRelationship(EClassifier type1, EClassifier type2)
type1
- a typetype2
- another type
PredefinedType.UNRELATED_TYPE
,
PredefinedType.STRICT_SUBTYPE
,
PredefinedType.STRICT_SUPERTYPE
, or
PredefinedType.SAME_TYPE
according to the
relationship between the typespublic static EClassifier getOCLType(ETypedElement typedElement)
typedElement
- the ECore typed element to get the OCL type for
getOCLType(EClassifier)
,
getOCLCollectionType(EClassifier, boolean, boolean)
public static EClassifier getOCLType(EClassifier type)
EClassifier
, if it
corresponds to an OCL primitive type.
type
- the type to convert to an OCL type
public static EClassifier getOCLCollectionType(EClassifier type, boolean isOrdered, boolean isUnique)
EClassifier
,
according to the collection's orderedness and uniqueness. The mapping is
as follows:
Note that the collection's element type
is mapped to an
OCL primitive type where possible.
type
- the type to get the corresponding OCL collection type forisOrdered
- whether the OCL type should be orderedisUnique
- whether the OCL type should be unique
getOCLType(EClassifier)
public static boolean isMany(ETypedElement typedElement)
typedElement
- a typed element
public static EClassifier resolveType(Environment env, EClassifier type)
env
- the parser environmenttype
- the type to resolve
public static EStructuralFeature defineProperty(EClassifier owner, Variable variable)
public static EOperation defineOperation(EClassifier owner, String name, EList params, EClassifier type)
public static EList getAdditionalProperties(EClassifier owner)
public static EList getAdditionalOperations(EClassifier owner)
public static void undefineAdditionalFeatures(EClassifier owner)
public static void resolveAdditionalFeatures(EClassifier owner, Environment env)
|
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 |