Class AbstractXDocPreprocessor<T>

java.lang.Object
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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract void
    closeSource(T reader)
     
    boolean
    create(String entryName, fr.opensagres.xdocreport.core.io.XDocArchive outputArchive, fr.opensagres.xdocreport.template.formatter.FieldsMetadata fieldsMetadata, fr.opensagres.xdocreport.template.formatter.IDocumentFormatter formatter, Map<String,Object> sharedContext)
    Create the XML file identify with te entry name from the archive.
    protected void
    createAndProcess(String entryName, fr.opensagres.xdocreport.core.io.XDocArchive outputArchive, fr.opensagres.xdocreport.template.formatter.FieldsMetadata fieldsMetadata, fr.opensagres.xdocreport.template.formatter.IDocumentFormatter formatter, Map<String,Object> sharedContext, InputStream input)
     
    protected abstract T
    getSource(fr.opensagres.xdocreport.core.io.XDocArchive documentArchive, String entryName)
     
    void
    preprocess(String entryName, fr.opensagres.xdocreport.core.io.XDocArchive documentArchive, fr.opensagres.xdocreport.template.formatter.FieldsMetadata fieldsMetadata, fr.opensagres.xdocreport.template.formatter.IDocumentFormatter formater, Map<String,Object> sharedContext)
    Modify the XML file identify with te entry name from the archive.
    abstract boolean
    preprocess(String entryName, T reader, Writer writer, fr.opensagres.xdocreport.template.formatter.FieldsMetadata fieldsMetadata, fr.opensagres.xdocreport.template.formatter.IDocumentFormatter formater, Map<String,Object> context)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AbstractXDocPreprocessor

      public AbstractXDocPreprocessor()
  • Method Details

    • preprocess

      public void preprocess(String entryName, fr.opensagres.xdocreport.core.io.XDocArchive documentArchive, fr.opensagres.xdocreport.template.formatter.FieldsMetadata fieldsMetadata, fr.opensagres.xdocreport.template.formatter.IDocumentFormatter formater, Map<String,Object> sharedContext) throws fr.opensagres.xdocreport.core.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:
      fr.opensagres.xdocreport.core.XDocReportException
      IOException
    • closeSource

      protected abstract void closeSource(T reader) throws fr.opensagres.xdocreport.core.XDocReportException, IOException
      Throws:
      fr.opensagres.xdocreport.core.XDocReportException
      IOException
    • create

      public boolean create(String entryName, fr.opensagres.xdocreport.core.io.XDocArchive outputArchive, fr.opensagres.xdocreport.template.formatter.FieldsMetadata fieldsMetadata, fr.opensagres.xdocreport.template.formatter.IDocumentFormatter formatter, Map<String,Object> sharedContext) throws fr.opensagres.xdocreport.core.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:
      fr.opensagres.xdocreport.core.XDocReportException
      IOException
    • createAndProcess

      protected void createAndProcess(String entryName, fr.opensagres.xdocreport.core.io.XDocArchive outputArchive, fr.opensagres.xdocreport.template.formatter.FieldsMetadata fieldsMetadata, fr.opensagres.xdocreport.template.formatter.IDocumentFormatter formatter, Map<String,Object> sharedContext, InputStream input) throws IOException, fr.opensagres.xdocreport.core.XDocReportException
      Throws:
      IOException
      fr.opensagres.xdocreport.core.XDocReportException
    • preprocess

      public abstract boolean preprocess(String entryName, T reader, Writer writer, fr.opensagres.xdocreport.template.formatter.FieldsMetadata fieldsMetadata, fr.opensagres.xdocreport.template.formatter.IDocumentFormatter formater, Map<String,Object> context) throws fr.opensagres.xdocreport.core.XDocReportException, IOException
      Throws:
      fr.opensagres.xdocreport.core.XDocReportException
      IOException
    • getSource

      protected abstract T getSource(fr.opensagres.xdocreport.core.io.XDocArchive documentArchive, String entryName) throws fr.opensagres.xdocreport.core.XDocReportException, IOException
      Throws:
      fr.opensagres.xdocreport.core.XDocReportException
      IOException