|
||||||||||
| 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 String |
BODY
Stereotype applied to operation body conditions. |
static String |
DEFINITION
Stereotype applied definition expressions. |
static String |
DERIVATION
Stereotype applied derived value expressions. |
static String |
INITIAL
Stereotype applied initial value expressions. |
static String |
INVARIANT
Stereotype applied to classifier invariant constraints. |
static String |
OCL_HELPER
Stereotype applied to herlp attributes and operations defined by definition constraints. |
static String |
POSTCONDITION
Stereotype applied to operation postcondition constraints. |
static 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 | |
|---|---|
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(String name,
C resultType,
List<String> paramNames,
List<C> paramTypes)
Creates a new Operation. |
P |
createProperty(String name,
C resultType)
Creates a new Property. |
SSA |
createSendSignalAction(C signal)
Creates a SendSignalAction referencing the specified signal. |
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. |
List<P> |
getAttributes(C classifier)
Obtains all of the attributes defined by and inherited by the specified classifier. |
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. |
List<EObject> |
getConstrainedElements(CT constraint)
Obtains the list of element constraint by a constraint, as a list of EObjects. |
CT |
getConstraint(ExpressionInOCL<C,PM> specification)
Obtains the constraint owning the given specification, if any. |
String |
getConstraintName(CT constraint)
Obtains the name of a constraint. |
String |
getDescription(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,
String literalName)
Obtains the named literal of an enumeration. |
List<EL> |
getEnumerationLiterals(C enumerationType)
Obtains the literals declared by the specified enumeration type. |
List<P> |
getMemberEnds(C associationClass)
Obtains the ends of the specified association class as a list of properties. |
String |
getName(Object namedElement)
Obtains the name of an element, if it is a named element. |
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(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. |
List<O> |
getOperations(C classifier)
Obtains all of the operations defined by and inherited by the specified classifier. |
C |
getOwningClassifier(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. |
List<PM> |
getParameters(O 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<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. |
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. |
String |
getStereotype(CT constraint)
Obtains the stereotype (one of the constants defined by this interface) that identifies the kind of the specified constraint. |
Object |
getStereotypeApplication(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(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(C type)
Queries whether the specified type is a comparable (fully ordered) data type. |
boolean |
isDataType(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(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 |
isProperty(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(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,
String name)
Sets the name of a constraint. |
void |
setName(TypedElement<C> element,
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,
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 String INVARIANT
getStereotype(CT),
Constant Field Valuesstatic final String PRECONDITION
getStereotype(CT),
Constant Field Valuesstatic final String POSTCONDITION
getStereotype(CT),
Constant Field Valuesstatic final String BODY
getStereotype(CT),
Constant Field Valuesstatic final String DEFINITION
getStereotype(CT),
Constant Field Valuesstatic final String INITIAL
getStereotype(CT),
Constant Field Valuesstatic final String DERIVATION
getStereotype(CT),
Constant Field Valuesstatic final 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(Object metaElement)
metaElement - an element of the environment's metamodel
isMany(Object)Collection<? extends C> getAllSupertypes(C classifier)
classifier - a classifier
boolean isMany(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)List<PK> getNestedPackages(PK pkg)
pkg - a package
getNestingPackage(PK)PK getPackage(C classifier)
classifier - a classifier in the model
null if there
is noneList<C> getClassifiers(PK pkg)
pkg - a package in the model
C getOwningClassifier(Object feature)
feature - an operation or property
null)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
EClasses), or an empty list if none
O createOperation(String name,
C resultType,
List<String> paramNames,
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)List<PM> getParameters(O operation)
operation - an operation in the model
List<O> getOperations(C classifier)
classifier - a classifier in the model
P createProperty(String name,
C resultType)
name - the name of the new property (must not be null)resultType - the type of the property (not null)
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(Object feature)
feature - an operation or a property
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 classList<P> getMemberEnds(C associationClass)
isAssociationClass(C) method.
associationClass - a classifier representing an association class
isAssociationClass(C)boolean isOperation(Object metaElement)
metaElement - a model element
boolean isProperty(Object metaElement)
metaElement - a model element
boolean isClassifier(Object metaElement)
metaElement - a model element
boolean isClass(Object metaElement)
metaElement - a model element
boolean isDataType(Object metaElement)
metaElement - a model element
boolean isStereotype(C type)
type - a type in the model
Object getStereotypeApplication(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)List<EL> getEnumerationLiterals(C enumerationType)
enumeration.
enumerationType - an enumeration
EL getEnumerationLiteral(C enumerationType,
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()
String getStereotype(CT constraint)
constraint - a constraint
null)
void setStereotype(CT constraint,
String stereotype)
constraint - a constraintstereotype - its stereotype (must not be null)String getConstraintName(CT constraint)
constraint - a constraint
void setConstraintName(CT constraint,
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 ExpressionInOCL
void setSpecification(CT constraint,
ExpressionInOCL<C,PM> specification)
constraint - a constraintspecification - its specificationCT getConstraint(ExpressionInOCL<C,PM> specification)
specification - a constraint specification
null if noneList<EObject> getConstrainedElements(CT constraint)
EObjects. This list is modifiable.
constraint - a constraint
String getName(Object namedElement)
namedElement - a named element
null if it is not
a named elementString getQualifiedName(Object namedElement)
namedElement - a named element
null if
it is not a named elementString getDescription(Object namedElement)
Choices.
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 supertype
int getRelationship(C type1,
C type2)
type1 - a classifier in the modeltype2 - another classifier in the model
void setName(TypedElement<C> element,
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()
|
Copyright 2002, 2007 IBM Corporation and others. All Rights Reserved. |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||