org.eclipse.ocl.uml.internal
Class UMLReflectionImpl

java.lang.Object
  extended by org.eclipse.ocl.uml.internal.UMLReflectionImpl
All Implemented Interfaces:
UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>

public class UMLReflectionImpl
extends java.lang.Object
implements UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>

Implementation of the UML reflection service for the UML environment.

Author:
Christian W. Damus (cdamus)

Field Summary
 
Fields inherited from interface org.eclipse.ocl.utilities.UMLReflection
BODY, DEFINITION, DERIVATION, INITIAL, INVARIANT, OCL_HELPER, POSTCONDITION, PRECONDITION, RELATED_TYPE, SAME_TYPE, STRICT_SUBTYPE, STRICT_SUPERTYPE, SUBTYPE, SUPERTYPE, UNRELATED_TYPE
 
Constructor Summary
UMLReflectionImpl(UMLEnvironment env)
           
 
Method Summary
 void addConstrainedElement(org.eclipse.uml2.uml.Constraint constraint, org.eclipse.emf.ecore.EObject constrainedElement)
          Adds a constrainedElement to a constraint.
 org.eclipse.uml2.uml.Classifier asOCLType(org.eclipse.uml2.uml.Classifier modelType)
          Obtains the OCL type corresponding to the specified type from the environment's type system.
 org.eclipse.uml2.uml.CallOperationAction createCallOperationAction(org.eclipse.uml2.uml.Operation operation)
          Creates a CallOperationAction referencing the specified operation.
 org.eclipse.uml2.uml.Constraint createConstraint()
          Creates a Constraint.
 ExpressionInOCL<org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Parameter> createExpressionInOCL()
          Creates an ExpressionInOCL.
 org.eclipse.uml2.uml.Operation createOperation(java.lang.String name, org.eclipse.uml2.uml.Classifier resultType, java.util.List<java.lang.String> paramNames, java.util.List<org.eclipse.uml2.uml.Classifier> paramTypes)
          Creates a new Operation.
 org.eclipse.uml2.uml.Property createProperty(java.lang.String name, org.eclipse.uml2.uml.Classifier resultType)
          Creates a new Property.
 org.eclipse.uml2.uml.SendSignalAction createSendSignalAction(org.eclipse.uml2.uml.Classifier signal)
          Creates a SendSignalAction referencing the specified signal.
 java.util.Collection<? extends org.eclipse.uml2.uml.Classifier> getAllSupertypes(org.eclipse.uml2.uml.Classifier classifier)
          Obtains all of the classifiers that generalize the specified classifier.
 org.eclipse.uml2.uml.Classifier getAssociationClass(org.eclipse.uml2.uml.Property property)
          Obtains the association class of which the specified property is an end, if any.
 java.util.List<org.eclipse.uml2.uml.Property> getAttributes(org.eclipse.uml2.uml.Classifier classifier)
          Obtains all of the attributes defined by and inherited by the specified classifier.
 java.util.List<org.eclipse.uml2.uml.Classifier> getClassifiers(org.eclipse.uml2.uml.Package pkg)
          Obtains the classifiers contained directly within the specified package.
 org.eclipse.uml2.uml.Classifier getCommonSuperType(org.eclipse.uml2.uml.Classifier type1, org.eclipse.uml2.uml.Classifier type2)
          Obtains the least common general classifier of two classifiers, if they have any in common.
 java.util.List<org.eclipse.uml2.uml.Element> getConstrainedElements(org.eclipse.uml2.uml.Constraint constraint)
          Obtains the list of element constraint by a constraint, as a list of EObjects.
 org.eclipse.uml2.uml.Constraint getConstraint(ExpressionInOCL<org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Parameter> specification)
          Obtains the constraint owning the given specification, if any.
 java.lang.String getConstraintName(org.eclipse.uml2.uml.Constraint constraint)
          Obtains the name of a constraint.
 java.lang.String getDescription(java.lang.Object namedElement)
          Default implementation just gets the name of the named element's metaclass or, if it is a TypedElement, the name of its type.
 org.eclipse.uml2.uml.Classifier getEnumeration(org.eclipse.uml2.uml.EnumerationLiteral enumerationLiteral)
          Obtains the enumeration declaring the specified literal.
 org.eclipse.uml2.uml.EnumerationLiteral getEnumerationLiteral(org.eclipse.uml2.uml.Classifier enumerationType, java.lang.String literalName)
          Obtains the named literal of an enumeration.
 java.util.List<org.eclipse.uml2.uml.EnumerationLiteral> getEnumerationLiterals(org.eclipse.uml2.uml.Classifier enumerationType)
          Obtains the literals declared by the specified enumeration type.
 java.util.List<org.eclipse.uml2.uml.Property> getMemberEnds(org.eclipse.uml2.uml.Classifier associationClass)
          Obtains the ends of the specified association class as a list of properties.
 java.lang.String getName(java.lang.Object namedElement)
          Obtains the name of an element, if it is a named element.
 java.util.List<org.eclipse.uml2.uml.Package> getNestedPackages(org.eclipse.uml2.uml.Package pkg)
          Obtains the packages nested within the specified nesting package, if any.
 org.eclipse.uml2.uml.Package getNestingPackage(org.eclipse.uml2.uml.Package pkg)
          Obtains the parent package (or nearest parent package), if any, of the specified package.
 org.eclipse.uml2.uml.Classifier getOCLType(java.lang.Object metaElement)
          Obtains the type of a meta-element (classifier, operation, property, parameter, etc.).
 org.eclipse.uml2.uml.Operation getOperation(org.eclipse.uml2.uml.CallOperationAction callOperationAction)
          Obtains the called operation referenced by the specified call action.
 java.util.List<org.eclipse.uml2.uml.Operation> getOperations(org.eclipse.uml2.uml.Classifier classifier)
          Obtains all of the operations defined by and inherited by the specified classifier.
 org.eclipse.uml2.uml.Classifier getOwningClassifier(java.lang.Object feature)
          Obtains the classifier that declares the specified feature.
 org.eclipse.uml2.uml.Package getPackage(org.eclipse.uml2.uml.Classifier classifier)
          Obtains the package containing (or nearest package of) the specified classifier.
 java.util.List<org.eclipse.uml2.uml.Parameter> getParameters(org.eclipse.uml2.uml.Operation operation)
          Obtains the formal parameters (excluding return parameters) of an operation.
 java.lang.String getQualifiedName(java.lang.Object namedElement)
          Obtains the qualified name of an element ("::"-separated), if it is a named element.
 java.util.List<org.eclipse.uml2.uml.Property> getQualifiers(org.eclipse.uml2.uml.Property property)
          Gets the qualifiers of a property representing a UML association end.
 int getRelationship(org.eclipse.uml2.uml.Classifier type1, org.eclipse.uml2.uml.Classifier type2)
          Obtains the relationship (according to generalization) between two classifiers in the user model.
 org.eclipse.uml2.uml.Classifier getSignal(org.eclipse.uml2.uml.SendSignalAction sendSignalAction)
          Obtains the sent signal referenced by the specified send action.
 java.util.List<org.eclipse.uml2.uml.Classifier> getSignals(org.eclipse.uml2.uml.Classifier owner)
          Retrieves a list of all signal receptions defined by the specified owner classifier.
 ExpressionInOCL<org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Parameter> getSpecification(org.eclipse.uml2.uml.Constraint constraint)
          Obtains the specification of a constraint, if it is an ExpressionInOCL.
 java.lang.String getStereotype(org.eclipse.uml2.uml.Constraint constraint)
          Obtains the stereotype (one of the constants defined by this interface) that identifies the kind of the specified constraint.
 java.lang.Object getStereotypeApplication(java.lang.Object baseElement, org.eclipse.uml2.uml.Classifier stereotype)
          Obtains the application (stereotype instance) of the specified stereotype applied to the given base element, if the stereotype is indeed applied.
 boolean isAssociationClass(org.eclipse.uml2.uml.Classifier classifier)
          Determines whether the specified type is an association class.
 boolean isClass(java.lang.Object metaElement)
          Queries whether the specified model element is a class.
 boolean isClassifier(java.lang.Object metaElement)
          Queries whether the specified model element is a classifier.
 boolean isComparable(org.eclipse.uml2.uml.Classifier type)
          Queries whether the specified type is a comparable (fully ordered) data type.
 boolean isConstraint(java.lang.Object metaElement)
          Queries whether the specified model element is a constraint.
 boolean isDataType(java.lang.Object metaElement)
          Queries whether the specified model element is a data type.
 boolean isEnumeration(org.eclipse.uml2.uml.Classifier type)
          Queries whether the specified classifier is an enumeration.
 boolean isMany(java.lang.Object metaElement)
          Queries whether the specified meta-element (already known to be a property, parameter, or operation) has multiplicity many.
 boolean isOperation(java.lang.Object metaElement)
          Queries whether the specified model element is an operation.
