de.fu_berlin.ties
Class DocumentProcessor

java.lang.Object
  extended by de.fu_berlin.ties.ConfigurableProcessor
      extended by de.fu_berlin.ties.TextProcessor
          extended by de.fu_berlin.ties.DocumentReader
              extended by de.fu_berlin.ties.DocumentProcessor
All Implemented Interfaces:
Processor

public abstract class DocumentProcessor
extends DocumentReader

Abstract base class for a Processor that operates on XML documents.

Version:
$Revision: 1.5 $, $Date: 2004/08/30 15:40:21 $, $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
DocumentProcessor(String outExt, TiesConfiguration conf)
          Creates a new instance.
 
Method Summary
abstract  void process(Document document, ContextMap context)
          Processes an XML document.
 void process(Document document, Writer writer, ContextMap context)
          Processes an XML document, writing a modified version to a writer.
 
Methods inherited from class de.fu_berlin.ties.DocumentReader
doProcess
 
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

DocumentProcessor

public DocumentProcessor(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

process

public abstract void process(Document document,
                             ContextMap context)
                      throws IOException,
                             ProcessingException
Processes an XML document.

Parameters:
document - the document to process
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 final void process(Document document,
                          Writer writer,
                          ContextMap context)
                   throws IOException,
                          ProcessingException
Processes an XML document, writing a modified version to a writer. This implementation delegates to process(Document, ContextMap).

Specified by:
process in class DocumentReader
Parameters:
document - the document to process
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; must contain a mapping from IOUtils.KEY_LOCAL_CHARSET to the character set of the writer
Throws:
IOException - if an I/O error occurs
ProcessingException - if an error occurs during processing


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