-
-
Notifications
You must be signed in to change notification settings - Fork 383
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
ClassCastException if Context isn't a ContextImpl #18
Comments
I see it. Issues #17 solve one part of the problem, but not what you're trying to do. A have one question for you:
From my perspective, a user should never never need to create a custom Context (that is why #17 was created). A different/safe approach will be the extend the context API with the ability to let client to resolve value and reuse all the context stack rules. This also means:
What do you think? Thanks |
It sounds good. My context implementation had way too much code copied from your ContextImpl anyway. |
fixed in 0.2.0. The jar is in maven central. I'll write the release notes later today Oh, have a look to the README, specially the Advanced usage section |
It's perfect... except :-) for the Context.newContext() call in DefaultOptions.apply() where I can't find a way to add the FieldValueResolver that I want. So
works only if the User class have a getName(), not if 'name' is a field. |
good catch! All the issues are more or less related to making public "Context", I have to review Options#apply and Template#apply. wait for the next release, everything will be working as expected! |
ClassCastException if Context isn't a ContextImpl #18
Congrats on the 0.1.0 release!
I wanted to try the new Context interface for an "advanced" use of adding support for public fields and for public static fields.
When one of my helpers want to render some other template I get an exception
because my implementation of Context can not be cast to a ContextImpl. Replacing the cast with
works for me.
The text was updated successfully, but these errors were encountered: