Class Package
A package is used to group elements, and provides a namespace for the grouped elements.
[XmlNamespace("http://www.omg.org/spec/MOF/20131001/cmof.xmi")]
[XmlNamespacePrefix("cmof")]
[ModelRepresentationClass("http://www.omg.org/spec/MOF/20131001/cmof.xmi#//Package")]
public class Package : Namespace, IPackage, IPackageableElement, INamespace, INamedElement, IElement, IObject, 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
ClassInstance
Gets the Class model for this type
public static IClass ClassInstance { get; }
Property Value
NestedPackage
References the packaged elements that are Packages.
[Browsable(false)]
[XmlElementName("nestedPackage")]
[XmlAttribute(false)]
[Containment]
[XmlOpposite("nestingPackage")]
public IOrderedSetExpression<IPackage> NestedPackage { get; }
Property Value
NestingPackage
References the Package that owns this Package.
[Browsable(false)]
[XmlElementName("nestingPackage")]
[XmlAttribute(true)]
[XmlOpposite("nestedPackage")]
public IPackage NestingPackage { get; set; }
Property Value
OwnedType
References the packaged elements that are Types.
[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.
[Browsable(false)]
[XmlElementName("packageMerge")]
[XmlAttribute(false)]
[Containment]
[XmlOpposite("receivingPackage")]
public IOrderedSetExpression<IPackageMerge> PackageMerge { get; }
Property Value
ReferencedElements
Gets the referenced model elements of this model element
public override IEnumerableExpression<IModelElement> ReferencedElements { 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.
[XmlAttribute(true)]
public string URI { get; set; }
Property Value
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
diagnosticsobjectThe chain of diagnostics to which problems are to be appended.
contextobjectThe cache of context-specific information.
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
featurestringThe 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
containerobjectThe 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
attributestringThe 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
referencestringThe 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
elementIModelElementThe 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. result = (ownedMember->includes(el)) or (elementImport->select(ei|ei.importedElement = #public)->collect(ei|ei.importedElement)->includes(el)) or (packageImport->select(pi|pi.visibility = #public)->collect(pi|pi.importedPackage.member->includes(el))->notEmpty()) self.member->includes(el)
public bool MakesVisible(INamedElement el)
Parameters
Returns
OnElements_public_or_privateCalled(OperationCallEventArgs)
Raises the Elements_public_or_privateCalled event
protected virtual void OnElements_public_or_privateCalled(OperationCallEventArgs eventArgs)
Parameters
eventArgsOperationCallEventArgsThe event data
OnElements_public_or_privateCalling(OperationCallEventArgs)
Raises the Elements_public_or_privateCalling event
protected virtual void OnElements_public_or_privateCalling(OperationCallEventArgs eventArgs)
Parameters
eventArgsOperationCallEventArgsThe event data
OnMakesVisibleCalled(OperationCallEventArgs)
Raises the MakesVisibleCalled event
protected virtual void OnMakesVisibleCalled(OperationCallEventArgs eventArgs)
Parameters
eventArgsOperationCallEventArgsThe event data
OnMakesVisibleCalling(OperationCallEventArgs)
Raises the MakesVisibleCalling event
protected virtual void OnMakesVisibleCalling(OperationCallEventArgs eventArgs)
Parameters
eventArgsOperationCallEventArgsThe event data
OnNestingPackageChanged(ValueChangedEventArgs)
Raises the NestingPackageChanged event
protected virtual void OnNestingPackageChanged(ValueChangedEventArgs eventArgs)
Parameters
eventArgsValueChangedEventArgsThe event data
OnNestingPackageChanging(ValueChangedEventArgs)
Raises the NestingPackageChanging event
protected virtual void OnNestingPackageChanging(ValueChangedEventArgs eventArgs)
Parameters
eventArgsValueChangedEventArgsThe event data
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
newParentIModelElementThe new parent model element
oldParentIModelElementThe 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
newParentIModelElementThe new parent model element
oldParentIModelElementThe old parent model element
OnURIChanged(ValueChangedEventArgs)
Raises the URIChanged event
protected virtual void OnURIChanged(ValueChangedEventArgs eventArgs)
Parameters
eventArgsValueChangedEventArgsThe event data
OnURIChanging(ValueChangedEventArgs)
Raises the URIChanging event
protected virtual void OnURIChanging(ValueChangedEventArgs eventArgs)
Parameters
eventArgsValueChangedEventArgsThe event data
OnVisibleMembersCalled(OperationCallEventArgs)
Raises the VisibleMembersCalled event
protected virtual void OnVisibleMembersCalled(OperationCallEventArgs eventArgs)
Parameters
eventArgsOperationCallEventArgsThe event data
OnVisibleMembersCalling(OperationCallEventArgs)
Raises the VisibleMembersCalling event
protected virtual void OnVisibleMembersCalling(OperationCallEventArgs eventArgs)
Parameters
eventArgsOperationCallEventArgsThe event data
SetFeature(string, object)
Sets a value to the given feature
protected override void SetFeature(string feature, object value)
Parameters
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
Events
Elements_public_or_privateCalled
Gets fired after the operation elements_public_or_private got called
public event EventHandler<OperationCallEventArgs> Elements_public_or_privateCalled
Event Type
Elements_public_or_privateCalling
Gets fired before the operation elements_public_or_private gets called
public event EventHandler<OperationCallEventArgs> Elements_public_or_privateCalling
Event Type
MakesVisibleCalled
Gets fired after the operation makesVisible got called
public event EventHandler<OperationCallEventArgs> MakesVisibleCalled
Event Type
MakesVisibleCalling
Gets fired before the operation makesVisible gets called
public event EventHandler<OperationCallEventArgs> MakesVisibleCalling
Event Type
NestingPackageChanged
Gets fired when the NestingPackage property changed its value
public event EventHandler<ValueChangedEventArgs> NestingPackageChanged
Event Type
NestingPackageChanging
Gets fired before the NestingPackage property changes its value
public event EventHandler<ValueChangedEventArgs> NestingPackageChanging
Event Type
URIChanged
Gets fired when the URI property changed its value
public event EventHandler<ValueChangedEventArgs> URIChanged
Event Type
URIChanging
Gets fired before the URI property changes its value
public event EventHandler<ValueChangedEventArgs> URIChanging
Event Type
VisibleMembersCalled
Gets fired after the operation visibleMembers got called
public event EventHandler<OperationCallEventArgs> VisibleMembersCalled
Event Type
VisibleMembersCalling
Gets fired before the operation visibleMembers gets called
public event EventHandler<OperationCallEventArgs> VisibleMembersCalling