Class IFConcatenator
java.lang.Object
org.apache.fop.render.intermediate.util.IFConcatenator
This class allows to concatenate multiple intermediate format files to a single output file
in the final format. It is based on the SAX API and is therefore very fast and does not
require to load the individual documents into memory as DOM documents, for example.
Note: This class will filter/ignore any document navigation events. Support for this may be added later.
Note: document-level extensions will only be transferred from the first document passed in. If you need to merge extensions from all the concatenated documents, you may have to merge these manually on the XML level, for example using XSLT.
-
Constructor Summary
ConstructorDescriptionIFConcatenator
(IFDocumentHandler targetHandler, org.apache.xmlgraphics.xmp.Metadata metadata) Creates a new IF concatenator. -
Method Summary
Modifier and TypeMethodDescriptionvoid
appendDocument
(Source src) Appends another intermediate format document to the current output file.void
finish()
Properly finishes the current output file by creating an empty document trailer and callingIFDocumentHandler.endDocument()
.protected IFDocumentHandler
Returns the target document handler.
-
Constructor Details
-
IFConcatenator
public IFConcatenator(IFDocumentHandler targetHandler, org.apache.xmlgraphics.xmp.Metadata metadata) throws IFException Creates a new IF concatenator.- Parameters:
targetHandler
- the target document handlermetadata
- the metadata object for the generated file (may be null)- Throws:
IFException
- if an IF-related error occurs
-
-
Method Details
-
getTargetHandler
Returns the target document handler.- Returns:
- the target document handler
-
finish
Properly finishes the current output file by creating an empty document trailer and callingIFDocumentHandler.endDocument()
.- Throws:
IFException
- if an IF-related error occurs
-
appendDocument
Appends another intermediate format document to the current output file. All document-level content (i.e. the document header and trailer) is ignored. This method shall not be called afterfinish()
has been called.- Parameters:
src
- the JAXP Source identifying the input document- Throws:
TransformerException
- if an XML-related exception occurs duringIFException
- if an IF-related error occurs
-