Class ExporterImpl

  • All Implemented Interfaces:
    Exporter

    public class ExporterImpl
    extends java.lang.Object
    implements Exporter
    Simple exporter exporting data as tab separated, comma separated and so. It depends at used row formatter.
    Author:
    Jakub Kulaviak
    • Constructor Summary

      Constructors 
      Constructor Description
      ExporterImpl​(java.io.OutputStream out, RowFormatter rowFormatter)
      Constructor.
      ExporterImpl​(java.io.OutputStream out, RowFormatter rowFormatter, java.lang.String separator, java.util.List<java.lang.String> headers)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean canExport​(java.util.List<java.lang.Class<?>> clazzes)
      This method finds out if result row composed from instances of these classes can be exported with actual implementation of exporter.
      void export​(java.util.Iterator<? extends java.util.List<ResultElement>> resultIt)
      Perform the export with the exporter's defaults in the absence of path collection changes.
      void export​(java.util.Iterator<? extends java.util.List<ResultElement>> resultIt, java.util.Collection<Path> unionPathCollection, java.util.Collection<Path> newPathCollection)
      Do export.
      int getWrittenResultsCount()
      • Methods inherited from class java.lang.Object

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

      • ExporterImpl

        public ExporterImpl​(java.io.OutputStream out,
                            RowFormatter rowFormatter)
        Constructor.
        Parameters:
        out - output stream
        rowFormatter - used row formatter.
      • ExporterImpl

        public ExporterImpl​(java.io.OutputStream out,
                            RowFormatter rowFormatter,
                            java.lang.String separator,
                            java.util.List<java.lang.String> headers)
        Constructor.
        Parameters:
        out - output stream
        rowFormatter - used row formatter.
        separator - line separator
        headers - if non-null, a list of the column headers which will be written by export()
    • Method Detail

      • export

        public void export​(java.util.Iterator<? extends java.util.List<ResultElement>> resultIt,
                           java.util.Collection<Path> unionPathCollection,
                           java.util.Collection<Path> newPathCollection)
        Do export.
        Specified by:
        export in interface Exporter
        Parameters:
        resultIt - iterator over stuff to be exported
        unionPathCollection - a collection of Path combining old and new views
        newPathCollection - a collection of Path to export from the results
      • export

        public void export​(java.util.Iterator<? extends java.util.List<ResultElement>> resultIt)
        Description copied from interface: Exporter
        Perform the export with the exporter's defaults in the absence of path collection changes.
        Specified by:
        export in interface Exporter
        Parameters:
        resultIt - iterator over stuff to be exported.
      • getWrittenResultsCount

        public int getWrittenResultsCount()
        Specified by:
        getWrittenResultsCount in interface Exporter
        Returns:
        count of written results
      • canExport

        public boolean canExport​(java.util.List<java.lang.Class<?>> clazzes)
        This method finds out if result row composed from instances of these classes can be exported with actual implementation of exporter. Universal exporter.
        Specified by:
        canExport in interface Exporter
        Parameters:
        clazzes - classes in row
        Returns:
        always true