edu.iris.Fissures.seed.director
Class ExportDirector

java.lang.Object
  extended by edu.iris.Fissures.seed.director.ExportDirector
Direct Known Subclasses:
SeedExportDirector

public abstract class ExportDirector
extends java.lang.Object

Abstract class representing all Director classes for exporting data from an Object Container to any number of output formats, as dictated by the Builder Class registered with it.

Version:
4/30/2002
Author:
Robert Casey

Field Summary
protected  ExportBuilder builder
           
protected  ObjectContainer container
           
protected  ExportTemplate expTemplate
           
 
Constructor Summary
ExportDirector()
          Instantiate without assigning a Builder or Container to it.
ExportDirector(ExportBuilder builder)
          Assign a Builder to the Director.
ExportDirector(ObjectContainer container, ExportBuilder builder)
          Assign a Container and Builder to the Director.
ExportDirector(ObjectContainer container, ExportBuilder builder, ExportTemplate expTemplate)
          Assign a Container, Builder, and Template to the Director.
 
Method Summary
 void assignBuilder(ExportBuilder builder)
          Assign a builder object to this director.
 void assignContainer(ObjectContainer container)
          Assign a container object to this director to read objects from.
 void assignTemplate(ExportTemplate expTemplate)
          Assign optional export template to the director.
 int construct()
          Signal to begin sending build commands to the Builder for a single output volume.
abstract  void fillTemplate(BuilderFilter templateFilter)
          Using the provided BuilderFilter, pick out matching blockette objects from the ObjectContainer to populate the ExportTemplate.
protected abstract  long getContext(int objType)
          Get context ID.
protected abstract  java.lang.Object getObject(int refNum)
          Get the object corresponding to refNum.
protected abstract  void startVolume()
          Signal concrete director class that we are starting a new volume.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

builder

protected ExportBuilder builder

container

protected ObjectContainer container

expTemplate

protected ExportTemplate expTemplate
Constructor Detail

ExportDirector

public ExportDirector()
Instantiate without assigning a Builder or Container to it.


ExportDirector

public ExportDirector(ExportBuilder builder)
Assign a Builder to the Director.


ExportDirector

public ExportDirector(ObjectContainer container,
                      ExportBuilder builder)
Assign a Container and Builder to the Director.


ExportDirector

public ExportDirector(ObjectContainer container,
                      ExportBuilder builder,
                      ExportTemplate expTemplate)
Assign a Container, Builder, and Template to the Director.

Method Detail

assignBuilder

public void assignBuilder(ExportBuilder builder)
Assign a builder object to this director.


assignContainer

public void assignContainer(ObjectContainer container)
Assign a container object to this director to read objects from.


assignTemplate

public void assignTemplate(ExportTemplate expTemplate)
Assign optional export template to the director.


construct

public int construct()
              throws java.lang.Exception
Signal to begin sending build commands to the Builder for a single output volume. Returns the number of logical records generated.

Throws:
java.lang.Exception

fillTemplate

public abstract void fillTemplate(BuilderFilter templateFilter)
                           throws java.lang.Exception
Using the provided BuilderFilter, pick out matching blockette objects from the ObjectContainer to populate the ExportTemplate. This process must be implemented by the concrete ExportDirector so as to query for only relevant object types.

Throws:
java.lang.Exception

startVolume

protected abstract void startVolume()
Signal concrete director class that we are starting a new volume. Any concrete-specific initialization is taken care of here.


getObject

protected abstract java.lang.Object getObject(int refNum)
                                       throws java.lang.Exception
Get the object corresponding to refNum. The returned object should be a copy of the one in the container, such that modifying its contents will not alter the contents of the object in the container. Concrete class will know how to access type-specific object-base.

Throws:
java.lang.Exception

getContext

protected abstract long getContext(int objType)
                            throws java.lang.Exception
Get context ID. Get a long integer that places a certain object type in a family of objects that points back to its parent ID. The context of an object is it's specific parent and the order it appears inside the parent in relation to other objects of the same type also inside the parent. Concrete class implementations may vary.

Throws:
java.lang.Exception