org.openxml.x3p
Interface Processor


public abstract interface Processor

Instance of a processor. The processor instance brings together the process context, and one or more processor engines. The process context is created by the processor and placed under its control. This interface does not define how the processor finds or determines the order of activation of engines. The processor can be used to process multiple documents serially using the same context and engines.

The methods process(Document) and process(Node) are functionally equivalent and only exist as a convenience.

Version:
$Revision: 1.6 $ $Date: 1999/03/20 08:56:37 $
Author:
Assaf Arkin
See Also:
ProcessContext, ProcessorFactory

Method Summary
 ProcessContext getContext()
          Returns the processing context associated with this processor instance.
 Document process(Document source)
          Called to process a document.
 Node process(Node source)
          Called to process a node or node tree.
 

Method Detail

process

public Document process(Document source)
                 throws ProcessorException
Called to process a document. If the processor cannot process the document, it should return the document unaltered. The processor may alter the document, or return a different document. In the latter case, the application should discard the source document. Returning null is possible, but highly discouraged.
Parameters:
source - The document to process
Returns:
The source document intact or processed, or a replacement document
Throws:
ProcessorException - An exception has occured and processing could not continue

process

public Node process(Node source)
             throws ProcessorException
Called to process a node or node tree. If the processor cannot process the node, it should return the node unaltered. The processor may alter the node, or return a different node. In the latter case, the application should discard the source node. Returning null is possible, but highly discouraged.
Parameters:
source - The node or node tree to process
Returns:
The source node intact or processed, or a replacement node
Throws:
ProcessorException - An exception has occured and processing could not continue

getContext

public ProcessContext getContext()
Returns the processing context associated with this processor instance. Each processor instance is associated with a single context and the life cycle of the processor instance is controlled by the processor.
Returns:
The process context of this processor instance