de.dante.extex.backend.documentWriter.text
Class TextDocumentWriter

java.lang.Object
  extended byde.dante.extex.backend.documentWriter.text.TextDocumentWriter
All Implemented Interfaces:
DocumentWriter, NodeVisitor, SingleDocumentStream

public class TextDocumentWriter
extends java.lang.Object
implements DocumentWriter, SingleDocumentStream, NodeVisitor

This is a text dummy implementation of a document writer (very simple).

Version:
$Revision: 1.3 $
Author:
Michael Niedermair

Constructor Summary
TextDocumentWriter(Configuration cfg, DocumentWriterOptions options)
          Creates a new object.
 
Method Summary
 void close()
          This method is invoked upon the end of the processing.
 java.lang.String getExtension()
          Getter for the extension associated with this kind of output.
 int getPages()
           
 void setOutputStream(java.io.OutputStream outStream)
          Setter for the output stream.
 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.
 java.lang.Object visitAdjust(AdjustNode value, java.lang.Object value2)
          This method is called when an AdjustNode has been encountered.
 java.lang.Object visitAfterMath(AfterMathNode value, java.lang.Object value2)
          This method is called when an AfterMathNode has been encountered.
 java.lang.Object visitAlignedLeaders(AlignedLeadersNode value, java.lang.Object value2)
          This method is called when an AlignedLeadersNode has been encountered.
 java.lang.Object visitBeforeMath(BeforeMathNode node, java.lang.Object value2)
          This method is called when a BeforeMathNode has been encountered.
 java.lang.Object visitCenteredLeaders(CenteredLeadersNode node, java.lang.Object value)
          This method is called when a CenteredLeadersNode has been encountered.
 java.lang.Object visitChar(CharNode node, java.lang.Object value)
          This method is called when a CharNode has been encountered.
 java.lang.Object visitDiscretionary(DiscretionaryNode node, java.lang.Object value)
          This method is called when a DiscretionaryNode has been encountered.
 java.lang.Object visitExpandedLeaders(ExpandedLeadersNode node, java.lang.Object value)
          This method is called when an ExpandedLeadersNode has been encountered.
 java.lang.Object visitGlue(GlueNode node, java.lang.Object value)
          This method is called when a GlueNode has been encountered.
 java.lang.Object visitHorizontalList(HorizontalListNode node, java.lang.Object value)
          This method is called when a HorizontalListNode has been encountered.
 java.lang.Object visitInsertion(InsertionNode node, java.lang.Object value)
          This method is called when an InsertionNode has been encountered.
 java.lang.Object visitKern(KernNode node, java.lang.Object value)
          This method is called when a KernNode has been encountered.
 java.lang.Object visitLigature(LigatureNode node, java.lang.Object value)
          This method is called when a LigatureNode has been encountered.
 java.lang.Object visitMark(MarkNode node, java.lang.Object value)
          This method is called when a MarkNode has been encountered.
 java.lang.Object visitPenalty(PenaltyNode node, java.lang.Object value)
          This method is called when a PenaltyNode has been encountered.
 java.lang.Object visitRule(RuleNode node, java.lang.Object value)
          This method is called when a RuleNode has been encountered.
 java.lang.Object visitSpace(SpaceNode node, java.lang.Object value)
          This method is called when a SpaceNode has been encountered.
 java.lang.Object visitVerticalList(VerticalListNode node, java.lang.Object value)
          This method is called when a VerticalListNode has been encountered.
 java.lang.Object visitVirtualChar(VirtualCharNode node, java.lang.Object value)
          This method is called when a VirtualCharNode has been encountered.
 java.lang.Object visitWhatsIt(WhatsItNode nde, java.lang.Object value)
          This method is called when a WhatsItNode has been encountered.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextDocumentWriter

public TextDocumentWriter(Configuration cfg,
                          DocumentWriterOptions options)
Creates a new object.

