org.eclipse.uml2
Interface Package

All Superinterfaces:
Element, EModelElement, EObject, NamedElement, Namespace, Notifier, PackageableElement, ParameterableElement, TemplateableElement
All Known Subinterfaces:
Model, Profile

public interface Package
extends Namespace, PackageableElement

A representation of the model object 'Package'. 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.

The following features are supported:

See Also:
UML2Package.getPackage()

Field Summary
static String copyright
           
 
Fields inherited from interface org.eclipse.uml2.NamedElement
SEPARATOR
 
Method Summary
 void apply(Profile profile)
          Applies the current version of the specified profile to this package; if a different version is already applied, automatically migrates any associated stereotype values on a "best effort" basis (matching classifiers and structural features by name).
 PackageableElement createOwnedMember(EClass eClass)
          Creates a PackageableElement and appends it to the 'Owned Member' containment reference list
 PackageMerge createPackageExtension(EClass eClass)
          Creates a PackageMerge and appends it to the 'Package Extension' containment reference list
 PackageMerge createPackageMerge(EClass eClass)
          Creates a PackageMerge and appends it to the 'Package Merge' containment reference list
 Set getAllAppliedProfiles()
          Retrieves the set of all profiles that are applied to this package, including profiles applied to its nesting package(s).
 EList getAppliedProfiles()
          Returns the value of the 'Applied Profile' reference list.
 String getAppliedVersion(Profile profile)
          Retrieves the version of the specified profile that is applied to this package or (one of) its nesting package(s).
 Namespace getNamespace()
           
 Package getNestedPackage(String unqualifiedName)
          Retrieves the Package with the specified name from the 'Nested Package' reference list
 EList getNestedPackages()
          Returns the value of the 'Nested Package' reference list.
 Package getNestingPackage()
          Returns the value of the 'Nesting Package' reference.
 EList getOwnedElements()
           
 PackageableElement getOwnedMember(String unqualifiedName)
          Retrieves the PackageableElement with the specified name from the 'Owned Member' containment reference list
 EList getOwnedMembers()
          Returns the value of the 'Owned Member' containment reference list.
 Type getOwnedType(String unqualifiedName)
          Retrieves the Type with the specified name from the 'Owned Type' reference list
 EList getOwnedTypes()
          Returns the value of the 'Owned Type' reference list.
 EList getPackageExtensions()
          Returns the value of the 'Package Extension' containment reference list.
 EList getPackageImports()
           
 EList getPackageMerges()
          Returns the value of the 'Package Merge' containment reference list.
 boolean isApplied(Profile profile)
          Determines whether the specified profile is applied to this package.
 boolean makesVisible(NamedElement el)
           A query based on the following OCL expression: el.visibility->isEmpty() or el.visibility = #public
 boolean mustBeOwned()
           A query based on the following OCL expression: false
 void unapply(Profile profile)
          Unapplies the specified profile from this package.
 boolean validateElementsPublicOrPrivate(DiagnosticChain diagnostics, Map context)
           An invariant constraint based on the following OCL expression: self.ownedElements->forAll(e | e.visibility->notEmpty() implies e.visbility = #public or e.visibility = #private)
 Set visibleMembers()
           A query based on the following OCL expression: member->select( m | self.makesVisible(m))
 
Methods inherited from interface org.eclipse.uml2.Namespace
createElementImport, createOwnedRule, createPackageImport, excludeCollisions, getElementImports, getImportedMember, getImportedMembers, getImportedPackages, getMember, getMembers, getNamesOfMember, getOwnedRule, getOwnedRules, importedMember, importElement, importMembers, importPackage, membersAreDistinguishable, validateImportedMemberDerived, validateMembersAreDistinguishable
 
Methods inherited from interface org.eclipse.uml2.NamedElement
allNamespaces, createNameExpression, getClientDependencies, getClientDependency, getName, getNameExpression, getOwner, getQualifiedName, getVisibility, isDistinguishableFrom, qualifiedName, separator, setName, setNameExpression, setVisibility, validateNoName, validateQualifiedName, validateVisibilityNeedsOwnership
 
Methods inherited from interface org.eclipse.uml2.TemplateableElement
createOwnedTemplateSignature, createTemplateBinding, getOwnedTemplateSignature, getTemplateBindings, parameterableElements, setOwnedTemplateSignature
 
Methods inherited from interface org.eclipse.uml2.Element
addKeyword, allOwnedElements, apply, createEAnnotation, createOwnedComment, destroy, getApplicableStereotype, getApplicableStereotypes, getAppliedStereotype, getAppliedStereotypes, getAppliedVersion, getKeywords, getModel, getNearestPackage, getOwnedComments, getValue, hasKeyword, isApplied, isRequired, removeKeyword, setValue, unapply, validateHasOwner, validateNotOwnSelf
 
Methods inherited from interface org.eclipse.emf.ecore.EModelElement
getEAnnotation, getEAnnotations
 
Methods inherited from interface org.eclipse.emf.ecore.EObject
eAllContents, eClass, eContainer, eContainingFeature, eContainmentFeature, eContents, eCrossReferences, eGet, eGet, eIsProxy, eIsSet, eResource, eSet, eUnset
 
Methods inherited from interface org.eclipse.emf.common.notify.Notifier
eAdapters, eDeliver, eNotify, eSetDeliver
 
Methods inherited from interface org.eclipse.uml2.PackageableElement
getPackageableElement_visibility, getVisibility, setPackageableElement_visibility, setVisibility
 
Methods inherited from interface org.eclipse.uml2.ParameterableElement
getOwner, getOwningParameter, getTemplateParameter, setOwningParameter, setTemplateParameter
 

Field Detail

copyright

public static final String copyright

See Also:
Constant Field Values
Method Detail

getNestedPackages

public EList getNestedPackages()
Returns the value of the 'Nested Package' reference list. The list contents are of type Package. It is bidirectional and its opposite is 'Nesting Package'.

If the meaning of the 'Nested Package' reference list isn't clear, there really should be more of a description here...

References the owned members that are Packages. Subsets Package::ownedMember.

Returns:
the value of the 'Nested Package' reference list.
See Also:
UML2Package.getPackage_NestedPackage(), getNestingPackage()

getNestedPackage

public Package getNestedPackage(String unqualifiedName)
Retrieves the Package with the specified name from the 'Nested Package' reference list.

Parameters:
unqualifiedName - The unqualified name of the Package to retrieve.
Returns:
The Package with the specified name, or null.
See Also:
getNestedPackages()

getNestingPackage

public Package getNestingPackage()
Returns the value of the 'Nesting Package' reference. It is bidirectional and its opposite is 'Nested Package'.

If the meaning of the 'Nesting Package' reference isn't clear, there really should be more of a description here...

Returns:
the value of the 'Nesting Package' reference.
See Also:
UML2Package.getPackage_NestingPackage(), getNestedPackages()

getOwnedTypes

public EList getOwnedTypes()
Returns the value of the 'Owned Type' reference list. The list contents are of type Type. It is bidirectional and its opposite is 'Package'.

If the meaning of the 'Owned Type' reference list isn't clear, there really should be more of a description here...

References the owned members that are Types. Subsets Package::ownedMember.

Returns:
the value of the 'Owned Type' reference list.
See Also:
UML2Package.getPackage_OwnedType(), Type.getPackage()

getOwnedType

public Type getOwnedType(String unqualifiedName)
Retrieves the Type with the specified name from the 'Owned Type' reference list.

Parameters:
unqualifiedName - The unqualified name of the Type to retrieve.
Returns:
The Type with the specified name, or null.
See Also:
getOwnedTypes()

getOwnedMembers

public EList getOwnedMembers()
Returns the value of the 'Owned Member' containment reference list. The list contents are of type PackageableElement.

If the meaning of the 'Owned Member' containment reference list isn't clear, there really should be more of a description here...

Specifies the members that are owned by this Package. Redefines Namespace::ownedMember.

Specified by:
getOwnedMembers in interface Namespace
Returns:
the value of the 'Owned Member' containment reference list.
See Also:
UML2Package.getPackage_OwnedMember()

getOwnedMember

public PackageableElement getOwnedMember(String unqualifiedName)
Retrieves the PackageableElement with the specified name from the 'Owned Member' containment reference list.

Parameters:
unqualifiedName - The unqualified name of the PackageableElement to retrieve.
Returns:
The PackageableElement with the specified name, or null.
See Also:
getOwnedMembers()

createOwnedMember

public PackageableElement createOwnedMember(EClass eClass)
Creates a PackageableElement and appends it to the 'Owned Member' containment reference list.

Parameters:
eClass - The Ecore class of the PackageableElement to create.
Returns:
The new PackageableElement.
See Also:
getOwnedMembers()

getPackageMerges

public EList getPackageMerges()
Returns the value of the 'Package Merge' containment reference list. The list contents are of type PackageMerge. It is bidirectional and its opposite is 'Merging Package'.

If the meaning of the 'Package Merge' containment reference list isn't clear, there really should be more of a description here...

Returns:
the value of the 'Package Merge' containment reference list.
See Also:
UML2Package.getPackage_PackageMerge(), PackageMerge.getMergingPackage()

createPackageMerge

public PackageMerge createPackageMerge(EClass eClass)
Creates a PackageMerge and appends it to the 'Package Merge' containment reference list.

Parameters:
eClass - The Ecore class of the PackageMerge to create.
Returns:
The new PackageMerge.
See Also:
getPackageMerges()

getAppliedProfiles

public EList getAppliedProfiles()
Returns the value of the 'Applied Profile' reference list. The list contents are of type ProfileApplication.

If the meaning of the 'Applied Profile' reference list isn't clear, there really should be more of a description here...

Returns:
the value of the 'Applied Profile' reference list.
See Also:
UML2Package.getPackage_AppliedProfile()

validateElementsPublicOrPrivate

public boolean validateElementsPublicOrPrivate(DiagnosticChain diagnostics,
                                               Map context)
An invariant constraint based on the following OCL expression: self.ownedElements->forAll(e | e.visibility->notEmpty() implies e.visbility = #public or e.visibility = #private)


getPackageExtensions

public EList getPackageExtensions()
Returns the value of the 'Package Extension' containment reference list. The list contents are of type PackageMerge.

If the meaning of the 'Package Extension' containment reference list isn't clear, there really should be more of a description here...

Returns:
the value of the 'Package Extension' containment reference list.
See Also:
UML2Package.getPackage_PackageExtension()

createPackageExtension

public PackageMerge createPackageExtension(EClass eClass)
Creates a PackageMerge and appends it to the 'Package Extension' containment reference list.

Parameters:
eClass - The Ecore class of the PackageMerge to create.
Returns:
The new PackageMerge.
See Also:
getPackageExtensions()

mustBeOwned

public boolean mustBeOwned()
A query based on the following OCL expression: false

Specified by:
mustBeOwned in interface Element

visibleMembers

public Set visibleMembers()
A query based on the following OCL expression: member->select( m | self.makesVisible(m))


makesVisible

public boolean makesVisible(NamedElement el)
A query based on the following OCL expression: el.visibility->isEmpty() or el.visibility = #public


getNamespace

public Namespace getNamespace()

Specified by:
getNamespace in interface NamedElement

getOwnedElements

public EList getOwnedElements()

Specified by:
getOwnedElements in interface Namespace

getPackageImports

public EList getPackageImports()

Specified by:
getPackageImports in interface Namespace
Returns:
the value of the 'Package Import' containment reference list.
See Also:
UML2Package.getNamespace_PackageImport(), PackageImport.getImportingNamespace()

isApplied

public boolean isApplied(Profile profile)
Determines whether the specified profile is applied to this package.

Parameters:
profile - The profile to test for application.
Returns:
true if the profile is applied to this package; false otherwise.

getAllAppliedProfiles

public Set getAllAppliedProfiles()
Retrieves the set of all profiles that are applied to this package, including profiles applied to its nesting package(s).

Returns:
The profiles applied to the package.

apply

public void apply(Profile profile)
Applies the current version of the specified profile to this package; if a different version is already applied, automatically migrates any associated stereotype values on a "best effort" basis (matching classifiers and structural features by name).

Parameters:
profile - The profile to be applied.
Throws:
IllegalArgumentException - If the profile is not defined or its current version is already applied.

unapply

public void unapply(Profile profile)
Unapplies the specified profile from this package.

Parameters:
profile - The profile to be unapplied.
Throws:
IllegalArgumentException - If the profile is not applied to this package.

getAppliedVersion

public String getAppliedVersion(Profile profile)
Retrieves the version of the specified profile that is applied to this package or (one of) its nesting package(s).

Parameters:
profile - The profile whose applied version to retrieve.
Returns:
The version of the profile, or null if not applied.

Copyright 2003, 2004 IBM Corporation and others.
All Rights Reserved.