Class Classifier
A classifier is a type. It can specify a generalization hierarchy by referencing its general classifiers. A classifier is also a namespace whose members can include features. Classifier is an abstract metaclass.
[AlternativeNamespace("http://schema.omg.org/spec/mof/2.0/emof.xmi")]
[XmlNamespace("http://schema.omg.org/spec/MOF/2.0/cmof.xml")]
[XmlNamespacePrefix("cmof")]
[ModelRepresentationClass("http://schema.omg.org/spec/MOF/2.0/cmof.xml#//Classifier")]
public abstract class Classifier : Namespace, IClassifier, IType, IPackageableElement, INamespace, INamedElement, IElement, 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
General
References the general classifier in the Generalization relationship. Subsets DirectedRelationship::target.
[XmlElementName("general")]
[XmlAttribute(true)]
public ISetExpression<IClassifier> General { get; }
Property Value
Package
References the owning package of a package. Subsets NamedElement::namespace and redefines Basic::Package::nestingPackage. Specifies the owning package of this classifier, if any.
[Browsable(false)]
[XmlElementName("package")]
[XmlAttribute(true)]
[XmlOpposite("ownedType")]
public IPackage Package { get; set; }
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
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
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
GetGenerals()
The general classifiers are the classifiers referenced by the generalization relationships. result = self.parents()
public ISetExpression<IClassifier> GetGenerals()
Returns
GetInheritedMembers()
The inheritedMember association is derived by inheriting the inheritable members of the parents. result = self.inherit(self.parents()->collect(p | p.inheritableMembers(self))
public ISetExpression<INamedElement> GetInheritedMembers()
Returns
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
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. self.allParents()->collect(c | c.member)->includes(n) result = if (self.inheritedMember->includes(n)) then (n.visibility <> #private) else true
public bool HasVisibilityOf(INamedElement n)
Parameters
Returns
Inherit(IEnumerable<INamedElement>)
The inherit operation is overridden to exclude redefined properties. 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
IsInstance(object)
public bool IsInstance(object @object)
Parameters
object
object
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
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
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)