protected  boolean isOrdered(java.lang.Object metaElement)
          Queries whether the specified MultiplicityElement or Operation is ordered.
 boolean isPackage(java.lang.Object metaElement)
          Queries whether the specified model element is a package.
 boolean isProperty(java.lang.Object metaElement)
          Queries whether the specified model element is a property.
 boolean isQuery(org.eclipse.uml2.uml.Operation operation)
          Determines whether the specified operation is a query operation.
 boolean isStatic(java.lang.Object feature)
          Queries whether a property or operation is static (applies to a classifier rather than to its instances).
 boolean isStereotype(org.eclipse.uml2.uml.Classifier type)
          Queries whether the specified model element is a stereotype.
protected  boolean isUnique(java.lang.Object metaElement)
          Queries whether the specified MultiplicityElement or Operation is unique.
 void setConstraintName(org.eclipse.uml2.uml.Constraint constraint, java.lang.String name)
          Sets the name of a constraint.
 boolean setIsStatic(java.lang.Object feature, boolean isStatic)
          Sets a property or operation static (applies to a classifier rather than to its instances).
 void setName(TypedElement<org.eclipse.uml2.uml.Classifier> element, java.lang.String name)
          Sets the name of the specified typed element.
 void setSpecification(org.eclipse.uml2.uml.Constraint constraint, ExpressionInOCL<org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Parameter> specification)
          Sets the specification of a constraint.
 void setStereotype(org.eclipse.uml2.uml.Constraint constraint, java.lang.String stereotype)
          Sets the stereotype (one of the constants defined by this interface) that identifies the kind of the specified constraint.
 void setType(TypedElement<org.eclipse.uml2.uml.Classifier> element, org.eclipse.uml2.uml.Classifier type)
          Sets the type of the specified typed element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UMLReflectionImpl

