org.andromda.core.metafacade
Interface ModelAccessFacade


public interface ModelAccessFacade

Provides access to a model loaded by a Repository and made available to be used to retrieve information about model elements and metafacades.

Models can be instances of any metamodel. The most common models will be UML models. This interface is an abstraction. Any model that implements this interface can be used with AndroMDA.

Design goal: This class should only contain the minimum amount of methods that will be needed such that the AndroMDA core can deal with it. All other stuff should be done in cartridge-specific classes!!! So, please don't make this class grow!

Author:
Matthias Bohlen , Chad Brandon

Method Summary
 java.util.Collection findByStereotype(java.lang.String stereotype)
          Finds all the model elements that have the specified stereotype (with any filtering applied from the information provided by #setPackageFilter(ModelPackages)).
 java.lang.Object getModel()
          Returns an object that represents the entire model.
 java.util.Collection getModelElements()
          Returns all elements from the model (with any filtering applied from the information provided by #setPackageFilter(ModelPackages)).
 java.lang.String getName(java.lang.Object metafacade)
          Returns the name of a metafacade (whatever that means for a concrete model).
 java.lang.String getPackageName(java.lang.Object modelElement)
          Returns the package name of a model element (whatever that means for a concrete model).
 java.util.Collection getStereotypeNames(java.lang.Object modelElement)
          Returns a collection of stereotype names for a modelElement (whatever that means for a concrete model).
 void setModel(java.lang.Object model)
          Sets the object that represents the entire model.
 void setPackageFilter(Filters modelPackages)
          Sets the model packages instance which contains the information about what packages should and should not be filtered out.
 

Method Detail

setModel

void setModel(java.lang.Object model)
Sets the object that represents the entire model.

Parameters:
model - the model to set.

getModel

java.lang.Object getModel()
Returns an object that represents the entire model. Data type is defined by the implementor of this interface.

Returns:
the metaclass model.

getName

java.lang.String getName(java.lang.Object metafacade)
Returns the name of a metafacade (whatever that means for a concrete model).

Parameters:
metafacade - the metafacade from which to retrieve the name.
Returns:
String containing the name

getPackageName

java.lang.String getPackageName(java.lang.Object modelElement)
Returns the package name of a model element (whatever that means for a concrete model).

Parameters:
modelElement - the model element
Returns:
String containing the name

setPackageFilter

void setPackageFilter(Filters modelPackages)
Sets the model packages instance which contains the information about what packages should and should not be filtered out. The model access facade instance then uses this information to provide any filtering by package when calling getModelElements() and findByStereotype(String).

Parameters:
modelPackages - the model packages by which to filter.

getStereotypeNames

java.util.Collection getStereotypeNames(java.lang.Object modelElement)
Returns a collection of stereotype names for a modelElement (whatever that means for a concrete model).

Parameters:
modelElement - the modelElement
Returns:
Collection of Strings with stereotype names

findByStereotype

java.util.Collection findByStereotype(java.lang.String stereotype)
Finds all the model elements that have the specified stereotype (with any filtering applied from the information provided by #setPackageFilter(ModelPackages)).

Parameters:
stereotype - the name of the stereotype, they are matched without regard to case.
Returns:
Collection of model elements having the given stereotype

getModelElements

java.util.Collection getModelElements()
Returns all elements from the model (with any filtering applied from the information provided by #setPackageFilter(ModelPackages)).

Returns:
Collection of all metafacades


Copyright © 2003-2008 AndroMDA.org. All Rights Reserved.