Class DataProviderCompiler

java.lang.Object
org.drools.template.DataProviderCompiler
Direct Known Subclasses:
ObjectDataCompiler

public class DataProviderCompiler extends Object
An object of this class acts as a template compiler, inserting spreadsheet data into templates. Template data may come from a resource or an InputStream, or you may provide a TemplateDataListener.
  • Constructor Details

    • DataProviderCompiler

      public DataProviderCompiler()
  • Method Details

    • compile

      public String compile(DataProvider dataProvider, String template)
      Generates DRL from a data provider for the spreadsheet data and templates.
      Parameters:
      dataProvider - the data provider for the spreadsheet data
      template - the string containing the template resource name
      Returns:
      the generated DRL text as a String
    • compile

      public String compile(DataProvider dataProvider, InputStream templateStream)
      Generates DRL from a data provider for the spreadsheet data and templates.
      Parameters:
      dataProvider - the data provider for the spreadsheet data
      templateStream - the InputStream for reading the templates
      Returns:
      the generated DRL text as a String
    • compile

      public String compile(DataProvider dataProvider, TemplateDataListener listener)
      Generates DRL from a data provider for the spreadsheet data and templates.
      Parameters:
      dataProvider - the data provider for the spreadsheet data
      listener - a template data listener
      Returns:
      the generated DRL text as a String
    • compile

      public String compile(DataProvider dataProvider, String template, boolean replaceOptionals)
      Generates DRL from a data provider for the spreadsheet data and templates.
      Parameters:
      dataProvider - the data provider for the spreadsheet data
      template - the string containing the template resource name
      Returns:
      the generated DRL text as a String
    • compile

      public String compile(DataProvider dataProvider, InputStream templateStream, boolean replaceOptionals)
      Generates DRL from a data provider for the spreadsheet data and templates.
      Parameters:
      dataProvider - the data provider for the spreadsheet data
      templateStream - the InputStream for reading the templates
      Returns:
      the generated DRL text as a String
    • compile

      public String compile(DataProvider dataProvider, TemplateDataListener listener, boolean replaceOptionals)
      Generates DRL from a data provider for the spreadsheet data and templates.
      Parameters:
      dataProvider - the data provider for the spreadsheet data
      listener - a template data listener
      Returns:
      the generated DRL text as a String
    • newCell

      public void newCell(List<DataListener> listeners, int row, int column, String value, int mergedColStart)
    • closeStream

      protected void closeStream(InputStream stream)