Package interface

A package is used to group elements, and provides a namespace for the grouped elements. A package can have one or more profile applications to indicate which profiles have been applied. Because a profile is a package, it is possible to apply a profile not only to packages, but also to profiles.

Inheritance Hierarchy

PackagePackageableElementNamedElementElement

Attributes

NameTypeDescription
appliedProfilesProfile [0..*] 
appliedStereotypesStereotype [0..*]Indicates which stereotypes from the selected profile (or profiles) are applied to the element. The selected profiles are the profiles that are applied to the containing package. Inherited from Element.
idstring Gets the unique ID of the element. Inherited from Element.
isDeprecatedboolean If true, using this element should be avoided, typically because it has been superseded. Inherited from NamedElement.
isNamespaceRootboolean Denotes where the namespace structure for your class model starts; all nested packages below a namespace root will form the namespace hierarchy for contained types. 
namestring The name of the NamedElement. Inherited from NamedElement.
ownedCommentsComment [0..*]The Comments owned by this Element. Inherited from Element.
ownerElement [0..1]Gets the element that owns this element. Inherited from Element.
packagePackage Gets the package that owns the packageable element. This property is derived. Inherited from PackageableElement.
packagedElementsPackageableElement [0..*]Specifies the packageable elements that are owned by this Package. 
taggedValuesTaggedValueSpecification [0..*]Contains 0 or more tagged values for the element. Inherited from Element.
visibilityVisibilityKind [0..1]Determines whether and how the NamedElement is visible outside its owning Namespace. Inherited from NamedElement.

Operations

NameReturnsDescription
getAllClasses()

Package.getAllClasses

X

Gets all classes that are owned by this Package, including the ones owned by nested packages.

Return value
Type: Class [0..*]
Class [0..*]Gets all classes that are owned by this Package, including the ones owned by nested packages. 
getAllDataTypes()

Package.getAllDataTypes

X

Gets all data types that are owned by this Package, including the ones owned by nested packages.

Return value
Type: DataType [0..*]
DataType [0..*]Gets all data types that are owned by this Package, including the ones owned by nested packages. 
getAllEnumerations()

Package.getAllEnumerations

X

Gets all enumerations that are owned by this Package, including the ones owned by nested packages.

Return value
Type: Enumeration [0..*]
Enumeration [0..*]Gets all enumerations that are owned by this Package, including the ones owned by nested packages. 
getAllInterfaces()

Package.getAllInterfaces

X

Gets all interfaces that are owned by this Package, including the ones owned by nested packages.

Return value
Type: Interface [0..*]
Interface [0..*]Gets all interfaces that are owned by this Package, including the ones owned by nested packages. 
getAllTypes()

Package.getAllTypes

X

Gets all types that are owned by this Package, including the ones owned by nested packages. This includes the following types of elements: Class, Interface, DataType, PrimitiveType and Enumeration.

Return value
Type: Classifier [0..*]
A subset of PackagedElements.
Classifier [0..*]Gets all types that are owned by this Package, including the ones owned by nested packages. This includes the following types of elements: Class, Interface, DataType, PrimitiveType and Enumeration. 
getClasses()

Package.getClasses

X

Gets all classes that are owned by this Package.

Return value
Type: Class [0..*]
A subset of PackagedElements.
Class [0..*]Gets all classes that are owned by this Package. 
getDataTypes()

Package.getDataTypes

X

Gets all data types that are owned by this Package.

Return value
Type: DataType [0..*]
A subset of PackagedElements.
DataType [0..*]Gets all data types that are owned by this Package. 
getEnumerations()

Package.getEnumerations

X

Gets all enumerations that are owned by this Package.

Return value
Type: Enumeration [0..*]
A subset of PackagedElements.
Enumeration [0..*]Gets all enumerations that are owned by this Package. 
getFirstCommentBody()

Package.getFirstCommentBody

X

Gets the text contents of the first comment in the element's owned comments, or an empty string if the element has no comments.

Return value
Type: string [1..1]
The body string of the first comment. If the element has no comments, an empty string is returned.
string [1..1]Gets the text contents of the first comment in the element's owned comments, or an empty string if the element has no comments. Inherited from Element.
getInterfaces()

Package.getInterfaces

X

Gets all interfaces that are owned by this Package.

Return value
Type: Interface [0..*]
A subset of PackagedElements.
Interface [0..*]Gets all interfaces that are owned by this Package. 
getNamespaceName(separator)

Package.getNamespaceName

X

Constructs a name from the names of the nesting packages. The name is constructed working inwards from the package that is defined as namespace root up to but not including the PackageableElement itself.

Parameters
NameTypeDescription
separatorstring [0..1]The string to use to separate names. If not specified, a dot "." will be used.
Return value
Type: string 
A single string with all the names separated.
string Constructs a name from the names of the nesting packages. The name is constructed working inwards from the package that is defined as namespace root up to but not including the PackageableElement itself. Inherited from PackageableElement.
getNestedPackages()

Package.getNestedPackages

X

Gets all packages that are owned by this Package.

Return value
Type: Package [0..*]
A subset of PackagedElements.
Package [0..*]Gets all packages that are owned by this Package. 
getNestingPackages()

Package.getNestingPackages

X

Gets all packages that contain this Package, working inwards from the top Package to the owning package.

Return value
Type: Package [0..*]
A collection of Packages.
Package [0..*]Gets all packages that contain this Package, working inwards from the top Package to the owning package. Inherited from PackageableElement.
getQualifiedName(separator)

Package.getQualifiedName

X

Constructs a name from the PackageableElement and the names of the nesting packages. The name is constructed working inwards from the package that is defined as namespace root up to and including the PackageableElement itself.

Parameters
NameTypeDescription
separatorstring [0..1]The string to use to separate names. If not specified, a dot "." will be used.
Return value
Type: string 
A single string with all the names separated.
string Constructs a name from the PackageableElement and the names of the nesting packages. The name is constructed working inwards from the package that is defined as namespace root up to and including the PackageableElement itself. Inherited from PackageableElement.
getTypes()

Package.getTypes

X

Gets all types that are owned by this Package. This includes the following types of elements: Class, Interface, DataType, PrimitiveType and Enumeration.

Return value
Type: Classifier [0..*]
A subset of PackagedElements.
Classifier [0..*]Gets all types that are owned by this Package. This includes the following types of elements: Class, Interface, DataType, PrimitiveType and Enumeration.