|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface UMLReflection<PK,C,O,P,EL,PM,S,COA,SSA,CT>
An interface providing reflection service for the metaclasses that the OCL borrows from UML.
See the Environment
class for a description of the
generic type parameters of this interface.
Field Summary | |
---|---|
static java.lang.String |
BODY
Stereotype applied to operation body conditions. |
static java.lang.String |
DEFINITION
Stereotype applied definition expressions. |
static java.lang.String |
DERIVATION
Stereotype applied derived value expressions. |
static java.lang.String |
INITIAL
Stereotype applied initial value expressions. |
static java.lang.String |
INVARIANT
Stereotype applied to classifier invariant constraints. |
static java.lang.String |
OCL_HELPER
Stereotype applied to herlp attributes and operations defined by definition constraints. |
static java.lang.String |
POSTCONDITION
Stereotype applied to operation postcondition constraints. |
static java.lang.String |
PRECONDITION
Stereotype applied to operation precondition constraints. |
static int |
RELATED_TYPE
Mask for testing the result of the getRelationship(C, C) method, to
check whether the first classifier is related by generalization to the
second classifier (being either a supertype or a subtype of it, including
possibly the same type). |
static int |
SAME_TYPE
Result of getRelationship(C, C) indicating that two classifiers are,
in fact, the same type. |
static int |
STRICT_SUBTYPE
Result of getRelationship(C, C) indicating that the first classifier
is a strict subtype of the second. |
static int |
STRICT_SUPERTYPE
Result of getRelationship(C, C) indicating that the first classifier
is a strict supertype of the second. |
static int |
SUBTYPE
Mask for testing the result of the getRelationship(C, C) method, to
check whether the first classifier is the same type as or a
strict subtype of the second. |
static int |
SUPERTYPE
Mask for testing the result of the getRelationship(C, C) method, to
check whether the first classifier is the same type as or a
strict supertype of the second. |
static int |
UNRELATED_TYPE
Result of getRelationship(C, C) indicating that the first classifier
is not related by generalization to the second classifier (being
different from it and neither a subtype nor a supertype). |
Method Summary | |
---|---|
void |
addConstrainedElement(CT constraint,
org.eclipse.emf.ecore.EObject constrainedElement)
Adds a constrainedElement to a constraint. |
C |
asOCLType(C modelType)
Obtains the OCL type corresponding to the specified type from the environment's type system. |
COA |
createCallOperationAction(O operation)
Creates a CallOperationAction referencing the specified operation. |
CT |
createConstraint()
Creates a Constraint. |
ExpressionInOCL<C,PM> |
createExpressionInOCL()
Creates an ExpressionInOCL. |
O |
createOperation(java.lang.String name,
C resultType,
java.util.List<java.lang.String> paramNames,
java.util.List<C> paramTypes)
Creates a new Operation. |
P |
createProperty(java.lang.String name,
C resultType)
Creates a new Property. |
SSA |
createSendSignalAction(C signal)
Creates a SendSignalAction referencing the specified signal. |
java.util.Collection<? extends C> |
getAllSupertypes(C classifier)
Obtains all of the classifiers that generalize the specified classifier. |
C |
getAssociationClass(P property)
Obtains the association class of which the specified property is an end, if any. |
java.util.List<P> |
getAttributes(C classifier)
Obtains all of the attributes defined by and inherited by the specified classifier. |
java.util.List<C> |
getClassifiers(PK pkg)
Obtains the classifiers contained directly within the specified package. |
C |
getCommonSuperType(C type1,
C type2)
Obtains the least common general classifier of two classifiers, if they have any in common. |
java.util.List<? extends org.eclipse.emf.ecore.EObject> |
getConstrainedElements(CT constraint)
Obtains the list of element constraint by a constraint, as a list of EObject s. |
CT |
getConstraint(ExpressionInOCL<C,PM> specification)
Obtains the constraint owning the given specification, if any. |
java.lang.String |
getConstraintName(CT constraint)
Obtains the name of a constraint. |
java.lang.String |
getDescription(java.lang.Object namedElement)
Obtains the user-presentable description of an element. |
C |
getEnumeration(EL enumerationLiteral)
Obtains the enumeration declaring the specified literal. |
EL |
getEnumerationLiteral(C enumerationType,
java.lang.String literalName)
Obtains the named literal of an enumeration. |
java.util.List<EL> |
getEnumerationLiterals(C enumerationType)
Obtains the literals declared by the specified enumeration type. |
java.util.List<P> |
getMemberEnds(C 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<PK> |
getNestedPackages(PK pkg)
Obtains the packages nested within the specified nesting package, if any. |
PK |
getNestingPackage(PK pkg)
Obtains the parent package (or nearest parent package), if any, of the specified package. |
C |
getOCLType(java.lang.Object metaElement)
Obtains the type of a meta-element (classifier, operation, property, parameter, etc.). |
O |
getOperation(COA callOperationAction)
Obtains the called operation referenced by the specified call action. |
java.util.List<O> |
getOperations(C classifier)
Obtains all of the operations defined by and inherited by the specified classifier. |
C |
getOwningClassifier(java.lang.Object feature)
Obtains the classifier that declares the specified feature. |
PK |
getPackage(C classifier)
Obtains the package containing (or nearest package of) the specified classifier. |
java.util.List<PM> |
getParameters(O 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<P> |
getQualifiers(P property)
Gets the qualifiers of a property representing a UML association end. |
int |
getRelationship(C type1,
C type2)
Obtains the relationship (according to generalization) between two classifiers in the user model. |
C |
getSignal(SSA sendSignalAction)
Obtains the sent signal referenced by the specified send action. |
java.util.List<C> |
getSignals(C owner)
Retrieves a list of all signal receptions defined by the specified owner classifier. |
ExpressionInOCL<C,PM> |
getSpecification(CT constraint)
Obtains the specification of a constraint, if it is an ExpressionInOCL. |
java.lang.String |
getStereotype(CT 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,
C stereotype)
Obtains the application (stereotype instance) of the specified stereotype applied to the given base element, if the stereotype is indeed applied. |
boolean |
isAssociationClass(C type)
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(C 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(C 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. |
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(O 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(C type)
Queries whether the specified model element is a stereotype. |
void |
setConstraintName(CT 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<C> element,
java.lang.String name)
Sets the name of the specified typed element. |
void |
setSpecification(CT constraint,
ExpressionInOCL<C,PM> specification)
Sets the specification of a constraint. |
void |
setStereotype(CT 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<C> element,
C type)
Sets the type of the specified typed element. |
Field Detail |
---|
static final java.lang.String INVARIANT
getStereotype(CT)
,
Constant Field Valuesstatic final java.lang.String PRECONDITION
getStereotype(CT)
,
Constant Field Valuesstatic final java.lang.String POSTCONDITION
getStereotype(CT)
,
Constant Field Valuesstatic final java.lang.String BODY
getStereotype(CT)
,
Constant Field Valuesstatic final java.lang.String DEFINITION
getStereotype(CT)
,
Constant Field Valuesstatic final java.lang.String INITIAL
getStereotype(CT)
,
Constant Field Valuesstatic final java.lang.String DERIVATION
getStereotype(CT)
,
Constant Field Valuesstatic final java.lang.String OCL_HELPER
static final int SAME_TYPE
getRelationship(C, C)
indicating that two classifiers are,
in fact, the same type.
static final int STRICT_SUBTYPE
getRelationship(C, C)
indicating that the first classifier
is a strict subtype of the second.
static final int SUBTYPE
getRelationship(C, C)
method, to
check whether the first classifier is the same type as or a
strict subtype of the second.
static final int STRICT_SUPERTYPE
getRelationship(C, C)
indicating that the first classifier
is a strict supertype of the second.
static final int SUPERTYPE
getRelationship(C, C)
method, to
check whether the first classifier is the same type as or a
strict supertype of the second.
static final int RELATED_TYPE
getRelationship(C, C)
method, to
check whether the first classifier is related by generalization to the
second classifier (being either a supertype or a subtype of it, including
possibly the same type).
static final int UNRELATED_TYPE
getRelationship(C, C)
indicating that the first classifier
is not related by generalization to the second classifier (being
different from it and neither a subtype nor a supertype).
Method Detail |
---|
C getOCLType(java.lang.Object metaElement)
metaElement
- an element of the environment's metamodel
isMany(Object)
java.util.Collection<? extends C> getAllSupertypes(C classifier)
classifier
- a classifier
boolean isMany(java.lang.Object metaElement)
metaElement
- a property, parameter, or operation
C asOCLType(C modelType)
modelType
- a type in the environment
PK getNestingPackage(PK pkg)
pkg
- a package
null
if the given
package has no nesting packagegetNestedPackages(PK)
java.util.List<PK> getNestedPackages(PK pkg)
pkg
- a package
getNestingPackage(PK)
PK getPackage(C classifier)
classifier
- a classifier in the model
null
if there
is nonejava.util.List<C> getClassifiers(PK pkg)
pkg
- a package in the model
C getOwningClassifier(java.lang.Object feature)
feature
- an operation or property
null
)java.util.List<C> getSignals(C owner)
owner
classifier. This must include also signals
defined by supertypes of the owner. This method is used for content-assist.
owner
- the owner type of the signal receptions
EClass
es), or an empty list if noneO createOperation(java.lang.String name, C resultType, java.util.List<java.lang.String> paramNames, java.util.List<C> paramTypes)
Note that the new operation must be a query operation, as OCL can only define queries.
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
isQuery(Object)
java.util.List<PM> getParameters(O operation)
operation
- an operation in the model
java.util.List<O> getOperations(C classifier)
classifier
- a classifier in the model
P createProperty(java.lang.String name, C resultType)
name
- the name of the new property (must not be null
)resultType
- the type of the property (not null
)
java.util.List<P> getAttributes(C classifier)
classifier
- a classifier in the model
boolean isQuery(O operation)
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.
operation
- an operation
boolean isStatic(java.lang.Object feature)
feature
- an operation or a property
boolean setIsStatic(java.lang.Object feature, boolean isStatic)
feature
- an operation or a propertyisStatic
- whether it is to be static
java.util.List<P> getQualifiers(P property)
property
- a property of the model class
boolean isAssociationClass(C type)
type
is an association
class.
type
- a classifier in the model
C getAssociationClass(P property)
property
- a property
null
if the property
is not an end of an association classjava.util.List<P> getMemberEnds(C associationClass)
isAssociationClass(C)
method.
associationClass
- a classifier representing an association class
isAssociationClass(C)
boolean isOperation(java.lang.Object metaElement)
metaElement
- a model element
boolean isPackage(java.lang.Object metaElement)
metaElement
- a model element
boolean isProperty(java.lang.Object metaElement)
metaElement
- a model element
boolean isClassifier(java.lang.Object metaElement)
metaElement
- a model element
boolean isClass(java.lang.Object metaElement)
metaElement
- a model element
boolean isConstraint(java.lang.Object metaElement)
metaElement
- a model element
boolean isDataType(java.lang.Object metaElement)
metaElement
- a model element
boolean isStereotype(C type)
type
- a type in the model
java.lang.Object getStereotypeApplication(java.lang.Object baseElement, C stereotype)
baseElement
- a model elementstereotype
- a stereotype applied to the element
null
if the stereotype is not appliedboolean isEnumeration(C type)
type
- a type in the model
C getEnumeration(EL enumerationLiteral)
enumerationLiteral
- an enumeration literal
null
)java.util.List<EL> getEnumerationLiterals(C enumerationType)
enumeration
.
enumerationType
- an enumeration
EL getEnumerationLiteral(C enumerationType, java.lang.String literalName)
enumeration
.
enumerationType
- an enumerationliteralName
- the name of a literal
null
if the
specified name does not match an existing literalboolean isComparable(C type)
type
- a type in the model
COA createCallOperationAction(O operation)
operation
- the operation that is called
O getOperation(COA callOperationAction)
callOperationAction
- an operation-call action
null
)SSA createSendSignalAction(C signal)
signal
- the signal that is send
C getSignal(SSA sendSignalAction)
sendSignalAction
- a signal-send action
null
)CT createConstraint()
java.lang.String getStereotype(CT constraint)
constraint
- a constraint
null
)void setStereotype(CT constraint, java.lang.String stereotype)
constraint
- a constraintstereotype
- its stereotype (must not be null
)java.lang.String getConstraintName(CT constraint)
constraint
- a constraint
void setConstraintName(CT constraint, java.lang.String name)
constraint
- a constraintname
- the constraint nameExpressionInOCL<C,PM> createExpressionInOCL()
ExpressionInOCL<C,PM> getSpecification(CT constraint)
constraint
- a constraint
null
if it has none or it is not an ExpressionInOCLvoid setSpecification(CT constraint, ExpressionInOCL<C,PM> specification)
constraint
- a constraintspecification
- its specificationCT getConstraint(ExpressionInOCL<C,PM> specification)
specification
- a constraint specification
null
if nonejava.util.List<? extends org.eclipse.emf.ecore.EObject> getConstrainedElements(CT constraint)
EObject
s. This list is modifiable, but only after an unsafe cast to
establish a lower type bound. Therefore the addConstrainedElement(CT, org.eclipse.emf.ecore.EObject)
method
should be used instead.
constraint
- a constraint
void addConstrainedElement(CT constraint, org.eclipse.emf.ecore.EObject constrainedElement)
constraint
- the constraint to receiveconstrainedElement
- the constrained elementjava.lang.String getName(java.lang.Object namedElement)
namedElement
- a named element
null
if it is not
a named elementjava.lang.String getQualifiedName(java.lang.Object namedElement)
namedElement
- a named element
null
if
it is not a named elementjava.lang.String getDescription(java.lang.Object namedElement)
Choice
s.
namedElement
- a named element
C getCommonSuperType(C type1, C type2)
type1
- a classifier in the modeltype2
- another classifier in the model
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 supertypeint getRelationship(C type1, C type2)
type1
- a classifier in the modeltype2
- another classifier in the model
void setName(TypedElement<C> element, java.lang.String name)
element
- a typed elementname
- the type element's nameTypedElement.getName()
void setType(TypedElement<C> element, C type)
element
- a typed elementtype
- the type element's typeTypedElement.getType()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |