Package org.drools.template.parser

Examples of org.drools.template.parser.DefaultTemplateContainer


    public void testCompilerMaps() throws Exception {
        Collection<Map<String, Object>> maps = new ArrayList<Map<String, Object>>();
        final ObjectDataCompiler converter = new ObjectDataCompiler();
        InputStream templateStream =
                this.getClass().getResourceAsStream( "/templates/rule_template_1.drl" );
        TemplateContainer tc = new DefaultTemplateContainer( templateStream );
        Column[] columns = tc.getColumns();

        for ( String[] row : rows ) {
            Map<String, Object> map = new HashMap<String, Object>();
            for ( int icol = 0; icol < columns.length; icol++ ) {
                Object value = row[icol];
View Full Code Here


    public String compile(final InputStream xlsStream,
                          final InputStream templateStream,
                          InputType type,
                          int startRow,
                          int startCol) {
        TemplateContainer tc = new DefaultTemplateContainer( templateStream );
        closeStream( templateStream );
        return compile( xlsStream,
                        type,
                        new TemplateDataListener( startRow,
                                                  startCol,
View Full Code Here

    public String compile(final InputStream xlsStream,
                          final String worksheetName,
                          final InputStream templateStream,
                          int startRow,
                          int startCol) {
        TemplateContainer tc = new DefaultTemplateContainer( templateStream );
        closeStream( templateStream );
        return compile( xlsStream,
                        worksheetName,
                        new TemplateDataListener( startRow,
                                                  startCol,
View Full Code Here

    public String compile(final InputStream xlsStream,
                          final InputStream templateStream,
                          InputType type,
                          int startRow,
                          int startCol) {
        TemplateContainer tc = new DefaultTemplateContainer( templateStream );
        closeStream( templateStream );
        return compile( xlsStream,
                        type,
                        new TemplateDataListener( startRow,
                                                  startCol,
View Full Code Here

    public String compile(final InputStream xlsStream,
                          final String worksheetName,
                          final InputStream templateStream,
                          int startRow,
                          int startCol) {
        TemplateContainer tc = new DefaultTemplateContainer( templateStream );
        closeStream( templateStream );
        return compile( xlsStream,
                        worksheetName,
                        new TemplateDataListener( startRow,
                                                  startCol,
View Full Code Here

     * @param templateStream the InputStream for reading the templates
     * @return the generated DRL text as a String
     */
    public String compile(final DataProvider dataProvider,
                          final InputStream templateStream) {
        TemplateContainer tc = new DefaultTemplateContainer(templateStream);
        closeStream(templateStream);
        return compile(dataProvider,
                       new TemplateDataListener(tc));
    }
View Full Code Here

    public void testCompilerMaps() throws Exception {
        Collection<Map<String, Object>> maps = new ArrayList<Map<String, Object>>();
        final ObjectDataCompiler converter = new ObjectDataCompiler();
        InputStream templateStream =
                this.getClass().getResourceAsStream("/templates/rule_template_1.drl");
        TemplateContainer tc = new DefaultTemplateContainer(templateStream);
        Column[] columns = tc.getColumns();

        for (String[] row : rows) {
            Map<String, Object> map = new HashMap<String, Object>();
            for (int icol = 0; icol < columns.length; icol++) {
                Object value = row[icol];
View Full Code Here

     * @param templateStream the template as a stream
     * @return the expanded rules as a string
     */
    public String compile(final Collection<?> objs,
                          final InputStream templateStream) {
        TemplateContainer tc = new DefaultTemplateContainer(templateStream);
        closeStream(templateStream);
        return compile(new ObjectDataProvider(tc, objs),
                       new TemplateDataListener(tc));
    }
View Full Code Here

     * @return the generated DRL text as a String
     */
    public String compile(final DataProvider dataProvider,
                          final InputStream templateStream,
                          boolean replaceOptionals) {
        DefaultTemplateContainer tc = new DefaultTemplateContainer(templateStream, replaceOptionals);
        closeStream(templateStream);
        return compile(dataProvider,
                       new TemplateDataListener(tc));
    }
View Full Code Here

     * @param templateStream the InputStream for reading the templates
     * @return the generated DRL text as a String
     */
    public String compile(final ResultSet rs,
                          final InputStream templateStream) {
        TemplateContainer tc = new DefaultTemplateContainer(templateStream);
        closeStream(templateStream);
        return compile(rs,
                       new TemplateDataListener(tc));
    }
View Full Code Here

TOP

Related Classes of org.drools.template.parser.DefaultTemplateContainer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.