Models traditionally in web applications and template engines in general are Map based. JStachio prefers stronger typing than that however there are many scenarios where Map approach might be better for legacy reasons or because of variables that need to be added after the model has been created. An example is web applications where request based attributes may need to be available to the model such as CSRF token.
None of this behavior in this package is available to generated code that is
JStacheType.STACHE. By default
JStacheType.JSTACHIO templates are context aware. To disable
- API Note
- Much of this package is an experimental extension of JStachio and while we try to limit public API additions the proper use cases and design are still ongoing.
ClassDescriptionA special JStachio that can render models with a loose typed context object bound to "@context".This interface serves three puproses: A way to represent the current context stack (see
ContextNode.parent()) Allow you to simulate JSON/Javscript object node like trees without being coupled to a particularly JSON lib.A marker interface to signify something is context aware.A context aware template.Extend this class to make
JStachemodel act like JSON object or a java.util.Map.