public UMLReflectionImpl(UMLEnvironment env)
Method Detail

getDescription

public java.lang.String getDescription(java.lang.Object namedElement)
Default implementation just gets the name of the named element's metaclass or, if it is a TypedElement, the name of its type.

Specified by:
getDescription in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
namedElement - a named element
Returns:
the named element's description

getName

public java.lang.String getName(java.lang.Object namedElement)
Description copied from interface: UMLReflection
Obtains the name of an element, if it is a named element.

Specified by:
getName in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
namedElement - a named element
Returns:
the named element's name, or null if it is not a named element

getQualifiedName

public java.lang.String getQualifiedName(java.lang.Object namedElement)
Description copied from interface: UMLReflection
Obtains the qualified name of an element ("::"-separated), if it is a named element.

Specified by:
getQualifiedName in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
namedElement - a named element
Returns:
the named element's qualified name, or null if it is not a named element

getOCLType

public org.eclipse.uml2.uml.Classifier getOCLType(java.lang.Object metaElement)
Description copied from interface: UMLReflection
Obtains the type of a meta-element (classifier, operation, property, parameter, etc.). If there is a predefined type provided by OCL (such as Boolean or Set), then it should be returned. For elements that have multiplicity (properties, parameters, operations), the type that is returned should be an OCL collection type if the element has many multiplicity.

Specified by:
getOCLType in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
metaElement - an element of the environment's metamodel
Returns:
its OCL type
See Also:
UMLReflection.isMany(Object)

