org.eclipse.emf.ocl.uml.util
Class UMLTypeUtil

java.lang.Object
  extended byorg.eclipse.emf.ocl.uml.util.UMLTypeUtil

public class UMLTypeUtil
extends java.lang.Object

Utility methods for working with the annotations that extend the Ecore model to implement certain UML semantics required by OCL.


Field Summary
static java.lang.String ANNOTATION_URI_ASSOCIATION_CLASS
          Annotation that stores the reference to the EClass representing an association class that includes an EReference as a member end.
static java.lang.String ANNOTATION_URI_CLASSIFIER
          Annotation that indicates what kind of a UML classifier is an EClass.
static java.lang.String ANNOTATION_URI_MEMBER_ENDS
          Annotation that stores references to which of the EReferences of an EClass representing an association class are its member ends.
static java.lang.String ANNOTATION_URI_OPERATION
          Annotation that stores details of the nature of a UML operation (modeled as an EOperation).
static java.lang.String ANNOTATION_URI_QUALIFIERS
          Annotation that stores qualifiers (if any) of a UML association end (modeled as an EReference).
static java.lang.String ANNOTATION_URI_SIGNALS
          Annotation that stores references to EClasses representing signals that an EClass can receive.
 
Method Summary
static void addMemberEnd(org.eclipse.emf.ecore.EClass associationClass, org.eclipse.emf.ecore.EReference memberEnd)
          Adds a member end to an EMF classifier representing a UML association class.
static void addQualifier(org.eclipse.emf.ecore.EStructuralFeature property, org.eclipse.emf.ecore.EStructuralFeature qualifier)
          Adds a UML qualifier to the specified property.
static void addSignal(org.eclipse.emf.ecore.EClass eclass, org.eclipse.emf.ecore.EClass signal)
          Adds a UML signal that the specified classifier can receive.
static org.eclipse.emf.ecore.EClass getAssociationClass(org.eclipse.emf.ecore.EReference reference)
          Obtains the EClass representing the "class" aspect of the UML association class that the specified EReference represents.
static org.eclipse.emf.common.util.EList getMemberEnds(org.eclipse.emf.ecore.EClass associationClass)
          Obtains the member ends of an EMF classifier representing a UML association class.
static org.eclipse.emf.ecore.EStructuralFeature getProperty(org.eclipse.emf.ecore.EStructuralFeature qualifier)
          Queries the property that has the specified qualifier, if any.
static org.eclipse.emf.common.util.EList getQualifiers(org.eclipse.emf.ecore.EStructuralFeature property)
          Obtains the UML qualifiers, if any, associated with the specified property.
static org.eclipse.emf.common.util.EList getSignals(org.eclipse.emf.ecore.EClass eclass)
          Obtains the UML signals that the specified classifier can receive, if any.
static boolean isAssociationClass(org.eclipse.emf.ecore.EClassifier classifier)
          Queries whether the specified classifier represents a UML association class.
static boolean isClass(org.eclipse.emf.ecore.EClassifier classifier)
          Queries whether the specified classifier represents a UML class.
static boolean isDataType(org.eclipse.emf.ecore.EClassifier classifier)
          Queries whether the specified classifier represents a UML data type.
static boolean isEnumeration(org.eclipse.emf.ecore.EClassifier classifier)
          Queries whether the specified classifier represents a UML enumeration.
static boolean isQuery(org.eclipse.emf.ecore.EOperation operation)
          Queries whether the specified operation is a query (side-effect free).
static boolean isSignal(org.eclipse.emf.ecore.EClassifier classifier)
          Queries whether the specified classifier represents a UML signal.
static void setAssociationClass(org.eclipse.emf.ecore.EClassifier classifier, boolean isAssociationClass)
          Sets whether the specified classifier represents a UML association class.
static void setAssociationClass(org.eclipse.emf.ecore.EReference reference, org.eclipse.emf.ecore.EClass associationClass)
          Sets the association class that an EReference represents (in its role of a UML association).
static void setClass(org.eclipse.emf.ecore.EClassifier classifier, boolean isClass)
          Sets whether the specified classifier represents a UML class.