Parameters:
cfg - the configuration
options - the options
Method Detail

close

public void close()
           throws DocumentWriterIOException
Description copied from interface: DocumentWriter
This method is invoked upon the end of the processing.

Specified by:
close in interface DocumentWriter
Throws:
DocumentWriterIOException
See Also:
DocumentWriter.close()

getExtension

public java.lang.String getExtension()
Description copied from interface: DocumentWriter
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.

Specified by:
getExtension in interface DocumentWriter
Returns:
the appropriate extension for file names
See Also:
DocumentWriter.getExtension()

getPages

public int getPages()
See Also:
de.dante.extex.backend.documentWriter.DocumentWriter#getPages()

setOutputStream

public void setOutputStream(java.io.OutputStream outStream)
Description copied from interface: SingleDocumentStream
Setter for the output stream.

Specified by:
setOutputStream in interface SingleDocumentStream
Parameters:
outStream - the output stream
See Also:
de.dante.extex.backend.documentWriter.DocumentWriter#setOutputStream(java.io.OutputStream)

setParameter

public void setParameter(java.lang.String name,
                         java.lang.String value)
Description copied from interface: DocumentWriter
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.

Specified by:
setParameter in interface DocumentWriter
Parameters:
name - the name of the parameter
value - the value of the parameter
See Also:
DocumentWriter.setParameter( java.lang.String, java.lang.String)

shipout

public int shipout(Page page)
            throws DocumentWriterException
Description copied from interface: DocumentWriter
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.

Specified by:
shipout in interface DocumentWriter
Parameters:
page - the page to send
Returns:
returns the number of pages shipped
Throws:
DocumentWriterException
See Also:
de.dante.extex.backend.documentWriter.DocumentWriter#shipout( de.dante.extex.typesetter.type.NodeList)

visitAdjust

public java.lang.Object visitAdjust(AdjustNode value,
                                    java.lang.Object value2)
Description copied from interface: NodeVisitor
This method is called when an AdjustNode has been encountered.

Specified by:
visitAdjust in interface NodeVisitor
Parameters:
value - the first parameter for the visitor is the node visited
value2 - the second parameter for the visitor
Returns:
the visitor specific value
See Also:
NodeVisitor.visitAdjust(AdjustNode, java.lang.Object)

visitAfterMath

public java.lang.Object visitAfterMath(AfterMathNode value,
                                       java.lang.Object value2)
Description copied from interface: NodeVisitor
This method is called when an AfterMathNode has been encountered.

Specified by:
visitAfterMath in interface NodeVisitor
Parameters:
value - the first parameter for the visitor is the node visited
value2 - the second parameter for the visitor
Returns:
the visitor specific value
See Also:
NodeVisitor.visitAfterMath(AfterMathNode, java.lang.Object)

visitAlignedLeaders

public java.lang.Object visitAlignedLeaders(AlignedLeadersNode value,
                                            java.lang.Object value2)
Description copied from interface: NodeVisitor
This method is called when an AlignedLeadersNode has been encountered.

Specified by:
visitAlignedLeaders in interface NodeVisitor
Parameters:
value - the first parameter for the visitor is the node visited
value2 - the second parameter for the visitor
Returns:
the visitor specific value
See Also:
NodeVisitor.visitAlignedLeaders(AlignedLeadersNode, java.lang.Object)

visitBeforeMath

public java.lang.Object visitBeforeMath(BeforeMathNode node,
                                        java.lang.Object value2)
Description copied from interface: NodeVisitor
This method is called when a BeforeMathNode has been encountered.

Specified by:
visitBeforeMath in interface NodeVisitor
Parameters:
node - the first parameter for the visitor is the node visited
value2 - the second parameter for the visitor
Returns:
the visitor specific value
See Also:
NodeVisitor.visitBeforeMath(BeforeMathNode, java.lang.Object)

visitCenteredLeaders

