org.extex.backend
Interface BackendDriver

All Known Implementing Classes:
BackendDriverImpl

public interface BackendDriver

This interface describes a back-end as extension to a DocumentWriter.

Version:
$Revision$
Author:
Gerd Neugebauer

Method Summary
 void add(PagePipe processor)
          Adder for a processor.
 void close()
          This method is invoked upon the end of the processing.
 DocumentWriter getDocumentWriter()
          Getter for the document writer.
 java.lang.String getDocumentWriterType()
          Getter for the document writer.
 java.lang.String getExtension()
          Getter for the extension associated with this kind of output.
 int getPages()
          Getter for the number of pages already produced.
 void setDocumentWriterFactory(DocumentWriterFactory documentWriterFactory)
          Setter for the document writer factory.
 void setDocumentWriterType(java.lang.String type)
          Setter for the document writer.
 void setParameter(java.lang.String name, java.lang.String value)
          Setter for a named parameter.
 int shipout(Page page)
          This is the entry point for the document writer.
 

Method Detail

add

void add(PagePipe processor)
Adder for a processor.

Parameters:
processor - the processor to append

close

void close()
           throws BackendException
This method is invoked upon the end of the processing.

Throws:
BackendException - in case of an error

getDocumentWriter

DocumentWriter getDocumentWriter()
                                 throws DocumentWriterException
Getter for the document writer.

Returns:
the document writer
Throws:
DocumentWriterException - in case of an error

getDocumentWriterType

java.lang.String getDocumentWriterType()
Getter for the document writer.

Returns:
the document writer type

getExtension

java.lang.String getExtension()
Getter for the extension associated with this kind of output. For instance pdf is the expected value for PDF files and dvi is the expected value for DVI files.

Returns:
the appropriate extension for file names

getPages

int getPages()
Getter for the number of pages already produced.

Returns:
the number of pages already shipped out

setDocumentWriterFactory

void setDocumentWriterFactory(DocumentWriterFactory documentWriterFactory)
Setter for the document writer factory.

Parameters:
documentWriterFactory - the document writer factory to set

setDocumentWriterType

void setDocumentWriterType(java.lang.String type)
                           throws BackendDocumentWriterDefinedException,
                                  BackendUnknownDocumentWriterException
Setter for the document writer.

Parameters:
type - the document writer type
Throws:
BackendDocumentWriterDefinedException - in case that the document writer is already in use
BackendUnknownDocumentWriterException - in case that the document writer has no associated configuration

setParameter

void setParameter(java.lang.String name,
                  java.lang.String value)
Setter for a named parameter. Parameters are a general mechanism to influence the behavior of the document writer. Any parameter not known by the document writer has to be ignored.

Parameters:
name - the name of the parameter
value - the value of the parameter

shipout

int shipout(Page page)
            throws BackendException
This is the entry point for the document writer. Here it receives a complete node list to be sent to the output writer. It can be assumed that all values for width, height, and depth of the node lists are properly filled. Thus all information should be present to place the ink on the paper.

Parameters:
page - the page to send
Returns:
returns the number of pages shipped
Throws:
BackendException - in case of an error