Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TemplateContext: provide access to Filters, Insertions, parent context #274

Closed
wants to merge 19 commits into from

Conversation

kohlschuetter
Copy link
Contributor

Expose Filters and Insertions from a TemplateContext, and simplify creating a new child context by adding a newChildContext() helper method.

@msangel
Copy link
Collaborator

msangel commented Jun 27, 2023

Thanks! @kohlschuetter
Could you please take a look at that branch: #269 as I believe that will be the next version. There I have removed all static context where possible and left only those new classes that have been introduced by you last time. The API also changes a lot. Instead of different parse- protect- and render-setting all setting are stored directly in TemplateParser (the same way that provides a single point of default properties).
This is a handy and easy approach to creating complex stuff in an easy way.
For example the same approach from apache common-csv:
image

SO we have similar now:
image
image
image

@msangel
Copy link
Collaborator

msangel commented Jun 27, 2023

And if that branch is not solving issues that this change intended to fix, we can will think how to apply this on top of that.

I will have free time next week somewhere to take a look closer tho this and that and maybe actually do release.

msangel and others added 3 commits June 27, 2023 17:13
Expose Filters and Insertions from a TemplateContext, and simplify
creating a new child context by adding a newChildContext() helper
method.
@kohlschuetter
Copy link
Contributor Author

Great, thanks for the heads-up! I've rebased my changes on top of your branch.

@msangel
Copy link
Collaborator

msangel commented Jul 30, 2023

@kohlschuetter
In my latest changes, the Template doesn't own filters and insertions anymore, it's now a final part of TeplateParser. Therefore no need to have an extra exposing method, as one is already in place.
Also, I rolled-back the removal of Template constructors with different species of CharStream. People used to worth with familiar types: String, File, and InputStream.

Rebased and merged there: #279

Thanks!

@msangel msangel closed this Jul 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants