de.fu_berlin.ties
Class DocumentWriter

java.lang.Object
  extended by de.fu_berlin.ties.ConfigurableProcessor
      extended by de.fu_berlin.ties.TextProcessor
          extended by de.fu_berlin.ties.DocumentWriter
All Implemented Interfaces:
Processor
Direct Known Subclasses:
DSVtoXMLConverter

public abstract class DocumentWriter
extends TextProcessor

Abstract base class for a Processor that writes XML documents.

Version:
$Revision: 1.3 $, $Date: 2006/10/21 16:03:52 $, $Author: siefkes $
Author:
Christian Siefkes

Field Summary
 
Fields inherited from class de.fu_berlin.ties.TextProcessor
CONFIG_POST, KEY_DIRECTORY, KEY_LOCAL_NAME, KEY_OUT_DIRECTORY, KEY_URL
 
Constructor Summary
DocumentWriter(String outExt, TiesConfiguration conf)
          Creates a new instance.
 
Method Summary
protected  void doProcess(Reader reader, Writer writer, ContextMap context)
          Processes the contents of a reader, writing a modified version to a writer.
abstract  Document process(Reader reader, ContextMap context)
          Processes the contents of a reader and stores the results of processing in an XML document.
 
Methods inherited from class de.fu_berlin.ties.TextProcessor
getOutFileExt, process, process, process, process, process, process, toString
 
Methods inherited from class de.fu_berlin.ties.ConfigurableProcessor
getConfig
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DocumentWriter

public DocumentWriter(String outExt,
                      TiesConfiguration conf)
Creates a new instance.

Parameters:
outExt - the extension to use for output files
conf - used to configure this instance; if null, the standard configuration is used
Method Detail

doProcess

protected final void doProcess(Reader reader,
                               Writer writer,
                               ContextMap context)
                        throws IOException,
                               ProcessingException
Processes the contents of a reader, writing a modified version to a writer. This implementation delegates to process(Reader, ContextMap).

Specified by:
doProcess in class TextProcessor
Parameters:
reader - reader containing the text to process; not closed by this method
writer - the writer to write the processed text to; flushed but not closed by this method
context - a map of objects that are made available for processing
Throws:
IOException - if an I/O error occurs
ProcessingException - if an error occurs during processing

process

public abstract Document process(Reader reader,
                                 ContextMap context)
                          throws IOException,
                                 ProcessingException
Processes the contents of a reader and stores the results of processing in an XML document.

Parameters:
reader - reader containing the text to process; not closed by this method
context - a map of objects that are made available for processing
Returns:
the created document
Throws:
IOException - if an I/O error occurs
ProcessingException - if an error occurs during processing


Copyright © 2003-2007 Christian Siefkes. All Rights Reserved.