static void setDataType(org.eclipse.emf.ecore.EClassifier classifier, boolean isDataType)
          Sets whether the specified classifier represents a UML data type.
static void setEnumeration(org.eclipse.emf.ecore.EClassifier classifier, boolean isEnumeration)
          Sets whether the specified classifier represents a UML enumeration.
static void setQuery(org.eclipse.emf.ecore.EOperation operation, boolean isQuery)
          Sets whether the specified operation is a query (side-effect free).
static void setSignal(org.eclipse.emf.ecore.EClassifier classifier, boolean isSignal)
          Sets whether the specified classifier represents a UML signal.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ANNOTATION_URI_CLASSIFIER

public static final java.lang.String ANNOTATION_URI_CLASSIFIER
Annotation that indicates what kind of a UML classifier is an EClass. The details map has a "kind" key mapping to one of the following values:

See Also:
Constant Field Values

ANNOTATION_URI_MEMBER_ENDS

public static final java.lang.String ANNOTATION_URI_MEMBER_ENDS
Annotation that stores references to which of the EReferences of an EClass representing an association class are its member ends.

See Also:
Constant Field Values

ANNOTATION_URI_ASSOCIATION_CLASS

public static final java.lang.String ANNOTATION_URI_ASSOCIATION_CLASS
Annotation that stores the reference to the EClass representing an association class that includes an EReference as a member end.

See Also:
Constant Field Values

ANNOTATION_URI_OPERATION

public static final java.lang.String ANNOTATION_URI_OPERATION
Annotation that stores details of the nature of a UML operation (modeled as an EOperation). The details map supports the following keys:

See Also:
Constant Field Values

ANNOTATION_URI_QUALIFIERS

public static final java.lang.String ANNOTATION_URI_QUALIFIERS
Annotation that stores qualifiers (if any) of a UML association end (modeled as an EReference). The qualifiers are EStructuralFeatures in the annotation's contents list.

See Also:
Constant Field Values

ANNOTATION_URI_SIGNALS

public static final java.lang.String ANNOTATION_URI_SIGNALS
Annotation that stores references to EClasses representing signals that an EClass can receive.

See Also:
Constant Field Values
Method Detail

isSignal

public static boolean isSignal(org.eclipse.emf.ecore.EClassifier classifier)
Queries whether the specified classifier represents a UML signal.

Parameters:
classifier - an OCL type
Returns:
whether it represents a UML signal

isAssociationClass

public static boolean isAssociationClass(org.eclipse.emf.ecore.EClassifier classifier)
Queries whether the specified classifier represents a UML association class.

Parameters:
classifier - an OCL type
Returns:
whether it represents a UML association class

isClass

public static boolean isClass(org.eclipse.emf.ecore.EClassifier classifier)
Queries whether the specified classifier represents a UML class.

Parameters:
classifier - an OCL type
Returns:
whether it represents a UML class

isDataType

public static boolean isDataType(org.eclipse.emf.ecore.EClassifier classifier)
Queries whether the specified classifier represents a UML data type. Note that an enumeration is a data type.

Parameters:
classifier - an OCL type
Returns:
whether it represents a UML data type

isEnumeration

public static boolean isEnumeration(org.eclipse.emf.ecore.EClassifier classifier)
Queries whether the specified classifier represents a UML enumeration.

Parameters:
classifier - an OCL type
Returns:
whether it represents a UML enumeration

isQuery

public static boolean isQuery(org.eclipse.emf.ecore.EOperation operation)
Queries whether the specified operation is a query (side-effect free).

Returns:
whether it represents a query operation

getMemberEnds

public static org.eclipse.emf.common.util.EList getMemberEnds(org.eclipse.emf.ecore.EClass associationClass)
Obtains the member ends of an EMF classifier representing a UML association class.

Parameters:
associationClass - representation of a UML association class
Returns:
its member ends, as a list of EReferences
See Also:
UMLTypeUtil.isAssociationClass(EClassifier), UMLTypeUtil.getAssociationClass(EReference)

getAssociationClass

public static org.eclipse.emf.ecore.EClass getAssociationClass(org.eclipse.emf.ecore.EReference reference)
Obtains the EClass representing the "class" aspect of the UML association class that the specified EReference represents.

