public class UMLReflectionImpl extends Object implements UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
Modifier and Type | Field and Description |
---|---|
static UMLReflectionImpl |
INSTANCE
Shared instance of the stateless reflection service.
|
BODY, DEFINITION, DERIVATION, INITIAL, INVARIANT, OCL_HELPER, POSTCONDITION, PRECONDITION, RELATED_TYPE, SAME_TYPE, STRICT_SUBTYPE, STRICT_SUPERTYPE, SUBTYPE, SUPERTYPE, UNRELATED_TYPE
Modifier and Type | Method and Description |
---|---|
void |
addConstrainedElement(Constraint constraint,
EObject constrainedElement)
Adds a constrainedElement to a constraint.
|
EClassifier |
asOCLType(EClassifier modelType)
Obtains the OCL type corresponding to the specified type from the
environment's type system.
|
CallOperationAction |
createCallOperationAction(EOperation operation)
Creates a CallOperationAction referencing the specified
operation.
|
Constraint |
createConstraint()
Creates a Constraint.
|
ExpressionInOCL<EClassifier,EParameter> |
createExpressionInOCL()
Creates an ExpressionInOCL.
|
EOperation |
createOperation(String name,
EClassifier resultType,
List<String> paramNames,
List<EClassifier> paramTypes)
Creates a new Operation.
|
EStructuralFeature |
createProperty(String name,
EClassifier resultType)
Creates a new Property.
|
SendSignalAction |
createSendSignalAction(EClassifier signal)
Creates a SendSignalAction referencing the specified
signal.
|
Collection<? extends EClassifier> |
getAllSupertypes(EClassifier classifier)
Obtains all of the classifiers that generalize the specified classifier.
|
EClass |
getAssociationClass(EStructuralFeature reference)
Obtains the association class that the specified reference represents,
as an
EClass , if any. |
List<EStructuralFeature> |
getAttributes(EClassifier classifier)
Obtains all of the attributes defined by and inherited by the specified
classifier.
|
List<EClassifier> |
getClassifiers(EPackage pkg)
Obtains the classifiers contained directly within the specified package.
|
EClassifier |
getCommonSuperType(EClassifier type1,
EClassifier type2)
Get the common supertype of two types.
|
List<EModelElement> |
getConstrainedElements(Constraint constraint)
Obtains the list of element constraint by a constraint, as a list of
EObject s. |
Constraint |
getConstraint(ExpressionInOCL<EClassifier,EParameter> specification)
Obtains the constraint owning the given specification, if any.
|
String |
getConstraintName(Constraint constraint)
Obtains the name of a constraint.
|
String |
getDescription(Object namedElement)
Default implementation just gets the name of the named element's
eClass or, if it is an
ETypedElement , the name of its type. |
EClassifier |
getEnumeration(EEnumLiteral enumerationLiteral)
Obtains the enumeration declaring the specified literal.
|
EEnumLiteral |
getEnumerationLiteral(EClassifier enumerationType,
String literalName)
Obtains the named literal of an enumeration.
|
List<EEnumLiteral> |
getEnumerationLiterals(EClassifier enumerationType)
Obtains the literals declared by the specified enumeration type.
|
List<EStructuralFeature> |
getMemberEnds(EClassifier associationClass)
Obtains the ends of the specified association class as a list of
EReference s. |
String |
getName(Object namedElement)
Obtains the name of an element, if it is a named element.
|
List<EPackage> |
getNestedPackages(EPackage pkg)
Obtains the packages nested within the specified nesting package, if
any.
|
EPackage |
getNestingPackage(EPackage pkg)
Obtains the parent package (or nearest parent package), if any, of the
specified package.
|
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. |
EClassifier |
getOCLType(Object metaElement)
Obtains the type of a meta-element (classifier, operation, property,
parameter, etc.).
|
EOperation |
getOperation(CallOperationAction callOperationAction)
Obtains the called operation referenced by the specified call action.
|
List<EOperation> |
getOperations(EClassifier classifier)
Obtains all of the operations defined by and inherited by the specified
classifier.
|
EClassifier |
getOwningClassifier(Object feature)
Obtains the classifier that declares the specified feature.
|
EPackage |
getPackage(EClassifier classifier)
Obtains the package containing (or nearest package of) the specified
classifier.
|
List<EParameter> |
getParameters(EOperation operation)
Obtains the formal parameters (excluding return parameters) of an
operation.
|
String |
getQualifiedName(Object namedElement)
Obtains the qualified name of an element ("::"-separated), if it is a
named element.
|
List<EStructuralFeature> |
getQualifiers(EStructuralFeature property)
Gets the qualifiers of an association end.
|
int |
getRelationship(EClassifier type1,
EClassifier type2)
Computes the relationship between two types.
|
EClass |
getSignal(SendSignalAction sendSignalAction)
Obtains the sent signal referenced by the specified send action.
|
List<EClassifier> |
getSignals(EClassifier owner)
Retrieves a list of all signal receptions defined by the specified
owner classifier. |
ExpressionInOCL<EClassifier,EParameter> |
getSpecification(Constraint constraint)
Obtains the specification of a constraint, if it is an
ExpressionInOCL.
|
String |
getStereotype(Constraint constraint)
Obtains the stereotype (one of the constants defined by this interface)
that identifies the kind of the specified constraint.
|
Object |
getStereotypeApplication(Object baseElement,
EClassifier stereotype)
Obtains the application (stereotype instance) of the specified stereotype
applied to the given base element, if the stereotype is indeed applied.
|
static boolean |
isAncestor(EObject ancestor,
EObject descendent)
Queries whether a prospective ancestor really is a container
(recursively) of the specified descendent.
|
boolean |
isAssociationClass(EClassifier eclass)
Determines whether the specified
eclass is an association
class. |
boolean |
isClass(Object metaElement)
Queries whether the specified model element is a class.
|
boolean |
isClassifier(Object metaElement)
Queries whether the specified model element is a classifier.
|
boolean |
isComparable(EClassifier type)
Queries whether the specified type is a comparable (fully ordered)
data type.
|
boolean |
isConstraint(Object metaElement)
Queries whether the specified model element is a constraint.
|
boolean |
isDataType(Object metaElement)
Queries whether the specified model element is a data type.
|
boolean |
isEnumeration(EClassifier type)
Queries whether the specified classifier is an enumeration.
|
boolean |
isMany(Object metaElement)
Queries whether the specified meta-element (already known to be a
property, parameter, or operation) has multiplicity many.
|
boolean |
isOperation(Object metaElement)
Queries whether the specified model element is an operation.
|
boolean |
isPackage(Object metaElement)
Queries whether the specified model element is a package.
|
boolean |
isProperty(Object metaElement)
Queries whether the specified model element is a property.
|
boolean |
isQuery(EOperation operation)
Determines whether the specified
operation is a query
operation. |
boolean |
isStatic(Object feature)
Queries whether a property or operation is static (applies to a classifier
rather than to its instances).
|
boolean |
isStereotype(EClassifier type)
Queries whether the specified model element is a stereotype.
|
void |
setConstraintName(Constraint constraint,
String name)
Sets the name of a constraint.
|
boolean |
setIsStatic(Object feature,
boolean isStatic)
Sets a property or operation static (applies to a classifier
rather than to its instances).
|
void |
setName(TypedElement<EClassifier> element,
String name)
Sets the name of the specified typed element.
|
void |
setSpecification(Constraint constraint,
ExpressionInOCL<EClassifier,EParameter> specification)
Sets the specification of a constraint.
|
void |
setStereotype(Constraint constraint,
String stereotype)
Sets the stereotype (one of the constants defined by this interface)
that identifies the kind of the specified constraint.
|
void |
setType(TypedElement<EClassifier> element,
EClassifier type)
Sets the type of the specified typed element.
|
public static final UMLReflectionImpl INSTANCE
public String getDescription(Object namedElement)
eClass
or, if it is an
ETypedElement
, the name of its type.getDescription
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
namedElement
- a named elementpublic String getName(Object namedElement)
UMLReflection
getName
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
namedElement
- a named elementnull
if it is not
a named elementpublic String getQualifiedName(Object namedElement)
UMLReflection
getQualifiedName
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
namedElement
- a named elementnull
if
it is not a named elementpublic EClassifier getOCLType(Object metaElement)
UMLReflection
getOCLType
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
metaElement
- an element of the environment's metamodelUMLReflection.isMany(Object)
public Collection<? extends EClassifier> getAllSupertypes(EClassifier classifier)
UMLReflection
getAllSupertypes
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
classifier
- a classifierpublic boolean isMany(Object metaElement)
UMLReflection
isMany
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
metaElement
- a property, parameter, or operationpublic EClassifier asOCLType(EClassifier modelType)
UMLReflection
asOCLType
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
modelType
- a type in the environmentpublic EPackage getNestingPackage(EPackage pkg)
UMLReflection
getNestingPackage
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
pkg
- a packagenull
if the given
package has no nesting packageUMLReflection.getNestedPackages(PK)
public List<EPackage> getNestedPackages(EPackage pkg)
UMLReflection
getNestedPackages
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
pkg
- a packageUMLReflection.getNestingPackage(PK)
public EPackage getPackage(EClassifier classifier)
UMLReflection
getPackage
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
classifier
- a classifier in the modelnull
if there
is nonepublic List<EClassifier> getClassifiers(EPackage pkg)
UMLReflection
getClassifiers
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
pkg
- a package in the modelpublic EClassifier getOwningClassifier(Object feature)
UMLReflection
getOwningClassifier
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
feature
- an operation or propertynull
)public List<EParameter> getParameters(EOperation operation)
UMLReflection
getParameters
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
operation
- an operation in the modelpublic EOperation createOperation(String name, EClassifier resultType, List<String> paramNames, List<EClassifier> paramTypes)
UMLReflection
Note that the new operation must be a query operation, as OCL can only define queries.
createOperation
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
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 namesUMLReflection.isQuery(Object)
public List<EOperation> getOperations(EClassifier classifier)
UMLReflection
getOperations
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
classifier
- a classifier in the modelpublic EStructuralFeature createProperty(String name, EClassifier resultType)
UMLReflection
createProperty
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
name
- the name of the new property (must not be null
)resultType
- the type of the property (not null
)public List<EStructuralFeature> getAttributes(EClassifier classifier)
UMLReflection
getAttributes
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
classifier
- a classifier in the modelpublic List<EClassifier> getSignals(EClassifier owner)
UMLReflection
owner
classifier. This must include also signals
defined by supertypes of the owner. This method is used for content-assist.getSignals
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
owner
- the owner type of the signal receptionsEClass
es), or an empty list if nonepublic boolean isQuery(EOperation operation)
operation
is a query
operation. By default, all operations are assumed to be queries.isQuery
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
operation
- an operationtrue
, by defaultpublic boolean isStatic(Object feature)
UMLReflection
isStatic
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
feature
- an operation or a propertypublic boolean isAssociationClass(EClassifier eclass)
eclass
is an association
class. By default, it is assumed that nothing is an association class
because Ecore does not directly support this concept.isAssociationClass
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
eclass
- an Ecore classfalse
, by defaultpublic EClass getAssociationClass(EStructuralFeature reference)
EClass
, if any. By default, it is assumed that nothing is
an association class because Ecore does not directly support this concept.getAssociationClass
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
reference
- a referencenull
, by defaultpublic List<EStructuralFeature> getMemberEnds(EClassifier associationClass)
EReference
s. By default, it is assumed that nothing is an
association class because Ecore does not directly support this concept.getMemberEnds
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
associationClass
- an EClass representing an association classUMLReflection.isAssociationClass(C)
public boolean isOperation(Object metaElement)
UMLReflection
isOperation
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
metaElement
- a model elementpublic boolean isPackage(Object metaElement)
UMLReflection
isPackage
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
metaElement
- a model elementpublic boolean isProperty(Object metaElement)
UMLReflection
isProperty
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
metaElement
- a model elementpublic boolean isClassifier(Object metaElement)
UMLReflection
isClassifier
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
metaElement
- a model elementpublic boolean isClass(Object metaElement)
UMLReflection
isClass
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
metaElement
- a model elementpublic boolean isConstraint(Object metaElement)
UMLReflection
isConstraint
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
metaElement
- a model elementpublic boolean isDataType(Object metaElement)
UMLReflection
isDataType
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
metaElement
- a model elementpublic boolean isEnumeration(EClassifier type)
UMLReflection
isEnumeration
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
type
- a type in the modelpublic EClassifier getEnumeration(EEnumLiteral enumerationLiteral)
UMLReflection
getEnumeration
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
enumerationLiteral
- an enumeration literalnull
)public List<EEnumLiteral> getEnumerationLiterals(EClassifier enumerationType)
UMLReflection
enumeration
.getEnumerationLiterals
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
enumerationType
- an enumerationpublic EEnumLiteral getEnumerationLiteral(EClassifier enumerationType, String literalName)
UMLReflection
enumeration
.getEnumerationLiteral
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
enumerationType
- an enumerationliteralName
- the name of a literalnull
if the
specified name does not match an existing literalpublic boolean isStereotype(EClassifier type)
UMLReflection
isStereotype
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
type
- a type in the modelpublic Object getStereotypeApplication(Object baseElement, EClassifier stereotype)
UMLReflection
getStereotypeApplication
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
baseElement
- a model elementstereotype
- a stereotype applied to the elementnull
if the stereotype is not appliedpublic boolean isComparable(EClassifier type)
UMLReflection
isComparable
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
type
- a type in the modelpublic CallOperationAction createCallOperationAction(EOperation operation)
UMLReflection
createCallOperationAction
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
operation
- the operation that is calledpublic EOperation getOperation(CallOperationAction callOperationAction)
UMLReflection
getOperation
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
callOperationAction
- an operation-call actionnull
)public SendSignalAction createSendSignalAction(EClassifier signal)
UMLReflection
createSendSignalAction
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
signal
- the signal that is sendpublic EClass getSignal(SendSignalAction sendSignalAction)
UMLReflection
getSignal
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
sendSignalAction
- a signal-send actionnull
)public Constraint createConstraint()
UMLReflection
createConstraint
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
public String getStereotype(Constraint constraint)
UMLReflection
getStereotype
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
constraint
- a constraintnull
)public void setStereotype(Constraint constraint, String stereotype)
UMLReflection
setStereotype
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
constraint
- a constraintstereotype
- its stereotype (must not be null
)public String getConstraintName(Constraint constraint)
UMLReflection
getConstraintName
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
constraint
- a constraintpublic void setConstraintName(Constraint constraint, String name)
UMLReflection
setConstraintName
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
constraint
- a constraintname
- the constraint namepublic ExpressionInOCL<EClassifier,EParameter> createExpressionInOCL()
UMLReflection
createExpressionInOCL
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
public ExpressionInOCL<EClassifier,EParameter> getSpecification(Constraint constraint)
UMLReflection
getSpecification
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
constraint
- a constraintnull
if it has none or it is not an ExpressionInOCLpublic void setSpecification(Constraint constraint, ExpressionInOCL<EClassifier,EParameter> specification)
UMLReflection
setSpecification
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
constraint
- a constraintspecification
- its specificationpublic Constraint getConstraint(ExpressionInOCL<EClassifier,EParameter> specification)
UMLReflection
getConstraint
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
specification
- a constraint specificationnull
if nonepublic List<EModelElement> getConstrainedElements(Constraint constraint)
UMLReflection
EObject
s. This list is modifiable, but only after an unsafe cast to
establish a lower type bound. Therefore the UMLReflection.addConstrainedElement(CT, EObject)
method
should be used instead.getConstrainedElements
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
constraint
- a constraintpublic void addConstrainedElement(Constraint constraint, EObject constrainedElement)
UMLReflection
addConstrainedElement
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
constraint
- the constraint to receiveconstrainedElement
- the constrained elementpublic List<EStructuralFeature> getQualifiers(EStructuralFeature property)
getQualifiers
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
property
- a property of the model classpublic EClassifier getCommonSuperType(EClassifier type1, EClassifier type2)
getCommonSuperType
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
type1
- type2
- public int getRelationship(EClassifier type1, EClassifier type2)
getRelationship
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
type1
- a typetype2
- another typeUMLReflection.UNRELATED_TYPE
, UMLReflection.STRICT_SUBTYPE
,
UMLReflection.STRICT_SUPERTYPE
, or UMLReflection.SAME_TYPE
according to the
relationship between the typespublic 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 uniquegetOCLType(EClassifier)
public static boolean isAncestor(EObject ancestor, EObject descendent)
EcoreUtil
operation, except that it does not
require the arguments to be InternalEObject
s.ancestor
- a prospective ancestor elementdescendent
- a prospective descendent elementtrue
if the ancestor contains (recursively) the
descendentpublic void setName(TypedElement<EClassifier> element, String name)
UMLReflection
setName
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
element
- a typed elementname
- the type element's nameTypedElement.getName()
public void setType(TypedElement<EClassifier> element, EClassifier type)
UMLReflection
setType
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
element
- a typed elementtype
- the type element's typeTypedElement.getType()
public boolean setIsStatic(Object feature, boolean isStatic)
UMLReflection
setIsStatic
in interface UMLReflection<EPackage,EClassifier,EOperation,EStructuralFeature,EEnumLiteral,EParameter,EObject,CallOperationAction,SendSignalAction,Constraint>
feature
- an operation or a propertyisStatic
- whether it is to be staticCopyright © 2005, 2018 IBM Corporation and others. All Rights Reserved.