Table of Contents

Class Package

Namespace
NMF.Interop.Legacy.Cmof
Assembly
NMF.UMLInterop.dll

A package is a namespace for its members, and may contain other packages. Only packageable elements can be owned members of a package. By virtue of being a namespace, a package can import either individual members of other packages, or all the members of other packages. In addition a package can be merged with other packages. A package is a container for types and other packages.

[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#//Package")]
public class Package : Namespace, IPackage, IPackageableElement, INamespace, INamedElement, IElement, IModelElement, INotifyPropertyChanged, INotifyPropertyChanging
Inheritance
Package
Implements
Inherited Members

Constructors

Package()

Creates a new instance

public Package()

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

NestedPackage

References the owned members that are Packages. Subsets Package::ownedMember and redefines Basic::Package::nestedPackage. The set of contained packages.

[Browsable(false)]
[XmlElementName("nestedPackage")]
[XmlAttribute(false)]
[Containment]
[XmlOpposite("nestingPackage")]
public IOrderedSetExpression<IPackage> NestedPackage { get; }

Property Value

IOrderedSetExpression<IPackage>

NestingPackage

References the owning package of a package. Subsets NamedElement::namespace and redefines Basic::Package::nestingPackage. The containing package.

[Browsable(false)]
[XmlElementName("nestingPackage")]
[XmlAttribute(true)]
[XmlOpposite("nestedPackage")]
public IPackage NestingPackage { get; set; }

Property Value

IPackage

OwnedType

References the owned members that are Types. Subsets Package::ownedMember and redefines Basic::Package::ownedType. The set of contained types.

[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. Subsets Element::ownedElement.

[Browsable(false)]
[XmlElementName("packageMerge")]
[XmlAttribute(false)]
[Containment]
[XmlOpposite("receivingPackage")]
public IOrderedSetExpression<IPackageMerge> PackageMerge { get; }

Property Value

IOrderedSetExpression<IPackageMerge>

ReferencedElements

Gets the referenced model elements of this model element

public override IEnumerableExpression<IModelElement> ReferencedElements { get; }

Property Value

IEnumerableExpression<IModelElement>

URI

The uRI property

[XmlElementName("uri")]
[XmlAttribute(true)]
public string URI { get; set; }

Property Value

string

Methods

Elements_public_or_private(object, object)

If an element that is owned by a package has visibility, it is public or private. self.ownedElements->forAll(e | e.visibility->notEmpty() implies e.visbility = #public or e.visibility = #private)

public bool Elements_public_or_private(object diagnostics, object context)

Parameters

diagnostics object
context object

Returns

bool

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

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

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

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

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. self.member->includes(el) result = (ownedMember->includes(el)) or (elementImport-> select(ei|ei.visibility = #public)-> collect(ei|ei.importedElement)->includes(el)) or (packageImport-> select(pi|pi.visibility = #public)-> collect(pi| pi.importedPackage.member->includes(el))->notEmpty())

public bool MakesVisible(INamedElement el)

Parameters

el INamedElement

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

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

VisibleMembers()

The query visibleMembers() defines which members of a Package can be accessed outside it. result = member->select( m | self.makesVisible(m))

public ISetExpression<IPackageableElement> VisibleMembers()

Returns

ISetExpression<IPackageableElement>