com.ibm.tivoli.maximo.export.excel

Class CsvExportWriter

  • java.lang.Object
    • com.ibm.tivoli.maximo.export.excel.CsvExportWriter
  • All Implemented Interfaces:
    IExportWriter


    public class CsvExportWriter
    extends java.lang.Object
    implements IExportWriter
    CSV Export Writer creates a csv.
    • Constructor Summary

      Constructors 
      Constructor and Description
      CsvExportWriter(javax.servlet.http.HttpServletResponse response) 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void beginDocument(java.lang.String name, java.io.OutputStream out)
      Initializes CSV document stringbuffer
      void beginRow()
      Represents a new row when writing entries to a csv file.
      void emitCell(int cellPos, java.lang.Object val, int maxType, ICellStyle style, IExportContext context)
      Formats values accordingly based on the type of object and encodes double quotes and wraps strings containing commas with quotes and then writes encoded string to the buffer.
      void emitComma()
      Writes a single comma string value to the buffer.
      void endDocument()
      Writes the buffer to the response.
      void endRow()
      Writes a new line to the buffer
      • Methods inherited from class java.lang.Object

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

      • CsvExportWriter

        public CsvExportWriter(javax.servlet.http.HttpServletResponse response)
    • Method Detail

      • beginDocument

        public void beginDocument(java.lang.String name,
                                  java.io.OutputStream out)
        Initializes CSV document stringbuffer
        Specified by:
        beginDocument in interface IExportWriter
        Parameters:
        name - - the name of the sheet created in the excel file
        out - - output stream
      • endDocument

        public void endDocument()
        Writes the buffer to the response.
        Specified by:
        endDocument in interface IExportWriter
      • beginRow

        public void beginRow()
        Represents a new row when writing entries to a csv file.
        Specified by:
        beginRow in interface IExportWriter
      • endRow

        public void endRow()
        Writes a new line to the buffer
        Specified by:
        endRow in interface IExportWriter
      • emitComma

        public void emitComma()
        Writes a single comma string value to the buffer.
        Specified by:
        emitComma in interface IExportWriter
      • emitCell

        public void emitCell(int cellPos,
                             java.lang.Object val,
                             int maxType,
                             ICellStyle style,
                             IExportContext context)
        Formats values accordingly based on the type of object and encodes double quotes and wraps strings containing commas with quotes and then writes encoded string to the buffer.
        Specified by:
        emitCell in interface IExportWriter
        Parameters:
        val - - Object that gets encoded and written to buffer.
        maxtype - - String type of data object