|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ModelManagementHelper
The interface for the helper for ModelManagement.
Created from the old ModelManagementHelper.
| Field Summary | |
|---|---|
static java.lang.String |
ACCESS_STEREOTYPE
Name of stereotype applied to Permission which is an package access. |
static java.lang.String |
FRIEND_STEREOTYPE
Name of stereotype applied to Permission which is a friend. |
static java.lang.String |
IMPORT_STEREOTYPE
Name of stereotype applied to a Permission which is for import. |
| Method Summary | |
|---|---|
boolean |
corresponds(java.lang.Object obj1,
java.lang.Object obj2)
Deprecated. for 0.25.4 by tfmorris. Equivalent to obj1.equals(obj2). |
java.util.Collection |
getAllBehavioralFeatures(java.lang.Object ns)
|
java.util.Collection |
getAllContents(java.lang.Object namespace)
This method calculates the following from the standard: |
java.util.Collection |
getAllImportedElements(java.lang.Object pack)
This method calculates the collection of imported elements of a Package following from the standard: |
java.util.Collection |
getAllModelElementsOfKind(java.lang.Object namespace,
java.lang.Object type)
Returns all modelelements found in this namespace and its containing namespaces that are of some class kind. |
java.util.Collection |
getAllModelElementsOfKind(java.lang.Object namespace,
java.lang.String kind)
helper method for getAllModelElementsOfKind(Object, Object). |
java.util.Collection |
getAllModelElementsOfKindWithModel(java.lang.Object model,
java.lang.Object type)
Returns all modelelements of the given kind. |
java.util.Collection |
getAllNamespaces(java.lang.Object ns)
Returns all namespaces found in this namespace and in its containing namespaces. |
java.util.Collection |
getAllPossibleImports(java.lang.Object pack)
Returns a collection of ModelElements that may possibly be imported in the given package. |
java.util.Collection |
getAllSubSystems(java.lang.Object ns)
Returns all subsystems found in this namespace and in its containing namespaces. |
java.util.Collection |
getAllSurroundingNamespaces(java.lang.Object ns)
Returns all surrounding namespaces of some namespace ns. |
java.util.Collection |
getContents(java.lang.Object namespace)
This method calculates the "contents" additional operation from the standard: |
java.lang.Object |
getCorrespondingElement(java.lang.Object elem,
java.lang.Object model)
Deprecated. for 0.25.4 by tfmorris. Unnecessary because Model implementation maintains cross XMI file references now. |
java.lang.Object |
getCorrespondingElement(java.lang.Object elem,
java.lang.Object model,
boolean canCreate)
Deprecated. for 0.25.4 by tfmorris. Unnecessary because Model implementation maintains cross XMI file references now. |
java.lang.Object |
getElement(java.util.List<java.lang.String> path)
Get the modelelement with the given path, starting at the root of repository. |
java.lang.Object |
getElement(java.util.List<java.lang.String> path,
java.lang.Object theRootNamespace)
Get the modelelement a given path below a given root-namespace. |
java.util.Vector<java.lang.String> |
getPath(java.lang.Object element)
Deprecated. for 0.25.4 by tfmorris. Use getPathList(Object) but
be aware that the implementations are not 100% compatible.
Read the Javadoc for the new method to understand the
difference. |
java.util.List<java.lang.String> |
getPathList(java.lang.Object element)
Find the absolute path of a ModelElement. |
boolean |
isCyclicOwnership(java.lang.Object parent,
java.lang.Object child)
Checks if a child for some ownership relationship (as in a namespace A is owned by a namespace B) is already in the ownerhship relation. |
void |
removeImportedElement(java.lang.Object handle,
java.lang.Object me)
This method removes the import of a modelelement from a package. |
void |
setAlias(java.lang.Object handle,
java.lang.String alias)
Set the alias of the ElementImport. |
void |
setImportedElements(java.lang.Object pack,
java.util.Collection imports)
Set the complete collection of imported elements for a package. |
void |
setSpecification(java.lang.Object handle,
boolean isSpecification)
Set the isSpecification attribute for the ElementImport. |
| Field Detail |
|---|
static final java.lang.String FRIEND_STEREOTYPE
static final java.lang.String IMPORT_STEREOTYPE
static final java.lang.String ACCESS_STEREOTYPE
| Method Detail |
|---|
java.util.Collection getAllSubSystems(java.lang.Object ns)
ns - is the namespace
java.util.Collection getAllNamespaces(java.lang.Object ns)
ns - namespace to process
java.util.Collection getAllModelElementsOfKindWithModel(java.lang.Object model,
java.lang.Object type)
model - the model that is searchedtype - is the class kind that is sought
java.util.Collection getAllModelElementsOfKind(java.lang.Object namespace,
java.lang.Object type)
namespace - is the namespacetype - is the class kind
java.util.Collection getAllModelElementsOfKind(java.lang.Object namespace,
java.lang.String kind)
getAllModelElementsOfKind(Object, Object).
namespace - namespace.kind - name of class to find (without implementation-specific
additions)
java.util.Collection getAllSurroundingNamespaces(java.lang.Object ns)
ns - to process
java.util.Collection getAllBehavioralFeatures(java.lang.Object ns)
ns - the given namespace
java.util.Collection getAllPossibleImports(java.lang.Object pack)
pack - the given package
java.lang.Object getElement(java.util.List<java.lang.String> path)
path - the given path
java.lang.Object getElement(java.util.List<java.lang.String> path,
java.lang.Object theRootNamespace)
path - the given paththeRootNamespace - the given namespace to start from. If null, start
from the root (equivalent to getElement(List).
@Deprecated java.util.Vector<java.lang.String> getPath(java.lang.Object element)
getPathList(Object) but
be aware that the implementations are not 100% compatible.
Read the Javadoc for the new method to understand the
difference.
The returned Vector implicitly starts at the innermost containing model and follows element's chain of owning namespaces back down to element. The first element will thus be the name of the namespace contained the Model, and the last element will be the name of element itself. Note thus that for the model the path will be empty.
NOTE:In the case of nested Models (ie a top level UML Model
that contains other UML Models, this may not produce the expected
results, but the historical behavior has been retained for backward
compatibility. All new code should use getPathList(Object).
element - is the object to resolve the path for.
java.lang.IllegalArgumentException - if element isn't a ModelElement properly owned by
namespaces and a model.java.util.List<java.lang.String> getPathList(java.lang.Object element)
The returned List implicitly starts with a root element and follows element's chain of owning namespaces back down to element. The first element will thus be the name of the top level namespace, and the last element will be the name of element itself.
COMPATIBILITY WARNING - The previous version of this method
getPath(Object) would only return the path to the first
enclosing Model, not the root, and it would not include the name of the
model itself. This version will keep going up until it finds an element
with no parent and it includes the name of that top level element which
means that it will normally be one element longer than the previous
method.
element - is the object to resolve the path for.
java.lang.IllegalArgumentException - if element isn't a ModelElement properly owned by
namespaces and a model.
@Deprecated
java.lang.Object getCorrespondingElement(java.lang.Object elem,
java.lang.Object model)
true for the third parameter.
This function may fail and return null eg if some required object doesn't exist in the target model and cannot be copied.
elem - is some element.model - is the model the returned object shall belong to.
@Deprecated
java.lang.Object getCorrespondingElement(java.lang.Object elem,
java.lang.Object model,
boolean canCreate)
This function may fail and return null eg if the required object doesn't exist in the target model and canCreate is false or some required object doesn't exist in the target model and cannot be copied.
elem - is some element.model - is the model the returned object shall belong to.canCreate - determines if objects can be copied into model.
@Deprecated
boolean corresponds(java.lang.Object obj1,
java.lang.Object obj2)
obj1 - is an object.obj2 - is another object.
boolean isCyclicOwnership(java.lang.Object parent,
java.lang.Object child)
parent - The current leaf for the ownership relationchild - The child that should be owned by the parent
void removeImportedElement(java.lang.Object handle,
java.lang.Object me)
handle - is the packageme - is the modelelement that was imported
void setImportedElements(java.lang.Object pack,
java.util.Collection imports)
pack - the package to import inimports - the collection of modelelements to import
void setAlias(java.lang.Object handle,
java.lang.String alias)
handle - is the ElementImportalias - the alias name
void setSpecification(java.lang.Object handle,
boolean isSpecification)
handle - ElementImportisSpecification - true of the element is specificationjava.util.Collection getContents(java.lang.Object namespace)
For a Namespace:
[1] The operation contents results in a Set containing all ModelElements contained by the Namespace. contents : Set(ModelElement) contents = self.ownedElement -> union(self.namespace, contents)
For a Package:
[1] The operation contents results in a Set containing the ModelElements owned by or imported by the Package. contents : Set(ModelElement) contents = self.ownedElement->union(self.importedElement)For a Instance:
[5] The operation contents results in a Set containing all ModelElements contained by the Instance. contents: Set(ModelElement); contents = self.ownedInstance->union(self.ownedLink)For a Subsystem:
[2] The operation contents results in a Set containing the ModelElements owned by or imported by the Subsystem. contents : Set(ModelElement) contents = self.ownedElement->union(self.importedElement)
namespace - the ns to get the contents from
java.util.Collection getAllImportedElements(java.lang.Object pack)
[2] The operation allImportedElements results in a Set containing the ModelElements imported by the Package or one of its parents. allImportedElements : Set(ModelElement) allImportedElements = self.importedElement->union( self.parent.oclAsType(Package).allImportedElements->select( re | re.elementImport.visibility = #public or re.elementImport.visibility = #protected))
pack - the package to get the imported elements from
java.util.Collection getAllContents(java.lang.Object namespace)
For a Namespace:
[2] The operation allContents results in a Set containing all ModelElements contained by the Namespace. allContents : Set(ModelElement); allContents = self.contents
For a Classifier:
[10] The operation allContents returns a Set containing
all ModelElements contained in the Classifier together
with the contents inherited from its parents.
allContents : Set(ModelElement);
allContents = self.contents->union(
self.parent.allContents->select(e |
e.elementOwnership.visibility = #public or
e.elementOwnership.visibility = #protected))
For a Package:
[3] The operation allContents results in a Set containing
the ModelElements owned by or imported
by the Package or one of its ancestors.
allContents : Set(ModelElement);
allContents = self.contents->union(
self.parent.allContents->select(e |
e.elementOwnership.visibility = #public or
e.elementOwnership.visibility = #protected))
For a Collaboration:
[1 ] The operation allContents results in the set of
all ModelElements contained in the Collaboration
together with those contained in the parents
except those that have been specialized.
allContents : Set(ModelElement);
allContents = self.contents->union (
self.parent.allContents->reject ( e |
self.contents.name->include (e.name) ))
namespace - the namespace to get the contents from
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
| ArgoUML © 1996-2006 | ArgoUML Homepage | ArgoUML Cookbook |