isMany

public boolean isMany(java.lang.Object metaElement)
Description copied from interface: UMLReflection
Queries whether the specified meta-element (already known to be a property, parameter, or operation) has multiplicity many.

Specified by:
isMany in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
metaElement - a property, parameter, or operation
Returns:
whether it has many multiplicity

isUnique

protected boolean isUnique(java.lang.Object metaElement)
Queries whether the specified MultiplicityElement or Operation is unique.

Parameters:
metaElement - a multiplicity-element or operation
Returns:
whether it is unique

isOrdered

protected boolean isOrdered(java.lang.Object metaElement)
Queries whether the specified MultiplicityElement or Operation is ordered.

Parameters:
metaElement - a multiplicity-element or operation
Returns:
whether it is ordered

asOCLType

public org.eclipse.uml2.uml.Classifier asOCLType(org.eclipse.uml2.uml.Classifier modelType)
Description copied from interface: UMLReflection
Obtains the OCL type corresponding to the specified type from the environment's type system. If there is a predefined type provided by OCL (such as Boolean), then it should be returned. Otherwise, the environment's own type (the original modelType) is appropriate.

Specified by:
asOCLType in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
modelType - a type in the environment
Returns:
the corresponding OCL pre-defined type, or just modelType if none

getNestingPackage

public org.eclipse.uml2.uml.Package getNestingPackage(org.eclipse.uml2.uml.Package pkg)
Description copied from interface: UMLReflection
Obtains the parent package (or nearest parent package), if any, of the specified package.

Specified by:
getNestingPackage in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
pkg - a package
Returns:
the nearest nesting package, or null if the given package has no nesting package
See Also:
UMLReflection.getNestedPackages(PK)

getNestedPackages

public java.util.List<org.eclipse.uml2.uml.Package> getNestedPackages(org.eclipse.uml2.uml.Package pkg)
Description copied from interface: UMLReflection
Obtains the packages nested within the specified nesting package, if any.

Specified by:
getNestedPackages in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
pkg - a package
Returns:
the nested packages, or an empty list if none
See Also:
UMLReflection.getNestingPackage(PK)

getPackage

public org.eclipse.uml2.uml.Package getPackage(org.eclipse.uml2.uml.Classifier classifier)
Description copied from interface: UMLReflection
Obtains the package containing (or nearest package of) the specified classifier.

Specified by:
getPackage in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
classifier - a classifier in the model
Returns:
the nearest containing package, or null if there is none

getClassifiers

public java.util.List<org.eclipse.uml2.uml.Classifier> getClassifiers(org.eclipse.uml2.uml.Package pkg)
Description copied from interface: UMLReflection
Obtains the classifiers contained directly within the specified package.

Specified by:
getClassifiers in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
pkg - a package in the model
Returns:
the classifiers in the package, or an empty list if none

getOwningClassifier

public org.eclipse.uml2.uml.Classifier getOwningClassifier(java.lang.Object feature)
Description copied from interface: UMLReflection
Obtains the classifier that declares the specified feature.

Specified by:
getOwningClassifier in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
feature - an operation or property
Returns:
the classifier that defines the specified feature (should never be null)

getParameters

public java.util.List<org.eclipse.uml2.uml.Parameter> getParameters(org.eclipse.uml2.uml.Operation operation)
Description copied from interface: UMLReflection
Obtains the formal parameters (excluding return parameters) of an operation.

Specified by:
getParameters in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
operation - an operation in the model
Returns:
the operation's formal parameters, or an empty list if none

createOperation

public org.eclipse.uml2.uml.Operation createOperation(java.lang.String name,
                                                      org.eclipse.uml2.uml.Classifier resultType,
                                                      java.util.List<java.lang.String> paramNames,
                                                      java.util.List<org.eclipse.uml2.uml.Classifier> paramTypes)
Description copied from interface: UMLReflection
Creates a new Operation. Because OCL can only define query operations, a result type must be provided. This method is used in parsing the definition of additional operations, and in the construction of the OCL standard library types.

Note that the new operation must be a query operation, as OCL can only define queries.

