Table of Contents

Class Profile

Namespace
NMF.Interop.Uml
Assembly
NMF.UMLInterop.dll

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

IEnumerableExpression<IModelElement>

ClassInstance

Gets the Class model for this type

public static IClass ClassInstance { get; }

Property Value

IClass

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

IOrderedSetExpression<IElementImport>

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

IOrderedSetExpression<IPackageImport>

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

IOrderedSetExpression<IPackage>

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

IPackage

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

IListExpression<IConstraint>

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

IOrderedSetExpression<IStereotype>

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

ITemplateSignature

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

IOrderedSetExpression<IType>

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

IOrderedSetExpression<IPackageMerge>

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

IOrderedSetExpression<IProfileApplication>

ReferencedElements

Gets the referenced model elements of this model element

public override IEnumerableExpression<IModelElement> ReferencedElements { get; }

Property Value

IEnumerableExpression<IModelElement>

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

IOrderedSetExpression<ITemplateBinding>

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

string

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

ISetExpression<IStereotype>

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 IProfile

The profile to apply.

Returns

ISetExpression<IEObject>

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

ISetExpression<IEObject>

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 object

The chain of diagnostics to which problems are to be appended.

context object

The cache of context-specific information.

Returns

bool

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 object

The chain of diagnostics to which problems are to be appended.

context object

The cache of context-specific information.

Returns

bool

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

IProfile

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 IClassifier

The classifier of which to create an instance.

Returns

IEObject

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 IPackageableElement

The element to import.

visibility VisibilityKind

The visibility for the new element import.

Returns

IElementImport

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 string

The name for the new class, or null.

isAbstract bool

Whether the new class should be abstract.

Returns

IClass

CreateOwnedEnumeration(string)

Creates a enumeration with the specified name as an owned type of this package.

public IEnumeration CreateOwnedEnumeration(string name)

Parameters

name string

The name for the new enumeration, or null.

Returns

IEnumeration

CreateOwnedInterface(string)

Creates an interface with the specified name as an owned type of this package.

public IInterface CreateOwnedInterface(string name)

Parameters

name string

The name for the new interface, or null.

Returns

IInterface

CreateOwnedPrimitiveType(string)

Creates a primitive type with the specified name as an owned type of this package.

public IPrimitiveType CreateOwnedPrimitiveType(string name)

Parameters

name string

The name for the new primitive type, or null.

Returns

IPrimitiveType

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 string

The name for the new stereotype, or null.

isAbstract bool

Whether the new stereotype should be abstract.

Returns

IStereotype

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_ IPackage

The package to import.

visibility VisibilityKind

The visibility for the new package import.

Returns

IPackageImport

Define()

Defines this profile by (re)creating Ecore representations of its current contents.

public IEPackage Define()

Returns

IEPackage

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 object

The options to use.

diagnostics object

The chain of diagnostics to which problems are to be appended.

context object

The cache of context-specific information.

Returns

IEPackage

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 object

The chain of diagnostics to which problems are to be appended.

context object

The cache of context-specific information.

Returns

bool

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

imps IEnumerable<IPackageableElement>

Returns

ISetExpression<IPackageableElement>

GetAllAppliedProfiles()

Retrieves all the profiles that are applied to this package, including profiles applied to its nesting package(s).

public ISetExpression<IProfile> GetAllAppliedProfiles()

Returns

ISetExpression<IProfile>

GetAllProfileApplications()

Retrieves all the profile applications for this package, including profile applications for its nesting package(s).

public ISetExpression<IProfileApplication> GetAllProfileApplications()

Returns

ISetExpression<IProfileApplication>

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 string

The qualified name of the applied profile to retrieve.

Returns

IProfile

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 string

The qualified name of the applied profile to retrieve.

recurse bool

Whether to look in nesting packages.

Returns

IProfile

GetAppliedProfiles()

Retrieves the profiles that are applied to this package.

public ISetExpression<IProfile> GetAppliedProfiles()

Returns

ISetExpression<IProfile>

GetAttributeValue(string, int)

Resolves the given attribute name