public java.lang.Object visitCenteredLeaders(CenteredLeadersNode node,
                                             java.lang.Object value)
Description copied from interface: NodeVisitor
This method is called when a CenteredLeadersNode has been encountered.

Specified by:
visitCenteredLeaders in interface NodeVisitor
Parameters:
node - the first parameter for the visitor is the node visited
value - the second parameter for the visitor
Returns:
the visitor specific value
See Also:
NodeVisitor.visitCenteredLeaders(CenteredLeadersNode, java.lang.Object)

visitChar

public java.lang.Object visitChar(CharNode node,
                                  java.lang.Object value)
Description copied from interface: NodeVisitor
This method is called when a CharNode has been encountered.

Specified by:
visitChar in interface NodeVisitor
Parameters:
node - the first parameter for the visitor is the node visited
value - the second parameter for the visitor
Returns:
the visitor specific value
See Also:
NodeVisitor.visitChar(CharNode, java.lang.Object)

visitDiscretionary

public java.lang.Object visitDiscretionary(DiscretionaryNode node,
                                           java.lang.Object value)
Description copied from interface: NodeVisitor
This method is called when a DiscretionaryNode has been encountered.

Specified by:
visitDiscretionary in interface NodeVisitor
Parameters:
node - the first parameter for the visitor is the node visited
value - the second parameter for the visitor
Returns:
the visitor specific value
See Also:
NodeVisitor.visitDiscretionary(DiscretionaryNode, java.lang.Object)

visitExpandedLeaders

public java.lang.Object visitExpandedLeaders(ExpandedLeadersNode node,
                                             java.lang.Object value)
Description copied from interface: NodeVisitor
This method is called when an ExpandedLeadersNode has been encountered.

Specified by:
visitExpandedLeaders in interface NodeVisitor
Parameters:
node - the first parameter for the visitor is the node visited
value - the second parameter for the visitor
Returns:
the visitor specific value
See Also:
NodeVisitor.visitExpandedLeaders(ExpandedLeadersNode, java.lang.Object)

visitGlue

public java.lang.Object visitGlue(GlueNode node,
                                  java.lang.Object value)
Description copied from interface: NodeVisitor
This method is called when a GlueNode has been encountered.

Specified by:
visitGlue in interface NodeVisitor
Parameters:
node - the first parameter for the visitor is the node visited
value - the second parameter for the visitor
Returns:
the visitor specific value
See Also:
NodeVisitor.visitGlue(GlueNode, java.lang.Object)

visitHorizontalList

public java.lang.Object visitHorizontalList(HorizontalListNode node,
                                            java.lang.Object value)
Description copied from interface: NodeVisitor
This method is called when a HorizontalListNode has been encountered.

Specified by:
visitHorizontalList in interface NodeVisitor
Parameters:
node - the first parameter for the visitor is the node visited
value - the second parameter for the visitor
Returns:
the visitor specific value
See Also:
NodeVisitor.visitHorizontalList(HorizontalListNode, java.lang.Object)

visitInsertion

public java.lang.Object visitInsertion(InsertionNode node,
                                       java.lang.Object value)
Description copied from interface: NodeVisitor
This method is called when an InsertionNode has been encountered.

Specified by:
visitInsertion in interface NodeVisitor
Parameters:
node - the first parameter for the visitor is the node visited
value - the second parameter for the visitor
Returns:
the visitor specific value
See Also:
NodeVisitor.visitInsertion(InsertionNode, java.lang.Object)

visitKern

public java.lang.Object visitKern(KernNode node,
                                  java.lang.Object value)
Description copied from interface: NodeVisitor
This method is called when a KernNode has been encountered.

Specified by:
visitKern in interface NodeVisitor
Parameters:
node - the first parameter for the visitor is the node visited
value - the second parameter for the visitor
Returns:
the visitor specific value
See Also:
NodeVisitor.visitKern(KernNode, java.lang.Object)

visitLigature

