de.fu_berlin.ties
Class DocumentReader
java.lang.Object
de.fu_berlin.ties.ConfigurableProcessor
de.fu_berlin.ties.TextProcessor
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.7 $, $Date: 2006/10/21 16:03:52 $, $Author: siefkes $
- Author:
- Christian Siefkes
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. |
DocumentReader
public DocumentReader(String outExt,
TiesConfiguration conf)
- Creates a new instance.
- Parameters:
outExt
- the extension to use for output filesconf
- used to configure this instance; if null
,
the standard configuration is used
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 methodwriter
- the writer to write the processed text to; flushed
but not closed by this methodcontext
- 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 readwriter
- the writer to write the processed text to; flushed
but not closed by this methodcontext
- 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-2007 Christian Siefkes. All Rights Reserved.