Specified by:
createOperation in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
name - the name of the new operation (must not be null)
resultType - the result type of the operation (not null)
paramNames - the names of the formal parameters of the operaiton (may be an empty list if no parameters)
paramTypes - the parameter types, corresponding one-for-one with the parameter names
Returns:
the new operation
See Also:
UMLReflection.isQuery(Object)

getOperations

public java.util.List<org.eclipse.uml2.uml.Operation> getOperations(org.eclipse.uml2.uml.Classifier classifier)
Description copied from interface: UMLReflection
Obtains all of the operations defined by and inherited by the specified classifier. This method will not be called for the types pre-defined by OCL, as their operations are known by the parser.

Specified by:
getOperations in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
classifier - a classifier in the model
Returns:
the operations applicable to the specified classifier, or an empty list if none

createProperty

public org.eclipse.uml2.uml.Property createProperty(java.lang.String name,
                                                    org.eclipse.uml2.uml.Classifier resultType)
Description copied from interface: UMLReflection
Creates a new Property. A type must be provided. This method is used in parsing the definition of additional properties, and in the construction of the OCL standard library types.

Specified by:
createProperty in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
name - the name of the new property (must not be null)
resultType - the type of the property (not null)
Returns:
the new property

getAttributes

public java.util.List<org.eclipse.uml2.uml.Property> getAttributes(org.eclipse.uml2.uml.Classifier classifier)
Description copied from interface: UMLReflection
Obtains all of the attributes defined by and inherited by the specified classifier. This method will not be called for the types pre-defined by OCL (such as tuple and message types), as their attributes are known by the parser.

Specified by:
getAttributes in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
classifier - a classifier in the model
Returns:
the attributes applicable to the specified classifier, or an empty list if none

getAllSupertypes

public java.util.Collection<? extends org.eclipse.uml2.uml.Classifier> getAllSupertypes(org.eclipse.uml2.uml.Classifier classifier)
Description copied from interface: UMLReflection
Obtains all of the classifiers that generalize the specified classifier.

Specified by:
getAllSupertypes in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
classifier - a classifier
Returns:
all of its general classifiers, or an empty collection if none

isQuery

public boolean isQuery(org.eclipse.uml2.uml.Operation operation)
Description copied from interface: UMLReflection
Determines whether the specified operation is a query operation. Query operations are guaranteed not to alter the system; by the nature of the OCL, all queries defined by OCL are queries.

Specified by:
isQuery in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
operation - an operation
Returns:
whether it is a query operation

isStatic

public boolean isStatic(java.lang.Object feature)
Description copied from interface: UMLReflection
Queries whether a property or operation is static (applies to a classifier rather than to its instances).

Specified by:
isStatic in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
feature - an operation or a property
Returns:
whether it is static

setIsStatic

public boolean setIsStatic(java.lang.Object feature,
                           boolean isStatic)
Description copied from interface: UMLReflection
Sets a property or operation static (applies to a classifier rather than to its instances).
If the UML meta-model implementation (e.g. Ecore) does not support static features, or if the feature is not a feature, this mertghod does nothing and returns false.

Specified by:
setIsStatic in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
feature - an operation or a property
isStatic - whether it is to be static
Returns:
whether isStatic was successfully applied

isAssociationClass

public boolean isAssociationClass(org.eclipse.uml2.uml.Classifier classifier)
Description copied from interface: UMLReflection
Determines whether the specified type is an association class.

Specified by:
isAssociationClass in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
classifier - a classifier in the model
Returns:
whether it is an association class

getAssociationClass

public org.eclipse.uml2.uml.Classifier getAssociationClass(org.eclipse.uml2.uml.Property property)
Description copied from interface: UMLReflection
Obtains the association class of which the specified property is an end, if any.

Specified by:
getAssociationClass in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
property - a property
Returns:
the association class, or null if the property is not an end of an association class

getMemberEnds

public java.util.List<org.eclipse.uml2.uml.Property> getMemberEnds(org.eclipse.uml2.uml.Classifier associationClass)
Description copied from interface: UMLReflection
Obtains the ends of the specified association class as a list of properties. This association class was already determined to be such by the UMLReflection.isAssociationClass(C) method.

