org.andromda.core.configuration
Class Configuration

java.lang.Object
  extended by org.andromda.core.configuration.Configuration
All Implemented Interfaces:
java.io.Serializable

public class Configuration
extends java.lang.Object
implements java.io.Serializable

This object is configured from the AndroMDA configuration XML file. Its used to configure AndroMDA before modeling processing occurs.

Author:
Chad Brandon
See Also:
Serialized Form

Constructor Summary
Configuration()
           
 
Method Summary
 void addMappingsSearchLocation(Location location)
          Adds a mappings search location (these are the locations in which a search for mappings is performed).
 void addMappingsSearchLocation(java.lang.String path)
          Adds a mappings search location path (a location without a pattern defined).
 void addNamespace(Namespace namespace)
          Adds a namespace to this configuration.
 void addProperty(Property property)
          Adds a property to this configuration instance.
 void addRepository(Repository repository)
          Adds the repository to this configuration.
static void clearCaches()
          Clears out any caches used by this configuration.
 java.lang.String getContents()
          Gets the URI from which this instance was configured or null (it it was not set).
static Configuration getInstance(java.io.InputStream stream)
          Gets a Configuration instance from the given stream.
static Configuration getInstance(java.lang.String string)
          Gets a Configuration instance from the given string.
static Configuration getInstance(java.net.URL uri)
          Gets a Configuration instance from the given uri.
 Location[] getMappingsSearchLocations()
          Gets the mappings search locations for this configuration instance.
 Namespace[] getNamespaces()
          Gets the configuration namespaces.
 Property[] getProperties()
          Gets the properties belonging to this configuration.
 Repository[] getRepositories()
          Gets the repository instances belonging to this configuration.
 Server getServer()
          Gets the server instance for this configuration.
 void initialize()
          Initializes this configuration instance.
 void setServer(Server server)
          Sets the server instance for this configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Configuration

public Configuration()
Method Detail

getInstance

public static Configuration getInstance(java.net.URL uri)
Gets a Configuration instance from the given uri.

Parameters:
uri - the URI to the configuration file.
Returns:
the configured instance.

getInstance

public static Configuration getInstance(java.io.InputStream stream)
Gets a Configuration instance from the given stream.

Parameters:
stream - the InputStream containing the configuration file.
Returns:
the configured instance.

getInstance

public static Configuration getInstance(java.lang.String string)
Gets a Configuration instance from the given string.

Parameters:
string - the String containing the configuration.
Returns:
the configured instance.

initialize

public void initialize()
Initializes this configuration instance.


addRepository

public void addRepository(Repository repository)
Adds the repository to this configuration.

Parameters:
repository - the repository instance.

getRepositories

public Repository[] getRepositories()
Gets the repository instances belonging to this configuration.

Returns:
the collection of repository instances.

addNamespace

public void addNamespace(Namespace namespace)
Adds a namespace to this configuration.

Parameters:
namespace - the configured namespace to add.

getNamespaces

public Namespace[] getNamespaces()
Gets the configuration namespaces.

Returns:
the array of Namespace instances.

addProperty

public void addProperty(Property property)
Adds a property to this configuration instance.

Parameters:
property - the property to add.

getProperties

public Property[] getProperties()
Gets the properties belonging to this configuration.

Returns:
the collection of Property instances.

setServer

public void setServer(Server server)
Sets the server instance for this configuration.

Parameters:
server - the information which configures the AndroMDA server.

getServer

public Server getServer()
Gets the server instance for this configuration. The Server holds the information to configure the AndroMDA server.

Returns:
the andromda server.

addMappingsSearchLocation

public void addMappingsSearchLocation(Location location)
Adds a mappings search location (these are the locations in which a search for mappings is performed).

Parameters:
location - a location path.
See Also:
addMappingsSearchLocation(String)

addMappingsSearchLocation

public void addMappingsSearchLocation(java.lang.String path)
Adds a mappings search location path (a location without a pattern defined).

Parameters:
path - a location path.
See Also:
addMappingsSearchLocation(Location)

getMappingsSearchLocations

public Location[] getMappingsSearchLocations()
Gets the mappings search locations for this configuration instance.

Returns:
the mappings search locations.

getContents

public java.lang.String getContents()
Gets the URI from which this instance was configured or null (it it was not set).

Returns:
the URI as a String instance

clearCaches

public static void clearCaches()
Clears out any caches used by this configuration.



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