Class Classifier
A classifier is a classification of instances - it describes a set of instances that have features in common. A classifier can specify a generalization hierarchy by referencing its general classifiers.
[XmlNamespace("http://www.omg.org/spec/MOF/20131001/cmof.xmi")]
[XmlNamespacePrefix("cmof")]
[ModelRepresentationClass("http://www.omg.org/spec/MOF/20131001/cmof.xmi#//Classifier")]
public abstract class Classifier : Namespace, IClassifier, IType, IPackageableElement, IRedefinableElement, INamespace, INamedElement, IElement, IObject, IModelElement, INotifyPropertyChanged, INotifyPropertyChanging
- Inheritance
-
Classifier
- Implements
- Derived
- Inherited Members
Constructors
Classifier()
Creates a new instance
public Classifier()
Properties
Children
Gets the child model elements of this model element
public override IEnumerableExpression<IModelElement> Children { get; }
Property Value
ClassInstance
Gets the Class model for this type
public static IClass ClassInstance { get; }
Property Value
Generalization
Specifies the Generalization relationships for this Classifier. These Generalizations navigaten to more general classifiers in the generalization hierarchy.
[Browsable(false)]
[XmlElementName("generalization")]
[XmlAttribute(false)]
[Containment]
[XmlOpposite("specific")]
public IOrderedSetExpression<IGeneralization> Generalization { get; }
Property Value
IsAbstract
If true, the Classifier does not provide a complete declaration and can typically not be instantiated. An abstract classifier is intended to be used by other classifiers e.g. as the target of general metarelationships or generalization relationships.
[TypeConverter(typeof(LowercaseBooleanConverter))]
[XmlElementName("isAbstract")]
[XmlAttribute(true)]
public bool IsAbstract { get; set; }
Property Value
IsFinalSpecialization
If true, the Classifier cannot be specialized by generalization. Note that this property is preserved through package merge operations; that is, the capability to specialize a Classifier (i.e., isFinalSpecialization =false) must be preserved in the resulting Classifier of a package merge operation where a Classifier with isFinalSpecialization =false is merged with a matching Classifier with isFinalSpecialization =true: the resulting Classifier will have isFinalSpecialization =false.
[TypeConverter(typeof(LowercaseBooleanConverter))]
[XmlElementName("isFinalSpecialization")]
[XmlAttribute(true)]
public bool IsFinalSpecialization { get; set; }
Property Value
IsLeaf
Indicates whether it is possible to further redefine a RedefinableElement. If the value is true, then it is not possible to further redefine the RedefinableElement. Note that this property is preserved through package merge operations; that is, the capability to redefine a RedefinableElement (i.e., isLeaf=false) must be preserved in the resulting RedefinableElement of a package merge operation where a RedefinableElement with isLeaf=false is merged with a matching RedefinableElement with isLeaf=true: the resulting RedefinableElement will have isLeaf=false. Default value is false.
[TypeConverter(typeof(LowercaseBooleanConverter))]
[XmlElementName("isLeaf")]
[XmlAttribute(true)]
public bool IsLeaf { get; set; }
Property Value
Package
Specifies the owning package of this classifier, if any.
[Browsable(false)]
[XmlElementName("package")]
[XmlAttribute(true)]
[XmlOpposite("ownedType")]
public IPackage Package { get; set; }
Property Value
RedefinedClassifier
References the Classifiers that are redefined by this Classifier.
[XmlElementName("redefinedClassifier")]
[XmlAttribute(true)]
public ISetExpression<IClassifier> RedefinedClassifier { get; }
Property Value
ReferencedElements
Gets the referenced model elements of this model element
public override IEnumerableExpression<IModelElement> ReferencedElements { get; }
Property Value
Methods
AllFeatures()
The query allFeatures() gives all of the features in the namespace of the classifier. In general, through mechanisms such as inheritance, this will be a larger set than feature. result = member->select(oclIsKindOf(Feature))
public ISetExpression<IFeature> AllFeatures()
Returns
AllParents()
The query allParents() gives all of the direct and indirect ancestors of a generalized Classifier. result = self.parents()->union(self.parents()->collect(p | p.allParents())
public ISetExpression<IClassifier> AllParents()
Returns
ConformsTo(IType)
The query conformsTo() gives true for a type that conforms to another. By default, two types do not conform to each other. This query is intended to be redefined for specific conformance situations. result = false
public bool ConformsTo(IType other)
Parameters
other
IType
Returns
GetAttributeValue(string, int)
Resolves the given attribute name
protected override object GetAttributeValue(string attribute, int index)
Parameters
Returns
- object
The attribute value or null if it could not be found
GetClass()
Gets the Class for this model element
public override IClass GetClass()
Returns
GetCollectionForFeature(string)
Gets the Model element collection for the given feature
protected override IList GetCollectionForFeature(string feature)
Parameters
feature
stringThe requested feature
Returns
- IList
A non-generic list of elements
GetCompositionName(object)
Gets the property name for the given container
protected override string GetCompositionName(object container)
Parameters
container
objectThe container object
Returns
- string
The name of the respective container reference
GetExpressionForAttribute(string)
Gets the property expression for the given attribute
protected override INotifyExpression<object> GetExpressionForAttribute(string attribute)
Parameters
attribute
stringThe requested attribute in upper case
Returns
- INotifyExpression<object>
An incremental property expression
GetExpressionForReference(string)
Gets the property expression for the given reference
protected override INotifyExpression<IModelElement> GetExpressionForReference(string reference)
Parameters
reference
stringThe requested reference in upper case
Returns
- INotifyExpression<IModelElement>
An incremental property expression
GetModelElementForReference(string, int)
Resolves the given URI to a child model element
protected override IModelElement GetModelElementForReference(string reference, int index)
Parameters
Returns
- IModelElement
The model element or null if it could not be found
GetRelativePathForNonIdentifiedChild(IModelElement)
Gets the relative URI fragment for the given child model element
protected override string GetRelativePathForNonIdentifiedChild(IModelElement element)
Parameters
element
IModelElementThe element that should be looked for
Returns
- string
A fragment of the relative URI
HasVisibilityOf(INamedElement)
The query hasVisibilityOf() determines whether a named element is visible in the classifier. By default all are visible. It is only called when the argument is something owned by a parent. result = (n.visibility <> VisibilityKind::private) self.allParents()->including(self)->collect(c | c.member)->includes(n)
public bool HasVisibilityOf(INamedElement n)
Parameters
Returns
Inherit(IEnumerable<INamedElement>)
The inherit operation is overridden to exclude redefined properties. The query inherit() defines how to inherit a set of elements. Here the operation is defined to inherit them all. It is intended to be redefined in circumstances where inheritance is affected by redefinition. result = inhs
public ISetExpression<INamedElement> Inherit(IEnumerable<INamedElement> inhs)
Parameters
inhs
IEnumerable<INamedElement>
Returns
InheritableMembers(IClassifier)
The query inheritableMembers() gives all of the members of a classifier that may be inherited in one of its descendants, subject to whatever visibility restrictions apply. c.allParents()->includes(self) result = member->select(m | c.hasVisibilityOf(m))
public ISetExpression<INamedElement> InheritableMembers(IClassifier c)
Parameters
Returns
IsConsistentWith(IRedefinableElement)
The query isConsistentWith() specifies, for any two RedefinableElements in a context in which redefinition is possible, whether redefinition would be logically consistent. By default, this is false; this operation must be overridden for subclasses of RedefinableElement to define the consistency conditions. redefinee.isRedefinitionContextValid(self) result = false
public bool IsConsistentWith(IRedefinableElement redefinee)
Parameters
redefinee
IRedefinableElement
Returns
IsInstance(IObject)
public bool IsInstance(IObject @object)
Parameters
object
IObject
Returns
IsRedefinitionContextValid(IRedefinableElement)
The query isRedefinitionContextValid() specifies whether the redefinition contexts of this RedefinableElement are properly related to the redefinition contexts of the specified RedefinableElement to allow this element to redefine the other. By default at least one of the redefinition contexts of this element must be a specialization of at least one of the redefinition contexts of the specified element. result = redefinitionContext->exists(c | c.allParents()->includes(redefined.redefinitionContext)))
public bool IsRedefinitionContextValid(IRedefinableElement redefined)
Parameters
redefined
IRedefinableElement
Returns
MaySpecializeType(IClassifier)
The query maySpecializeType() determines whether this classifier may have a generalization relationship to classifiers of the specified type. By default a classifier may specialize classifiers of the same or a more general type. It is intended to be redefined by classifiers that have different specialization constraints. result = self.oclIsKindOf(c.oclType)
public bool MaySpecializeType(IClassifier c)
Parameters
Returns
No_cycles_in_generalization(object, object)
Generalization hierarchies must be directed and acyclical. A classifier can not be both a transitively general and transitively specific classifier of the same classifier. not self.allParents()->includes(self)
public bool No_cycles_in_generalization(object diagnostics, object context)
Parameters
diagnostics
objectThe chain of diagnostics to which problems are to be appended.
context
objectThe cache of context-specific information.
Returns
Non_final_parents(object, object)
The parents of a classifier must be non-final. self.parents()->forAll(not isFinalSpecialization)
public bool Non_final_parents(object diagnostics, object context)
Parameters
diagnostics
objectThe chain of diagnostics to which problems are to be appended.
context
objectThe cache of context-specific information.
Returns
Non_leaf_redefinition(object, object)
A redefinable element can only redefine non-leaf redefinable elements self.redefinedElement->forAll(not isLeaf)
public bool Non_leaf_redefinition(object diagnostics, object context)
Parameters
diagnostics
objectThe chain of diagnostics to which problems are to be appended.
context
objectThe cache of context-specific information.
Returns
OnParentChanged(IModelElement, IModelElement)
Gets called when the parent model element of the current model element changes
protected override void OnParentChanged(IModelElement newParent, IModelElement oldParent)
Parameters
newParent
IModelElementThe new parent model element
oldParent
IModelElementThe old parent model element
OnParentChanging(IModelElement, IModelElement)
Gets called when the parent model element of the current model element is about to change
protected override void OnParentChanging(IModelElement newParent, IModelElement oldParent)
Parameters
newParent
IModelElementThe new parent model element
oldParent
IModelElementThe old parent model element
Parents()
The query parents() gives all of the immediate ancestors of a generalized Classifier. result = generalization.general
public ISetExpression<IClassifier> Parents()
Returns
Redefinition_consistent(object, object)
A redefining element must be consistent with each redefined element. self.redefinedElement->forAll(re | re.isConsistentWith(self))
public bool Redefinition_consistent(object diagnostics, object context)
Parameters
diagnostics
objectThe chain of diagnostics to which problems are to be appended.
context
objectThe cache of context-specific information.
Returns
Redefinition_context_valid(object, object)
At least one of the redefinition contexts of the redefining element must be a specialization of at least one of the redefinition contexts for each redefined element. self.redefinedElement->forAll(e | self.isRedefinitionContextValid(e))
public bool Redefinition_context_valid(object diagnostics, object context)
Parameters
diagnostics
objectThe chain of diagnostics to which problems are to be appended.
context
objectThe cache of context-specific information.
Returns
SetFeature(string, object)
Sets a value to the given feature
protected override void SetFeature(string feature, object value)
Parameters
Specialize_type(object, object)
A classifier may only specialize classifiers of a valid type. self.parents()->forAll(c | self.maySpecializeType(c))
public bool Specialize_type(object diagnostics, object context)
Parameters
diagnostics
objectThe chain of diagnostics to which problems are to be appended.
context
objectThe cache of context-specific information.