Specified by:
getMemberEnds in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
associationClass - a classifier representing an association class
Returns:
the properties representing its member ends (the association roles)
See Also:
UMLReflection.isAssociationClass(C)

isOperation

public boolean isOperation(java.lang.Object metaElement)
Description copied from interface: UMLReflection
Queries whether the specified model element is an operation.

Specified by:
isOperation in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
metaElement - a model element
Returns:
whether it is an operation

isPackage

public boolean isPackage(java.lang.Object metaElement)
Description copied from interface: UMLReflection
Queries whether the specified model element is a package.

Specified by:
isPackage in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
metaElement - a model element
Returns:
whether it is a package

isProperty

public boolean isProperty(java.lang.Object metaElement)
Description copied from interface: UMLReflection
Queries whether the specified model element is a property.

Specified by:
isProperty in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
metaElement - a model element
Returns:
whether it is a property

isClassifier

public boolean isClassifier(java.lang.Object metaElement)
Description copied from interface: UMLReflection
Queries whether the specified model element is a classifier.

Specified by:
isClassifier in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
metaElement - a model element
Returns:
whether it is a classifier

isClass

public boolean isClass(java.lang.Object metaElement)
Description copied from interface: UMLReflection
Queries whether the specified model element is a class.

Specified by:
isClass in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
metaElement - a model element
Returns:
whether it is a class

isConstraint

public boolean isConstraint(java.lang.Object metaElement)
Description copied from interface: UMLReflection
Queries whether the specified model element is a constraint.

Specified by:
isConstraint in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
metaElement - a model element
Returns:
whether it is a constraint

isDataType

public boolean isDataType(java.lang.Object metaElement)
Description copied from interface: UMLReflection
Queries whether the specified model element is a data type.

Specified by:
isDataType in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
metaElement - a model element
Returns:
whether it is a data type

isStereotype

public boolean isStereotype(org.eclipse.uml2.uml.Classifier type)
Description copied from interface: UMLReflection
Queries whether the specified model element is a stereotype. Note that a metamodel is not required to support stereotypes.

Specified by:
isStereotype in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
type - a type in the model
Returns:
whether it is a stereotype

getStereotypeApplication

public java.lang.Object getStereotypeApplication(java.lang.Object baseElement,
                                                 org.eclipse.uml2.uml.Classifier stereotype)
Description copied from interface: UMLReflection
Obtains the application (stereotype instance) of the specified stereotype applied to the given base element, if the stereotype is indeed applied.

Specified by:
getStereotypeApplication in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
baseElement - a model element
stereotype - a stereotype applied to the element
Returns:
the stereotype instance if the stereotype is applied to it, or null if the stereotype is not applied

isEnumeration

public boolean isEnumeration(org.eclipse.uml2.uml.Classifier type)
Description copied from interface: UMLReflection
Queries whether the specified classifier is an enumeration.

Specified by:
isEnumeration in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
type - a type in the model
Returns:
whether it is an enumeration

getEnumeration

public org.eclipse.uml2.uml.Classifier getEnumeration(org.eclipse.uml2.uml.EnumerationLiteral enumerationLiteral)
Description copied from interface: UMLReflection
Obtains the enumeration declaring the specified literal.

Specified by:
getEnumeration in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
enumerationLiteral - an enumeration literal
Returns:
the literal's declaring enumeration (should not be null)

getEnumerationLiterals

public java.util.List<org.eclipse.uml2.uml.EnumerationLiteral> getEnumerationLiterals(org.eclipse.uml2.uml.Classifier enumerationType)
Description copied from interface: UMLReflection
Obtains the literals declared by the specified enumeration type. This type was already determined to be an enumeration.

Specified by:
getEnumerationLiterals in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
enumerationType - an enumeration
Returns:
its literals, or an empty set if it has none

getEnumerationLiteral

public org.eclipse.uml2.uml.EnumerationLiteral getEnumerationLiteral(org.eclipse.uml2.uml.Classifier enumerationType,
                                                                     java.lang.String literalName)
