Skip to content

fix: TemplateExecutor fixed attributes#37

Merged
marioscrock merged 2 commits intomainfrom
fix-template-executor
Mar 12, 2025
Merged

fix: TemplateExecutor fixed attributes#37
marioscrock merged 2 commits intomainfrom
fix-template-executor

Conversation

@AuPath
Copy link
Collaborator

@AuPath AuPath commented Mar 10, 2025

TemplateFunctions and TemplateMap should be provided for each mapping execution, as they could be changed (TemplateMap) or could contain stateful logic (TemplateFunctions).

Closes #35, #36.

TemplateFunctions and TemplateMap should be provided for each mapping
application, as they could be changed (TemplateMap) or could contain
stateful logic (TemplateFunctions)
@AuPath AuPath added the bug Something isn't working label Mar 10, 2025
@AuPath AuPath requested a review from marioscrock March 10, 2025 09:54
@AuPath AuPath self-assigned this Mar 10, 2025
TemplateExecutor templateExecutor = new TemplateExecutor(new TemplateFunctions(), true, false, false, null, null);
String result = templateExecutor.executeMapping(readers, template).replaceAll("\\r\\n", "\n");;
TemplateExecutor templateExecutor = new TemplateExecutor( true, false, false, null);
String result = templateExecutor.executeMapping(readers, template, new TemplateFunctions(), null).replaceAll("\\r\\n", "\n");;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would keep a method .executeMapping(readers, template) that automatically calls .executeMapping(readers, template, new TemplateFunctions(), null) since in most of the cases only the default utils without a Map are used

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adressed by 15327bb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ensure TemplateFunctions Instance Is Separated Per Template Execution TemplateMap ($map) Values Not Updating in TemplateExecutor

2 participants