Search in sources :

Example 1 with ObjectDataProvider

use of org.drools.template.objects.ObjectDataProvider in project drools by kiegroup.

the class ObjectDataCompiler method compile.

/**
 * Compile templates, substituting from a collection of maps or objects
 * into the given template.
 *
 * @param objs           objs the collection of maps or objects
 * @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));
}
Also used : TemplateContainer(org.drools.template.parser.TemplateContainer) DefaultTemplateContainer(org.drools.template.parser.DefaultTemplateContainer) DefaultTemplateContainer(org.drools.template.parser.DefaultTemplateContainer) ObjectDataProvider(org.drools.template.objects.ObjectDataProvider) TemplateDataListener(org.drools.template.parser.TemplateDataListener)

Aggregations

ObjectDataProvider (org.drools.template.objects.ObjectDataProvider)1 DefaultTemplateContainer (org.drools.template.parser.DefaultTemplateContainer)1 TemplateContainer (org.drools.template.parser.TemplateContainer)1 TemplateDataListener (org.drools.template.parser.TemplateDataListener)1