Description copied from interface: UMLReflection
Obtains the named literal of an enumeration. This type was already determined to be an enumeration.

Specified by:
getEnumerationLiteral in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
enumerationType - an enumeration
literalName - the name of a literal
Returns:
the matching enumeration literal, or null if the specified name does not match an existing literal

isComparable

public boolean isComparable(org.eclipse.uml2.uml.Classifier type)
Description copied from interface: UMLReflection
Queries whether the specified type is a comparable (fully ordered) data type. Instances of a comparable type can be compared using the <, <=, >, and >= operations.

Specified by:
isComparable in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
type - a type in the model
Returns:
whether it is comparable

getOperation

public org.eclipse.uml2.uml.Operation getOperation(org.eclipse.uml2.uml.CallOperationAction callOperationAction)
Description copied from interface: UMLReflection
Obtains the called operation referenced by the specified call action.

Specified by:
getOperation in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
callOperationAction - an operation-call action
Returns:
the called operation (should not be null)

getSignal

public org.eclipse.uml2.uml.Classifier getSignal(org.eclipse.uml2.uml.SendSignalAction sendSignalAction)
Description copied from interface: UMLReflection
Obtains the sent signal referenced by the specified send action.

Specified by:
getSignal in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
sendSignalAction - a signal-send action
Returns:
the sent signal (should not be null)

getStereotype

public java.lang.String getStereotype(org.eclipse.uml2.uml.Constraint constraint)
Description copied from interface: UMLReflection
Obtains the stereotype (one of the constants defined by this interface) that identifies the kind of the specified constraint.

Specified by:
getStereotype in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
constraint - a constraint
Returns:
its stereotype (should not be null)

setStereotype

public void setStereotype(org.eclipse.uml2.uml.Constraint constraint,
                          java.lang.String stereotype)
Description copied from interface: UMLReflection
Sets the stereotype (one of the constants defined by this interface) that identifies the kind of the specified constraint.

Specified by:
setStereotype in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
constraint - a constraint
stereotype - its stereotype (must not be null)

getConstraintName

public java.lang.String getConstraintName(org.eclipse.uml2.uml.Constraint constraint)
Description copied from interface: UMLReflection
Obtains the name of a constraint.

Specified by:
getConstraintName in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
constraint - a constraint
Returns:
the constraint name

setConstraintName

public void setConstraintName(org.eclipse.uml2.uml.Constraint constraint,
                              java.lang.String name)
Description copied from interface: UMLReflection
Sets the name of a constraint.

Specified by:
setConstraintName in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
constraint - a constraint
name - the constraint name

getSpecification

public ExpressionInOCL<org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Parameter> getSpecification(org.eclipse.uml2.uml.Constraint constraint)
Description copied from interface: UMLReflection
Obtains the specification of a constraint, if it is an ExpressionInOCL.

Specified by:
getSpecification in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
constraint - a constraint
Returns:
its specification as an ExpressionInOCL, or null if it has none or it is not an ExpressionInOCL

setSpecification

public void setSpecification(org.eclipse.uml2.uml.Constraint constraint,
                             ExpressionInOCL<org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Parameter> specification)
Description copied from interface: UMLReflection
Sets the specification of a constraint.

Specified by:
setSpecification in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
constraint - a constraint
specification - its specification

getConstraint

public org.eclipse.uml2.uml.Constraint getConstraint(ExpressionInOCL<org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Parameter> specification)
Description copied from interface: UMLReflection
Obtains the constraint owning the given specification, if any.

Specified by:
getConstraint in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
specification - a constraint specification
Returns:
the constraint that it specifies, or null if none

getConstrainedElements

public java.util.List<org.eclipse.uml2.uml.Element> getConstrainedElements(org.eclipse.uml2.uml.Constraint constraint)
Description copied from interface: UMLReflection
Obtains the list of element constraint by a constraint, as a list of EObjects. This list is modifiable, but only after an unsafe cast to establish a lower type bound. Therefore the UMLReflection.addConstrainedElement(CT, org.eclipse.emf.ecore.EObject) method should be used instead.

