fr.opensagres.xdocreport.document.preprocessor
Class AbstractXDocPreprocessor<T>

java.lang.Object
  extended by fr.opensagres.xdocreport.document.preprocessor.AbstractXDocPreprocessor<T>
All Implemented Interfaces:
IXDocPreprocessor
Direct Known Subclasses:
DOMPreprocessor, SAXXDocPreprocessor

public abstract class AbstractXDocPreprocessor<T>
extends Object
implements IXDocPreprocessor

Abstract class for IXDocPreprocessor.


Constructor Summary
AbstractXDocPreprocessor()
           
 
Method Summary
protected abstract  void closeSource(T reader)
           
 boolean create(String entryName, XDocArchive outputArchive, FieldsMetadata fieldsMetadata, IDocumentFormatter formatter, Map<String,Object> sharedContext)
          Create the XML file identify with te entry name from the archive.
protected  void createAndProcess(String entryName, XDocArchive outputArchive, FieldsMetadata fieldsMetadata, IDocumentFormatter formatter, Map<String,Object> sharedContext, InputStream input)
           
protected abstract  T getSource(XDocArchive documentArchive, String entryName)
           
abstract  boolean preprocess(String entryName, T reader, Writer writer, FieldsMetadata fieldsMetadata, IDocumentFormatter formater, Map<String,Object> context)
           
 void preprocess(String entryName, XDocArchive documentArchive, FieldsMetadata fieldsMetadata, IDocumentFormatter formater, Map<String,Object> sharedContext)
          Modify the XML file identify with te entry name from the archive.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractXDocPreprocessor

public AbstractXDocPreprocessor()
Method Detail

preprocess

public void preprocess(String entryName,
                       XDocArchive documentArchive,
                       FieldsMetadata fieldsMetadata,
                       IDocumentFormatter formater,
                       Map<String,Object> sharedContext)
                throws XDocReportException,
                       IOException
Description copied from interface: IXDocPreprocessor
Modify the XML file identify with te entry name from the archive.

Specified by:
preprocess in interface IXDocPreprocessor
Parameters:
entryName - Zip entry name fo the XML file to modify.
documentArchive - the zip of the XML document.
fieldsMetadata - metdata fields.
sharedContext - shared context between the whole processor to execute. This Map can be used to share information between processors (according the order of the processor registration).
Throws:
XDocReportException
IOException

closeSource

protected abstract void closeSource(T reader)
                             throws XDocReportException,
                                    IOException
Throws:
XDocReportException
IOException

create

public boolean create(String entryName,
                      XDocArchive outputArchive,
                      FieldsMetadata fieldsMetadata,
                      IDocumentFormatter formatter,
                      Map<String,Object> sharedContext)
               throws XDocReportException,
                      IOException
Description copied from interface: IXDocPreprocessor
Create the XML file identify with te entry name from the archive.

Specified by:
create in interface IXDocPreprocessor
Parameters:
entryName - Zip entry name fo the XML file to modify.
outputArchive - the zip of the XML document.
fieldsMetadata - metdata fields.
sharedContext - shared context between the whole processor to execute. This Map can be used to share information between processors (according the order of the processor registration).
Returns:
true if processing can create entry and false otherwise.
Throws:
XDocReportException
IOException

createAndProcess

protected void createAndProcess(String entryName,
                                XDocArchive outputArchive,
                                FieldsMetadata fieldsMetadata,
                                IDocumentFormatter formatter,
                                Map<String,Object> sharedContext,
                                InputStream input)
                         throws IOException,
                                XDocReportException
Throws:
IOException
XDocReportException

preprocess

public abstract boolean preprocess(String entryName,
                                   T reader,
                                   Writer writer,
                                   FieldsMetadata fieldsMetadata,
                                   IDocumentFormatter formater,
                                   Map<String,Object> context)
                            throws XDocReportException,
                                   IOException
Throws:
XDocReportException
IOException

getSource

protected abstract T getSource(XDocArchive documentArchive,
                               String entryName)
                        throws XDocReportException,
                               IOException
Throws:
XDocReportException
IOException


Copyright © 2013. All rights reserved.