org.andromda.core.repository
Interface RepositoryFacade


public interface RepositoryFacade

An interface for objects responsible for being a repository into which an object model can be loaded.

AndroMDA does code generation from an object model. There must exist a repository in which the model can be loaded. The repository must be able to load the object model given a URL. Any repository that supports this API can be used by AndroMDA.

Author:
Anthony Mowers , Chad Brandon

Method Summary
 void clear()
          Clears the repository of any model(s) (without shutting it down).
 void close()
          Closes the repository and reclaims all resources.
 ModelAccessFacade getModel()
          Returns the facade as the given type for the top-level model object from the repository.
 void open()
          Opens and initialize the repository.
 void readModel(java.io.InputStream[] streams, java.lang.String[] uris, java.lang.String[] moduleSearchPath)
          Reads the object model into the repository from the given model streams.
 void readModel(java.lang.String[] uris, java.lang.String[] moduleSearchPath)
           Reads the object model into the repository from one or more model URIs.
 void writeModel(java.lang.Object model, java.lang.String outputLocation, java.lang.String version)
          Writes the given model to the specified outputLocation using the default encoding provided by the model writer.
 void writeModel(java.lang.Object model, java.lang.String outputLocation, java.lang.String version, java.lang.String encoding)
          Writes the given model to the specified outputLocation.
 

Method Detail

open

void open()
Opens and initialize the repository.


close

void close()
Closes the repository and reclaims all resources.


readModel

void readModel(java.lang.String[] uris,
               java.lang.String[] moduleSearchPath)

Reads the object model into the repository from one or more model URIs. If uris is null or zero length, then an empty model will be created in the repository and can be retrieved from getModel().

Parameters:
uris - a list of modelUrls from which to load each URL of the model.
moduleSearchPath - a list of paths from which to search for module models (i.e. models that can be referenced from within other models).

readModel

void readModel(java.io.InputStream[] streams,
               java.lang.String[] uris,
               java.lang.String[] moduleSearchPath)
Reads the object model into the repository from the given model streams. If the streams is null then an empty model will be created in the repository and can be retrieved from getModel().

Parameters:
streams - a list of InputStream instances containing a model.
uris - a list of URIs from which each stream in the streams parameter was loaded (note that the size and order of this list must match the order of the streams list).
moduleSearchPath - a list of paths from which to search for module models (i.e. models that can be referenced from within other models).

writeModel

void writeModel(java.lang.Object model,
                java.lang.String outputLocation,
                java.lang.String version,
                java.lang.String encoding)
Writes the given model to the specified outputLocation.

Parameters:
model - the model to write.
outputLocation - the location to write the model file.
version - the version of the model to be written (i.e. could be XMI version if the repository writes XMI files).
encoding - the encoding of the file to be written.

writeModel

void writeModel(java.lang.Object model,
                java.lang.String outputLocation,
                java.lang.String version)
Writes the given model to the specified outputLocation using the default encoding provided by the model writer.

Parameters:
model - the model to write.
outputLocation - the location to write the model file.
version - the version of the model to be written (i.e. could be XMI version if the repository writes XMI files).

getModel

ModelAccessFacade getModel()
Returns the facade as the given type for the top-level model object from the repository. This model object contains all models read into the repository. If the type is not specified, the default model access facade will be used.

Returns:
the model value (or null if no models exist in the repository).

clear

void clear()
Clears the repository of any model(s) (without shutting it down).



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