Specified by:
getConstrainedElements in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
constraint - a constraint
Returns:
its constrained elements

addConstrainedElement

public void addConstrainedElement(org.eclipse.uml2.uml.Constraint constraint,
                                  org.eclipse.emf.ecore.EObject constrainedElement)
Description copied from interface: UMLReflection
Adds a constrainedElement to a constraint.

Specified by:
addConstrainedElement in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
constraint - the constraint to receive
constrainedElement - the constrained element

getQualifiers

public java.util.List<org.eclipse.uml2.uml.Property> getQualifiers(org.eclipse.uml2.uml.Property property)
Description copied from interface: UMLReflection
Gets the qualifiers of a property representing a UML association end.

Specified by:
getQualifiers in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
property - a property of the model class
Returns:
the qualifiers (as a list of properties), or an empty list if the property has no qualifiers

getCommonSuperType

public org.eclipse.uml2.uml.Classifier getCommonSuperType(org.eclipse.uml2.uml.Classifier type1,
                                                          org.eclipse.uml2.uml.Classifier type2)
Description copied from interface: UMLReflection
Obtains the least common general classifier of two classifiers, if they have any in common.

Specified by:
getCommonSuperType in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
type1 - a classifier in the model
type2 - another classifier in the model
Returns:
the least common supertype, or null if none. This result (if any) must be a type in the user model; an implementation must not return OclAny in the case that there is no common supertype

getRelationship

public int getRelationship(org.eclipse.uml2.uml.Classifier type1,
                           org.eclipse.uml2.uml.Classifier type2)
Description copied from interface: UMLReflection
Obtains the relationship (according to generalization) between two classifiers in the user model.

Specified by:
getRelationship in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
type1 - a classifier in the model
type2 - another classifier in the model
Returns:
one of the relationship constants defined by this class

getSignals

public java.util.List<org.eclipse.uml2.uml.Classifier> getSignals(org.eclipse.uml2.uml.Classifier owner)
Description copied from interface: UMLReflection
Retrieves a list of all signal receptions defined by the specified owner classifier. This must include also signals defined by supertypes of the owner. This method is used for content-assist.

Specified by:
getSignals in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
owner - the owner type of the signal receptions
Returns:
the available signals (as EClasses), or an empty list if none

createCallOperationAction

public org.eclipse.uml2.uml.CallOperationAction createCallOperationAction(org.eclipse.uml2.uml.Operation operation)
Description copied from interface: UMLReflection
Creates a CallOperationAction referencing the specified operation.

Specified by:
createCallOperationAction in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
operation - the operation that is called
Returns:
the CallOperationAction

createSendSignalAction

public org.eclipse.uml2.uml.SendSignalAction createSendSignalAction(org.eclipse.uml2.uml.Classifier signal)
Description copied from interface: UMLReflection
Creates a SendSignalAction referencing the specified signal.

Specified by:
createSendSignalAction in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
signal - the signal that is send
Returns:
the SendSignalAction

createConstraint

public org.eclipse.uml2.uml.Constraint createConstraint()
Description copied from interface: UMLReflection
Creates a Constraint.

Specified by:
createConstraint in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Returns:
the new Constraint

createExpressionInOCL

public ExpressionInOCL<org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Parameter> createExpressionInOCL()
Description copied from interface: UMLReflection
Creates an ExpressionInOCL.

Specified by:
createExpressionInOCL in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Returns:
the new ExpressionInOCL

setName

public void setName(TypedElement<org.eclipse.uml2.uml.Classifier> element,
                    java.lang.String name)
Description copied from interface: UMLReflection
Sets the name of the specified typed element.

Specified by:
setName in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
element - a typed element
name - the type element's name
See Also:
TypedElement.getName()

setType

public void setType(TypedElement<org.eclipse.uml2.uml.Classifier> element,
                    org.eclipse.uml2.uml.Classifier type)
Description copied from interface: UMLReflection
Sets the type of the specified typed element.

Specified by:
setType in interface UMLReflection<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint>
Parameters:
element - a typed element
type - the type element's type
See Also:
TypedElement.getType()