org.mockcentral.server
Class FixtureImportsComposite

java.lang.Object
  extended by org.mockcentral.server.FixtureImportsComposite

public class FixtureImportsComposite
extends java.lang.Object

A class for storing the composite list of imported Fixture instances for a given Fixture object. This list will include the imports declared within the current Fixture plus the imports declared within imported ones, their imports, and so on. Circularity is tested for and will result in a MockCentralServerException. This class facilitates the sorting of the list of Fixture instances into the proper build order for the MockCentralServer class.

Author:
David Hutchinson
See Also:
Fixture

Constructor Summary
FixtureImportsComposite(Fixture importedFixture, java.util.ArrayList<java.lang.String> ancestorImportersList)
          Creates a new instance.
 
Method Summary
 Fixture getImportedFixture()
          Returns the imported Fixture.
 java.util.ArrayList<java.lang.String> getImports()
          Returns the list of all descendant instances.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FixtureImportsComposite

public FixtureImportsComposite(Fixture importedFixture,
                               java.util.ArrayList<java.lang.String> ancestorImportersList)
                        throws MockCentralServerException
Creates a new instance.

Parameters:
importedFixture - the Fixture being imported by parent instance..
ancestorImportersList - the list of ancestor Fixture instances in the importing chain.
Throws:
MockCentralServerException - if a circularity is found or if the imported Fixture itself was not found.
Method Detail

getImportedFixture

public Fixture getImportedFixture()
Returns the imported Fixture.

Returns:
the imported Fixture.

getImports

public java.util.ArrayList<java.lang.String> getImports()
Returns the list of all descendant instances. This replicates the composite list of all Fixture instances imported by the Fixture, as this method calls itself recursively while descending through the imports hierarchy.

Returns:
the list of all descendant instances.