org.andromda.core.configuration
Class Model

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

public class Model
extends Object
implements Serializable

Stores the model information for each model that AndroMDA will process.

Author:
Chad Brandon
See Also:
Serialized Form

Constructor Summary
Model()
           
 
Method Summary
 void addModuleSearchLocation(Location location)
          Adds a module search location (these are the locations in which a search for module is performed).
 void addModuleSearchLocation(String path)
          Adds a module search location path (a location without a pattern defined).
 void addTransformation(Transformation transformation)
          Adds a transformation to this configuration instance.
 void addUri(String uri)
          Adds the location as a URI to one of the model files.
(package private) static void clearLastModifiedTimes()
          Clears out the current last modified times.
 Filters getConstraints()
          Stores the information about what constraints should/shouldn't be enforced.
 long getLastModified()
          Gets the time of the latest modified uri of the model as a long.
 String[] getModuleSearchLocationPaths()
          Gets all found module search location paths for this model instance.
 URL[] getModuleSearchLocationResources()
          Gets the accumulation of all files found when combining the contents of all module search location paths and their patterns by which they are filtered as well as the model URI.
 Location[] getModuleSearchLocations()
          Gets the module search locations for this model instance.
 Filters getPackages()
          Stores the information about what packages should/shouldn't be processed.
 Repository getRepository()
          Gets the repository to which this model belongs.
 Transformation[] getTransformations()
          Gets the transformations belonging to this configuration.
 String getType()
          Gets the type of the model (i.e.
 String[] getUris()
          All URIs that make up the model.
 boolean isChanged()
          Indicates whether or not the given model has changed since the previous call to this method.
 boolean isLastModifiedCheck()
          Whether or not to perform a last modified check on the model.
 void setConstraints(Filters constraints)
          Sets the constraints for this model.
 void setEnforceAllConstraints(boolean enforceAllConstraints)
          Sets the applyAll flag on the internal filters instance of this model.
 void setLastModifiedCheck(boolean lastModifiedCheck)
          Sets whether or not to perform a last modified check when processing the model.
 void setPackages(Filters packages)
          Sets the model packages for this model.
 void setProcessAllPackages(boolean processAllPackages)
          Sets the processAll flag on the internal model packages instance of this model.
(package private)  void setRepository(Repository repository)
          Sets the repository to which this model belongs.
 void setType(String type)
          Sets the type of model (i.e.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Model

public Model()
Method Detail

isLastModifiedCheck

public boolean isLastModifiedCheck()
Whether or not to perform a last modified check on the model.

Returns:
Returns the lastModifiedCheck.

setLastModifiedCheck

public void setLastModifiedCheck(boolean lastModifiedCheck)
Sets whether or not to perform a last modified check when processing the model. If true the model will be checked for a timestamp before processing occurs.

Parameters:
lastModifiedCheck - true/false

setProcessAllPackages

public void setProcessAllPackages(boolean processAllPackages)
Sets the processAll flag on the internal model packages instance of this model.

Parameters:
processAllPackages - whether or not all packages should be processed by default.

getPackages

public Filters getPackages()
Stores the information about what packages should/shouldn't be processed.

Returns:
Returns the packages.

setPackages

public void setPackages(Filters packages)
Sets the model packages for this model. This indicates what packages should and should not be processed from this model.

Parameters:
packages - the packages to process.

setEnforceAllConstraints

public void setEnforceAllConstraints(boolean enforceAllConstraints)
Sets the applyAll flag on the internal filters instance of this model.

Parameters:
enforceAllConstraints - whether or not all constraints should be enforced by default.

getConstraints

public Filters getConstraints()
Stores the information about what constraints should/shouldn't be enforced.

Returns:
Returns the constraints instance.

setConstraints

public void setConstraints(Filters constraints)
Sets the constraints for this model. This indicates what constraints should and should not be processed from this model.

Parameters:
constraints - the packages to process.

getUris

public String[] getUris()
All URIs that make up the model.

Returns:
Returns the uri.

addUri

public void addUri(String uri)
Adds the location as a URI to one of the model files.

Parameters:
uri - the URI to the model.

addTransformation

public void addTransformation(Transformation transformation)
Adds a transformation to this configuration instance.

Parameters:
transformation - the transformation instance to add.

getTransformations

public Transformation[] getTransformations()
Gets the transformations belonging to this configuration.

Returns:
the array of Transformation instances.

addModuleSearchLocation

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

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

addModuleSearchLocation

public void addModuleSearchLocation(String path)
Adds a module search location path (a location without a pattern defined).

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

getType

public String getType()
Gets the type of the model (i.e. the type of metamodel this model is based upon).

Returns:
Returns the type.

setType

public void setType(String type)
Sets the type of model (i.e. the type of metamodel this model is based upon).

Parameters:
type - The type to set.

getModuleSearchLocations

public Location[] getModuleSearchLocations()
Gets the module search locations for this model instance.

Returns:
the module search locations.
See Also:
getModuleSearchLocationPaths()

getModuleSearchLocationPaths

public String[] getModuleSearchLocationPaths()
Gets all found module search location paths for this model instance.

Returns:
the module search location paths.
See Also:
getModuleSearchLocations()

getModuleSearchLocationResources

public URL[] getModuleSearchLocationResources()
Gets the accumulation of all files found when combining the contents of all module search location paths and their patterns by which they are filtered as well as the model URI.

Returns:
all module search location files.

getLastModified

public long getLastModified()
Gets the time of the latest modified uri of the model as a long. If it can not be determined 0 is returned.

Returns:
the time this model was last modified

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

getRepository

public Repository getRepository()
Gets the repository to which this model belongs.

Returns:
the repository to which this model belongs.

setRepository

void setRepository(Repository repository)
Sets the repository to which this model belongs.

Parameters:
repository - the repository configuration to which this model belongs.

isChanged

public boolean isChanged()
Indicates whether or not the given model has changed since the previous call to this method.

Returns:
true/false

clearLastModifiedTimes

static void clearLastModifiedTimes()
Clears out the current last modified times.



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