Parameters:
reference - an association class reference
Returns:
the reference's association class
See Also:
UMLTypeUtil.getMemberEnds(EClass), UMLTypeUtil.isAssociationClass(EClassifier)

getQualifiers

public static org.eclipse.emf.common.util.EList getQualifiers(org.eclipse.emf.ecore.EStructuralFeature property)
Obtains the UML qualifiers, if any, associated with the specified property.

Parameters:
property - the representation of a UML property
Returns:
its qualifiers, as a list of EStructuralFeatures, if any

getProperty

public static org.eclipse.emf.ecore.EStructuralFeature getProperty(org.eclipse.emf.ecore.EStructuralFeature qualifier)
Queries the property that has the specified qualifier, if any.

Parameters:
qualifier - a UML qualifier
Returns:
the owning property, or null if none

getSignals

public static org.eclipse.emf.common.util.EList getSignals(org.eclipse.emf.ecore.EClass eclass)
Obtains the UML signals that the specified classifier can receive, if any.

Parameters:
eclass - an OCL type
Returns:
its signals, as a list of EClasses, if any

setSignal

public static void setSignal(org.eclipse.emf.ecore.EClassifier classifier,
                             boolean isSignal)
Sets whether the specified classifier represents a UML signal.

Parameters:
classifier - an OCL type
isSignal - whether it represents a UML signal

setAssociationClass

public static void setAssociationClass(org.eclipse.emf.ecore.EClassifier classifier,
                                       boolean isAssociationClass)
Sets whether the specified classifier represents a UML association class.

Parameters:
classifier - an OCL type
isAssociationClass - whether it represents a UML association class

setClass

public static void setClass(org.eclipse.emf.ecore.EClassifier classifier,
                            boolean isClass)
Sets whether the specified classifier represents a UML class.

Parameters:
classifier - an OCL type
isClass - whether it represents a UML class

setDataType

public static void setDataType(org.eclipse.emf.ecore.EClassifier classifier,
                               boolean isDataType)
Sets whether the specified classifier represents a UML data type. Note that an enumeration is a data type.

Parameters:
classifier - an OCL type
isDataType - whether it represents a UML data type

setEnumeration

public static void setEnumeration(org.eclipse.emf.ecore.EClassifier classifier,
                                  boolean isEnumeration)
Sets whether the specified classifier represents a UML enumeration.

Parameters:
classifier - an OCL type
isEnumeration - whether it represents a UML enumeration

setQuery

public static void setQuery(org.eclipse.emf.ecore.EOperation operation,
                            boolean isQuery)
Sets whether the specified operation is a query (side-effect free).

Parameters:
isQuery - whether it represents a query operation

addMemberEnd

public static void addMemberEnd(org.eclipse.emf.ecore.EClass associationClass,
                                org.eclipse.emf.ecore.EReference memberEnd)
Adds a member end to an EMF classifier representing a UML association class. This also sets the member end's association class reference.

Parameters:
associationClass - representation of a UML association class
memberEnd - the member end to add
See Also:
UMLTypeUtil.isAssociationClass(EClassifier), UMLTypeUtil.getAssociationClass(EReference)

setAssociationClass

public static void setAssociationClass(org.eclipse.emf.ecore.EReference reference,
                                       org.eclipse.emf.ecore.EClass associationClass)
Sets the association class that an EReference represents (in its role of a UML association). This is different than an association class member end, which is owned by an association class. In this case, the reference actually represents the association class.

Parameters:
reference - a reference representing a UML association class
associationClass - the Ecore representation of the association class's class-ness

addQualifier

public static void addQualifier(org.eclipse.emf.ecore.EStructuralFeature property,
                                org.eclipse.emf.ecore.EStructuralFeature qualifier)
Adds a UML qualifier to the specified property.

Parameters:
property - the representation of a UML property
qualifier - a qualifier to add

addSignal

public static void addSignal(org.eclipse.emf.ecore.EClass eclass,
                             org.eclipse.emf.ecore.EClass signal)
Adds a UML signal that the specified classifier can receive.

Parameters:
eclass - an OCL type
signal - a signal that it can receive

Copyright 2002, 2006 IBM Corporation and others.
All Rights Reserved.