Class ResultSetGenerator


  • public class ResultSetGenerator
    extends java.lang.Object

    A Drools template compiler which takes a ResultSet and compiles it into a template using DefaultTemplateContainer.

    To use simply you need a JDBC ResultSet - with the field names mapping to the field names used in the template !

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void closeStream​(java.io.InputStream stream)  
      java.lang.String compile​(java.sql.ResultSet rs, java.io.InputStream templateStream)
      Generates DRL from a data provider for the spreadsheet data and templates.
      java.lang.String compile​(java.sql.ResultSet rs, java.lang.String template)
      Generates DRL from a data provider for the spreadsheet data and templates.
      java.lang.String compile​(java.sql.ResultSet rs, TemplateDataListener listener)
      Generates DRL from a data provider for the spreadsheet data and templates.
      void newCell​(java.util.List<DataListener> listeners, int row, int column, java.lang.String value, int mergedColStart)  
      • Methods inherited from class java.lang.Object

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

      • ResultSetGenerator

        public ResultSetGenerator()
    • Method Detail

      • compile

        public java.lang.String compile​(java.sql.ResultSet rs,
                                        java.lang.String template)
        Generates DRL from a data provider for the spreadsheet data and templates.
        Parameters:
        rs - the resultset for the table data
        template - the string containing the template resource name
        Returns:
        the generated DRL text as a String
      • compile

        public java.lang.String compile​(java.sql.ResultSet rs,
                                        java.io.InputStream templateStream)
        Generates DRL from a data provider for the spreadsheet data and templates.
        Parameters:
        rs - the resultset for the table data
        templateStream - the InputStream for reading the templates
        Returns:
        the generated DRL text as a String
      • compile

        public java.lang.String compile​(java.sql.ResultSet rs,
                                        TemplateDataListener listener)
        Generates DRL from a data provider for the spreadsheet data and templates.
        Parameters:
        rs - the resultset for the table data
        listener - a template data listener
        Returns:
        the generated DRL text as a String
      • newCell

        public void newCell​(java.util.List<DataListener> listeners,
                            int row,
                            int column,
                            java.lang.String value,
                            int mergedColStart)
      • closeStream

        protected void closeStream​(java.io.InputStream stream)