toxgene.interfaces
Interface ToXgeneEngine


public interface ToXgeneEngine

Interface to the ToXgene generation engine.

Version:
0.1
Author:
Denilson Barbosa

Method Summary
 void endSession()
          This method invokes ToXgene's cleanup routine.
 void generateLists()
          Generates all temporary data declared in the tox-lists elements in the input template.
 java.util.Vector getToXgeneDocumentCollections()
          Returns a Vector containing all document collections specified by tox-document elements in the template.
 void materialize(ToXgeneDocumentCollection collection, java.io.PrintStream outStream)
          Materializes an XML document from the given collection into a PrintStream object.
 boolean parseTemplate(java.io.InputStream template)
          Parses a template and prepares ToXgene for producing the synthetic documents.
 void startSession(ToXgeneSession session)
          This method inits a ToXgene session, passing the parameters under which ToXgene will work.
 

Method Detail

startSession

public void startSession(ToXgeneSession session)
                  throws toxgene.core.ToXgeneErrorException
This method inits a ToXgene session, passing the parameters under which ToXgene will work.

Parameters:
session - contains the paramaters for the data generation session
Throws:
toxgene.core.ToXgeneErrorException - indicates that ToXgene could not initialize a session.
See Also:
ToXgeneSession

endSession

public void endSession()
This method invokes ToXgene's cleanup routine.


parseTemplate

public boolean parseTemplate(java.io.InputStream template)
                      throws toxgene.core.ToXgeneErrorException
Parses a template and prepares ToXgene for producing the synthetic documents.

Parameters:
template - stream from which the template is read
Throws:
toxgene.core.ToXgeneErrorException - indicates that a fatal exceptional situation arised durint the parsing of the template

getToXgeneDocumentCollections

public java.util.Vector getToXgeneDocumentCollections()
Returns a Vector containing all document collections specified by tox-document elements in the template. Individual documents (i.e., tox-documents with copies=1 are viewed as collections with a single document.

See Also:
ToXgeneDocumentColletion

generateLists

public void generateLists()
Generates all temporary data declared in the tox-lists elements in the input template. This method is optional; if not invoked explicitly, ToXGene will automatically generate all temporary data as needed. This method is useful when measuring time for generating the documents as it isolates the generation of temporary data.


materialize

public void materialize(ToXgeneDocumentCollection collection,
                        java.io.PrintStream outStream)
                 throws toxgene.core.ToXgeneErrorException
Materializes an XML document from the given collection into a PrintStream object. For a collection with n documents, there can be at most n calls to this method.

Parameters:
collection - document collection that will be materialized
outStream - PrintStream where the document will be written to
Throws:
toxgene.core.ToXgeneErrorException - indicates that ToXgene cannot proceed to materialize the document. In particular, such an exception is raised if a ToXgeneDocumentCollection is used more than the number of documents it contains.
See Also:
ToXgeneDocumentCollection