Class Profile
A profile defines limited extensions to a reference metamodel with the purpose of adapting the metamodel to a specific platform or domain. <p>From package UML::Packages.</p>
[XmlNamespace("http://www.eclipse.org/uml2/5.0.0/UML")]
[XmlNamespacePrefix("uml")]
[ModelRepresentationClass("http://www.eclipse.org/uml2/5.0.0/UML#//Profile")]
public class Profile : PackageableElement, IProfile, IPackage, ITemplateableElement, IPackageableElement, IParameterableElement, INamespace, INamedElement, IElement, IEModelElement, IModelElement, INotifyPropertyChanged, INotifyPropertyChanging
- Inheritance
-
Profile
- Implements
- Inherited Members
Constructors
Profile()
Creates a new instance
public Profile()
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
MetaclassReference
References a metaclass that may be extended. <p>From package UML::Packages.</p>
[Browsable(false)]
[XmlElementName("metaclassReference")]
[XmlAttribute(false)]
[Containment]
public IOrderedSetExpression<IElementImport> MetaclassReference { get; }
Property Value
MetamodelReference
References a package containing (directly or indirectly) metaclasses that may be extended. <p>From package UML::Packages.</p>
[Browsable(false)]
[XmlElementName("metamodelReference")]
[XmlAttribute(false)]
[Containment]
public IOrderedSetExpression<IPackageImport> MetamodelReference { get; }
Property Value
NestedPackage
References the packaged elements that are Packages. <p>From package UML::Packages.</p>
[Browsable(false)]
[XmlElementName("nestedPackage")]
[XmlAttribute(false)]
[Containment]
[XmlOpposite("nestingPackage")]
public IOrderedSetExpression<IPackage> NestedPackage { get; }
Property Value
NestingPackage
References the Package that owns this Package. <p>From package UML::Packages.</p>
[Browsable(false)]
[XmlElementName("nestingPackage")]
[XmlAttribute(true)]
[XmlOpposite("nestedPackage")]
public IPackage NestingPackage { get; set; }
Property Value
OwnedRule
Specifies a set of Constraints owned by this Namespace. <p>From package UML::CommonStructure.</p>
[Browsable(false)]
[XmlElementName("ownedRule")]
[XmlAttribute(false)]
[Containment]
[XmlOpposite("context")]
public IListExpression<IConstraint> OwnedRule { get; }
Property Value
OwnedStereotype
References the Stereotypes that are owned by the Package. <p>From package UML::Packages.</p>
[Browsable(false)]
[XmlElementName("ownedStereotype")]
[XmlAttribute(false)]
[Containment]
public IOrderedSetExpression<IStereotype> OwnedStereotype { get; }
Property Value
OwnedTemplateSignature
The optional TemplateSignature specifying the formal TemplateParameters for this TemplateableElement. If a TemplateableElement has a TemplateSignature, then it is a template. <p>From package UML::CommonStructure.</p>
[Browsable(false)]
[XmlElementName("ownedTemplateSignature")]
[XmlAttribute(false)]
[Containment]
[XmlOpposite("template")]
public ITemplateSignature OwnedTemplateSignature { get; set; }
Property Value
OwnedType
References the packaged elements that are Types. <p>From package UML::Packages.</p>
[Browsable(false)]
[XmlElementName("ownedType")]
[XmlAttribute(false)]
[Containment]
[XmlOpposite("package")]
public IOrderedSetExpression<IType> OwnedType { get; }
Property Value
PackageMerge
References the PackageMerges that are owned by this Package. <p>From package UML::Packages.</p>
[Browsable(false)]
[XmlElementName("packageMerge")]
[XmlAttribute(false)]
[Containment]
[XmlOpposite("receivingPackage")]
public IOrderedSetExpression<IPackageMerge> PackageMerge { get; }
Property Value
ProfileApplication
References the ProfileApplications that indicate which profiles have been applied to the Package. <p>From package UML::Packages.</p>
[Browsable(false)]
[XmlElementName("profileApplication")]
[XmlAttribute(false)]
[Containment]
[XmlOpposite("applyingPackage")]
public IOrderedSetExpression<IProfileApplication> ProfileApplication { get; }
Property Value
ReferencedElements
Gets the referenced model elements of this model element
public override IEnumerableExpression<IModelElement> ReferencedElements { get; }
Property Value
TemplateBinding
The optional TemplateBindings from this TemplateableElement to one or more templates. <p>From package UML::CommonStructure.</p>
[Browsable(false)]
[XmlElementName("templateBinding")]
[XmlAttribute(false)]
[Containment]
[XmlOpposite("boundElement")]
public IOrderedSetExpression<ITemplateBinding> TemplateBinding { get; }
Property Value
URI
Provides an identifier for the package that can be used for many purposes. A URI is the universally unique identification of the package following the IETF URI specification, RFC 2396 http://www.ietf.org/rfc/rfc2396.txt and it must comply with those syntax rules. <p>From package UML::Packages.</p>
[XmlAttribute(true)]
public string URI { get; set; }
Property Value
Methods
AllApplicableStereotypes()
The query allApplicableStereotypes() returns all the directly or indirectly owned stereotypes, including stereotypes contained in sub-profiles. result = (let ownedPackages : Bag(Package) = ownedMember->select(oclIsKindOf(Package))->collect(oclAsType(Package)) in ownedStereotype->union(ownedPackages.allApplicableStereotypes())->flatten()->asSet() ) <p>From package UML::Packages.</p>
public ISetExpression<IStereotype> AllApplicableStereotypes()
Returns
ApplyProfile(IProfile)
Applies the current definition of the specified profile to this package and automatically applies required stereotypes in the profile to elements within this package's namespace hieararchy. If a different definition is already applied, automatically migrates any associated stereotype values on a "best effort" basis (matching classifiers and structural features by name).
public ISetExpression<IEObject> ApplyProfile(IProfile profile)
Parameters
profile
IProfileThe profile to apply.
Returns
ApplyProfiles(IEnumerable<IProfile>)
Applies the current definitions of the specified profiles to this package and automatically applies required stereotypes in the profiles to elements within this package's namespace hieararchy. If different definitions are already applied, automatically migrates any associated stereotype values on a "best effort" basis (matching classifiers and structural features by name).
public ISetExpression<IEObject> ApplyProfiles(IEnumerable<IProfile> profiles)
Parameters
profiles
IEnumerable<IProfile>The profiles to apply.
Returns
Cannot_import_ownedMembers(object, object)
A Namespace cannot have an ElementImport to one of its ownedMembers. elementImport.importedElement.oclAsType(Element)->excludesAll(ownedMember)
public bool Cannot_import_ownedMembers(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
Cannot_import_self(object, object)
A Namespace cannot have a PackageImport to itself. packageImport.importedPackage.oclAsType(Namespace)->excludes(self)
public bool Cannot_import_self(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
ContainingProfile()
The query containingProfile() returns the closest profile directly or indirectly containing this package (or this package itself, if it is a profile). result = (if self.oclIsKindOf(Profile) then self.oclAsType(Profile) else self.namespace.oclAsType(Package).containingProfile() endif) <p>From package UML::Packages.</p>
public IProfile ContainingProfile()
Returns
Create(IClassifier)
Creates and returns an instance of (the Ecore representation of) the specified classifier defined in this profile.
public IEObject Create(IClassifier classifier)
Parameters
classifier
IClassifierThe classifier of which to create an instance.
Returns
CreateElementImport(IPackageableElement, VisibilityKind)
Creates an import of the specified element into this namespace with the specified visibility.
public IElementImport CreateElementImport(IPackageableElement element, VisibilityKind visibility)
Parameters
element
IPackageableElementThe element to import.
visibility
VisibilityKindThe visibility for the new element import.
Returns
CreateOwnedClass(string, bool)
Creates a(n) (abstract) class with the specified name as an owned type of this package.
public IClass CreateOwnedClass(string name, bool isAbstract)
Parameters
name
stringThe name for the new class, or null.
isAbstract
boolWhether the new class should be abstract.
Returns
CreateOwnedEnumeration(string)
Creates a enumeration with the specified name as an owned type of this package.
public IEnumeration CreateOwnedEnumeration(string name)
Parameters
name
stringThe name for the new enumeration, or null.
Returns
CreateOwnedInterface(string)
Creates an interface with the specified name as an owned type of this package.
public IInterface CreateOwnedInterface(string name)
Parameters
name
stringThe name for the new interface, or null.
Returns
CreateOwnedPrimitiveType(string)
Creates a primitive type with the specified name as an owned type of this package.
public IPrimitiveType CreateOwnedPrimitiveType(string name)
Parameters
name
stringThe name for the new primitive type, or null.
Returns
CreateOwnedStereotype(string, bool)
Creates a(n) (abstract) stereotype with the specified name as an owned stereotype of this profile.
public IStereotype CreateOwnedStereotype(string name, bool isAbstract)
Parameters
name
stringThe name for the new stereotype, or null.
isAbstract
boolWhether the new stereotype should be abstract.
Returns
CreatePackageImport(IPackage, VisibilityKind)
Creates an import of the specified package into this namespace with the specified visibility.
public IPackageImport CreatePackageImport(IPackage package_, VisibilityKind visibility)
Parameters
package_
IPackageThe package to import.
visibility
VisibilityKindThe visibility for the new package import.
Returns
Define()
Defines this profile by (re)creating Ecore representations of its current contents.
public IEPackage Define()
Returns
Define(object, object, object)
Defines this profile by (re)creating Ecore representations of its current contents, using the specified options, diagnostics, and context.
public IEPackage Define(object options, object diagnostics, object context)
Parameters
options
objectThe options to use.
diagnostics
objectThe chain of diagnostics to which problems are to be appended.
context
objectThe cache of context-specific information.
Returns
Elements_public_or_private(object, object)
If an element that is owned by a package has visibility, it is public or private. packagedElement->forAll(e | e.visibility<> null implies e.visibility = VisibilityKind::public or e.visibility = VisibilityKind::private)
public bool Elements_public_or_private(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
ExcludeCollisions(IEnumerable<IPackageableElement>)
The query excludeCollisions() excludes from a set of PackageableElements any that would not be distinguishable from each other in this Namespace. result = (imps->reject(imp1 | imps->exists(imp2 | not imp1.isDistinguishableFrom(imp2, self)))) <p>From package UML::CommonStructure.</p>
public ISetExpression<IPackageableElement> ExcludeCollisions(IEnumerable<IPackageableElement> imps)
Parameters
Returns
GetAllAppliedProfiles()
Retrieves all the profiles that are applied to this package, including profiles applied to its nesting package(s).
public ISetExpression<IProfile> GetAllAppliedProfiles()
Returns
GetAllProfileApplications()
Retrieves all the profile applications for this package, including profile applications for its nesting package(s).
public ISetExpression<IProfileApplication> GetAllProfileApplications()
Returns
GetAppliedProfile(string)
Retrieves the profile with the specified qualified name that is applied to this package, or null if no such profile is applied.
public IProfile GetAppliedProfile(string qualifiedName)
Parameters
qualifiedName
stringThe qualified name of the applied profile to retrieve.
Returns
GetAppliedProfile(string, bool)
Retrieves the profile with the specified qualified name that is applied to this package or any of its nesting packages (if indicated), or null if no such profile is applied.
public IProfile GetAppliedProfile(string qualifiedName, bool recurse)
Parameters
qualifiedName
stringThe qualified name of the applied profile to retrieve.
recurse
boolWhether to look in nesting packages.
Returns
GetAppliedProfiles()
Retrieves the profiles that are applied to this package.
public ISetExpression<IProfile> GetAppliedProfiles()
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
GetDefinition()
Retrieves the current definition (Ecore representation) of this profile.
public IEPackage GetDefinition()
Returns
GetDefinition(INamedElement)
Retrieves the current definition (Ecore representation) of the specified named element in this profile.
public IENamedElement GetDefinition(INamedElement namedElement)
Parameters
namedElement
INamedElementThe named element whose definition to retrieve.
Returns
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
GetImportedElements()
Retrieves the elements imported by this namespace.
public ISetExpression<IPackageableElement> GetImportedElements()
Returns
GetImportedMembers()
The importedMember property is derived as the PackageableElements that are members of this Namespace as a result of either PackageImports or ElementImports. result = (self.importMembers(elementImport.importedElement->asSet()->union(packageImport.importedPackage->collect(p | p.visibleMembers()))->asSet())) <p>From package UML::CommonStructure.</p>
public ISetExpression<IPackageableElement> GetImportedMembers()
Returns
GetImportedPackages()
Retrieves the packages imported by this namespace.
public ISetExpression<IPackage> GetImportedPackages()
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
GetNamesOfMember(INamedElement)
The query getNamesOfMember() gives a set of all of the names that a member would have in a Namespace, taking importing into account. In general a member can have multiple names in a Namespace if it is imported more than once with different aliases. result = (if self.ownedMember ->includes(element) then Set{element.name} else let elementImports : Set(ElementImport) = self.elementImport->select(ei | ei.importedElement = element) in if elementImports->notEmpty() then elementImports->collect(el | el.getName())->asSet() else self.packageImport->select(pi | pi.importedPackage.visibleMembers().oclAsType(NamedElement)->includes(element))-> collect(pi | pi.importedPackage.getNamesOfMember(element))->asSet() endif endif) <p>From package UML::CommonStructure.</p>
public ISetExpression<string> GetNamesOfMember(INamedElement element)
Parameters
element
INamedElement
Returns
GetNestedPackages()
Derivation for Package::/nestedPackage result = (packagedElement->select(oclIsKindOf(Package))->collect(oclAsType(Package))->asSet()) <p>From package UML::Packages.</p>
public ISetExpression<IPackage> GetNestedPackages()
Returns
GetOwnedExtensions(bool)
Retrieves the extensions owned by this profile, excluding non-required extensions if indicated.
public ISetExpression<IExtension> GetOwnedExtensions(bool requiredOnly)
Parameters
requiredOnly
boolWhether to retrieve only required extensions.
Returns
GetOwnedMembers()
public ISetExpression<INamedElement> GetOwnedMembers()
Returns
GetOwnedStereotypes()
Derivation for Package::/ownedStereotype result = (packagedElement->select(oclIsKindOf(Stereotype))->collect(oclAsType(Stereotype))->asSet()) <p>From package UML::Packages.</p>
public ISetExpression<IStereotype> GetOwnedStereotypes()
Returns
GetOwnedTypes()
Derivation for Package::/ownedType result = (packagedElement->select(oclIsKindOf(Type))->collect(oclAsType(Type))->asSet()) <p>From package UML::Packages.</p>
public ISetExpression<IType> GetOwnedTypes()
Returns
GetProfileApplication(IProfile)
Retrieves the application of the specified profile to this package, or null if no such profile is applied.
public IProfileApplication GetProfileApplication(IProfile profile)
Parameters
profile
IProfileThe profile whose application to retrieve.
Returns
GetProfileApplication(IProfile, bool)
Retrieves the application of the specified profile to this package or any of its nesting packages (if indicated), or null if no such profile is applied.
public IProfileApplication GetProfileApplication(IProfile profile, bool recurse)
Parameters
profile
IProfileThe profile whose application to retrieve.
recurse
boolWhether to look in nesting packages.
Returns
GetReferencedMetaclasses()
Retrieves the metaclasses referenced by this profile.
public ISetExpression<IClass> GetReferencedMetaclasses()
Returns
GetReferencedMetamodels()
Retrieves the metamodels referenced by this profile.
public ISetExpression<IModel> GetReferencedMetamodels()
Returns
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
ImportMembers(IEnumerable<IPackageableElement>)
The query importMembers() defines which of a set of PackageableElements are actually imported into the Namespace. This excludes hidden ones, i.e., those which have names that conflict with names of ownedMembers, and it also excludes PackageableElements that would have the indistinguishable names when imported. result = (self.excludeCollisions(imps)->select(imp | self.ownedMember->forAll(mem | imp.isDistinguishableFrom(mem, self)))) <p>From package UML::CommonStructure.</p>
public ISetExpression<IPackageableElement> ImportMembers(IEnumerable<IPackageableElement> imps)
Parameters
Returns
IsDefined()
Determines whether this profile is defined.
public bool IsDefined()
Returns
IsModelLibrary()
Determines whether this package is a model library.
public bool IsModelLibrary()
Returns
IsProfileApplied(IProfile)
Determines whether the specified profile is applied to this package.
public bool IsProfileApplied(IProfile profile)
Parameters
profile
IProfileThe profile in question.
Returns
IsTemplate()
The query isTemplate() returns whether this TemplateableElement is actually a template. result = (ownedTemplateSignature <> null) <p>From package UML::CommonStructure.</p>
public bool IsTemplate()
Returns
MakesVisible(INamedElement)
The query makesVisible() defines whether a Package makes an element visible outside itself. Elements with no visibility and elements with public visibility are made visible. member->includes(el) result = (ownedMember->includes(el) or (elementImport->select(ei|ei.importedElement = VisibilityKind::public)->collect(importedElement.oclAsType(NamedElement))->includes(el)) or (packageImport->select(visibility = VisibilityKind::public)->collect(importedPackage.member->includes(el))->notEmpty())) <p>From package UML::Packages.</p>
public bool MakesVisible(INamedElement el)
Parameters
Returns
MembersAreDistinguishable()
The Boolean query membersAreDistinguishable() determines whether all of the Namespace's members are distinguishable within it. result = (member->forAll( memb | member->excluding(memb)->forAll(other | memb.isDistinguishableFrom(other, self)))) <p>From package UML::CommonStructure.</p>
public bool MembersAreDistinguishable()
Returns
Members_distinguishable(object, object)
All the members of a Namespace are distinguishable within it. membersAreDistinguishable()
public bool Members_distinguishable(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
Metaclass_reference_not_specialized(object, object)
An element imported as a metaclassReference is not specialized or generalized in a Profile. metaclassReference.importedElement-> select(c | c.oclIsKindOf(Classifier) and (c.oclAsType(Classifier).allParents()->collect(namespace)->includes(self)))->isEmpty() and packagedElement-> select(oclIsKindOf(Classifier))->collect(oclAsType(Classifier).allParents())-> intersection(metaclassReference.importedElement->select(oclIsKindOf(Classifier))->collect(oclAsType(Classifier)))->isEmpty()
public bool Metaclass_reference_not_specialized(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
ParameterableElements()
The query parameterableElements() returns the set of ParameterableElements that may be used as the parameteredElements for a TemplateParameter of this TemplateableElement. By default, this set includes all the ownedElements. Subclasses may override this operation if they choose to restrict the set of ParameterableElements. result = (self.allOwnedElements()->select(oclIsKindOf(ParameterableElement)).oclAsType(ParameterableElement)->asSet()) <p>From package UML::CommonStructure.</p>
public ISetExpression<IParameterableElement> ParameterableElements()
Returns
References_same_metamodel(object, object)
All elements imported either as metaclassReferences or through metamodelReferences are members of the same base reference metamodel. metamodelReference.importedPackage.elementImport.importedElement.allOwningPackages()-> union(metaclassReference.importedElement.allOwningPackages() )->notEmpty()
public bool References_same_metamodel(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
UnapplyProfile(IProfile)
Unapplies the specified profile from this package and automatically unapplies stereotypes in the profile from elements within this package's namespace hieararchy.
public ISetExpression<IEObject> UnapplyProfile(IProfile profile)
Parameters
profile
IProfileThe profile to unapply.
Returns
VisibleMembers()
The query visibleMembers() defines which members of a Package can be accessed outside it. result = (member->select( m | m.oclIsKindOf(PackageableElement) and self.makesVisible(m))->collect(oclAsType(PackageableElement))->asSet()) <p>From package UML::Packages.</p>
public ISetExpression<IPackageableElement> VisibleMembers()