sk.uniba.euromath.gene.controller
Class ExporterPipe

java.lang.Object
  extended by sk.uniba.euromath.gene.controller.ExporterPipe

final class ExporterPipe
extends Object

Often there are no exporters that can directly produce desired output. In this instance, we may use two exporters: one that produces document that processes second exporter which produces the desired output. These two (multiple) exporters can then be wrapped in one exporter; this exporter is called a exporter pipe.

This object encapsulates functionality of such exporter - it is able to connect multiple exporters, split result multi-namespaced document into nametrees and process them separately.

Author:
Martin Vysny

Constructor Summary
ExporterPipe(TransformationInfo info, ICoordinator coordinator, NamespacePath path, URLDir resultRoot, String resultName, ThreadGroup exportThreads)
          Constructs instance of the pipe.
 
Method Summary
 Source export(DocumentFragment source, SourceEnum expected)
          Exports given nametree as defined by the transformation info.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExporterPipe

public ExporterPipe(TransformationInfo info,
                    ICoordinator coordinator,
                    NamespacePath path,
                    URLDir resultRoot,
                    String resultName,
                    ThreadGroup exportThreads)
Constructs instance of the pipe.

Parameters:
info - Contains information about all exporters available to the pipe.
coordinator - the coordinator instance. Result is transmitted to this coordinator worker if there are no exporters defined to process the result - when targets map of actual transformation info is empty.
path - the namespace path to the parent product.
resultRoot - the directory where the result file will be located. May be null if the result gets processed by the on-screen renderer.
resultName - the file name (+extension) of the result file. May be null if the result gets processed by the on-screen renderer.
exportThreads - all exporter threads will be part of this group.
Method Detail

export

public Source export(DocumentFragment source,
                     SourceEnum expected)
              throws ExportException,
                     IOException
Exports given nametree as defined by the transformation info.

Parameters:
source - the source nametree
expected - expected kind of Source object returned by this function. If coordinator's ICoordinator.partialResultEvent(DocumentFragment, NamespacePath, Source, String, CoordinatorInputKey) function returns Source inconvertible to this kind then ExportException is thrown.
Returns:
source, that can be queried for the export result. Properly initialized: DOMSource contains node result, SAXSource's XML reader is set, ObjectSource's object is set, and StreamSource's reader is set.
Throws:
ExportException - if some export-related error occurs.
IOException - if i/o error occurs.


Copyright 2003-2003-2006 null. All Rights Reserved.