public java.lang.Object visitLigature(LigatureNode node,
                                      java.lang.Object value)
Description copied from interface: NodeVisitor
This method is called when a LigatureNode has been encountered.

Specified by:
visitLigature in interface NodeVisitor
Parameters:
node - the first parameter for the visitor is the node visited
value - the second parameter for the visitor
Returns:
the visitor specific value
See Also:
NodeVisitor.visitLigature(LigatureNode, java.lang.Object)

visitMark

public java.lang.Object visitMark(MarkNode node,
                                  java.lang.Object value)
Description copied from interface: NodeVisitor
This method is called when a MarkNode has been encountered.

Specified by:
visitMark in interface NodeVisitor
Parameters:
node - the first parameter for the visitor is the node visited
value - the second parameter for the visitor
Returns:
the visitor specific value
See Also:
NodeVisitor.visitMark(MarkNode, java.lang.Object)

visitPenalty

public java.lang.Object visitPenalty(PenaltyNode node,
                                     java.lang.Object value)
Description copied from interface: NodeVisitor
This method is called when a PenaltyNode has been encountered.

Specified by:
visitPenalty in interface NodeVisitor
Parameters:
node - the first parameter for the visitor is the node visited
value - the second parameter for the visitor
Returns:
the visitor specific value
See Also:
NodeVisitor.visitPenalty(PenaltyNode, java.lang.Object)

visitRule

public java.lang.Object visitRule(RuleNode node,
                                  java.lang.Object value)
Description copied from interface: NodeVisitor
This method is called when a RuleNode has been encountered.

Specified by:
visitRule in interface NodeVisitor
Parameters:
node - the first parameter for the visitor is the node visited
value - the second parameter for the visitor
Returns:
the visitor specific value
See Also:
NodeVisitor.visitRule(RuleNode, java.lang.Object)

visitSpace

public java.lang.Object visitSpace(SpaceNode node,
                                   java.lang.Object value)
Description copied from interface: NodeVisitor
This method is called when a SpaceNode has been encountered.

Specified by:
visitSpace in interface NodeVisitor
Parameters:
node - the first parameter for the visitor is the node visited
value - the second parameter for the visitor
Returns:
the visitor specific value
See Also:
NodeVisitor.visitSpace(SpaceNode, java.lang.Object)

visitVerticalList

public java.lang.Object visitVerticalList(VerticalListNode node,
                                          java.lang.Object value)
Description copied from interface: NodeVisitor
This method is called when a VerticalListNode has been encountered.

Specified by:
visitVerticalList in interface NodeVisitor
Parameters:
node - the first parameter for the visitor is the node visited
value - the second parameter for the visitor
Returns:
the visitor specific value
See Also:
NodeVisitor.visitVerticalList(VerticalListNode, java.lang.Object)

visitVirtualChar

public java.lang.Object visitVirtualChar(VirtualCharNode node,
                                         java.lang.Object value)
                                  throws GeneralException
Description copied from interface: NodeVisitor
This method is called when a VirtualCharNode has been encountered.

Specified by:
visitVirtualChar in interface NodeVisitor
Parameters:
node - the first parameter for the visitor is the node visited
value - the second parameter for the visitor
Returns:
the visitor specific value
Throws:
GeneralException - in case of an error
See Also:
NodeVisitor.visitVirtualChar(de.dante.extex.typesetter.type.node.VirtualCharNode, java.lang.Object)

visitWhatsIt

public java.lang.Object visitWhatsIt(WhatsItNode nde,
                                     java.lang.Object value)
Description copied from interface: NodeVisitor
This method is called when a WhatsItNode has been encountered.

Specified by:
visitWhatsIt in interface NodeVisitor
Parameters:
nde - the first parameter for the visitor is the node visited
value - the second parameter for the visitor
Returns:
the visitor specific value
See Also:
NodeVisitor.visitWhatsIt(WhatsItNode, java.lang.Object)