de.fu_berlin.ties
Class DocumentReader

java.lang.Object
  extended by de.fu_berlin.ties.ConfigurableProcessor
      extended by de.fu_berlin.ties.TextProcessor
          extended by de.fu_berlin.ties.DocumentReader
All Implemented Interfaces:
Processor
Direct Known Subclasses:
AnswerBuilder, DocumentProcessor, ExtractorBase, XMLStripper

public abstract class DocumentReader
extends TextProcessor

Abstract base class for a Processor that read XML documents.

Version:
$Revision: 1.4 $, $Date: 2004/03/11 16:18:22 $, $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
DocumentReader(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  void process(Document document, Writer writer, ContextMap context)
          Reads an XML document and stores the results of processing in a writer.
 
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

DocumentReader

public DocumentReader(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(Document, Writer, ContextMap). The reader must contain a well-formed XML document.

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 void process(Document document,
                             Writer writer,
                             ContextMap context)
                      throws IOException,
                             ProcessingException
Reads an XML document and stores the results of processing in a writer.

Parameters:
document - the document to read
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


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