protected override object GetAttributeValue(string attribute, int index)

Parameters

attribute string

The requested attribute name

index int

The index of this attribute

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

IClass

GetCollectionForFeature(string)

Gets the Model element collection for the given feature

protected override IList GetCollectionForFeature(string feature)

Parameters

feature string

The 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 object

The 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

IEPackage

GetDefinition(INamedElement)

Retrieves the current definition (Ecore representation) of the specified named element in this profile.

public IENamedElement GetDefinition(INamedElement namedElement)

Parameters

namedElement INamedElement

The named element whose definition to retrieve.

Returns

IENamedElement

GetExpressionForAttribute(string)

Gets the property expression for the given attribute

protected override INotifyExpression<object> GetExpressionForAttribute(string attribute)

Parameters

attribute string

The 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 string

The 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

ISetExpression<IPackageableElement>

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

ISetExpression<IPackageableElement>

GetImportedPackages()

Retrieves the packages imported by this namespace.

public ISetExpression<IPackage> GetImportedPackages()

Returns

ISetExpression<IPackage>

GetModelElementForReference(string, int)

Resolves the given URI to a child model element

protected override IModelElement GetModelElementForReference(string reference, int index)

Parameters

reference string

The requested reference name

index int

The index of this reference

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

ISetExpression<string>

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

ISetExpression<IPackage>

GetOwnedExtensions(bool)

Retrieves the extensions owned by this profile, excluding non-required extensions if indicated.

public ISetExpression<IExtension> GetOwnedExtensions(bool requiredOnly)

Parameters

requiredOnly bool

Whether to retrieve only required extensions.

Returns

ISetExpression<IExtension>

GetOwnedMembers()

public ISetExpression<INamedElement> GetOwnedMembers()

Returns

ISetExpression<INamedElement>

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

ISetExpression<IStereotype>

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

ISetExpression<IType>

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 IProfile

The profile whose application to retrieve.

Returns

IProfileApplication

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 IProfile

The profile whose application to retrieve.

recurse bool

Whether to look in nesting packages.

Returns

IProfileApplication

GetReferencedMetaclasses()

Retrieves the metaclasses referenced by this profile.

public ISetExpression<IClass> GetReferencedMetaclasses()

Returns

ISetExpression<IClass>

GetReferencedMetamodels()

Retrieves the metamodels referenced by this profile.

public ISetExpression<IModel> GetReferencedMetamodels()

Returns

ISetExpression<IModel>

GetRelativePathForNonIdentifiedChild(IModelElement)

Gets the relative URI fragment for the given child model element

protected override string GetRelativePathForNonIdentifiedChild(IModelElement element)

Parameters

element IModelElement

The 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

imps IEnumerable<IPackageableElement>

Returns

ISetExpression<IPackageableElement>

IsDefined()

Determines whether this profile is defined.

public bool IsDefined()

Returns

bool

IsModelLibrary()

Determines whether this package is a model library.

public bool IsModelLibrary()

Returns

bool

IsProfileApplied(IProfile)

Determines whether the specified profile is applied to this package.

public bool IsProfileApplied(IProfile profile)

Parameters

profile IProfile

The profile in question.

Returns

bool

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

bool

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

el INamedElement

Returns

bool

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

bool

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 object

The chain of diagnostics to which problems are to be appended.

context object

The cache of context-specific information.

Returns

bool

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 object

The chain of diagnostics to which problems are to be appended.

context object

The cache of context-specific information.

Returns

bool

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 IModelElement

The new parent model element

oldParent IModelElement

The 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 IModelElement

The new parent model element

oldParent IModelElement

The 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

ISetExpression<IParameterableElement>

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 object

The chain of diagnostics to which problems are to be appended.

context object

The cache of context-specific information.

Returns

bool

SetFeature(string, object)

Sets a value to the given feature

protected override void SetFeature(string feature, object value)

Parameters

feature string

The requested feature

value object

The value that should be set to that feature

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 IProfile

The profile to unapply.

Returns

ISetExpression<IEObject>

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()

Returns

ISetExpression<IPackageableElement>