Class TemplateComponent
java.lang.Object
io.mindspice.simplypages.core.TemplateComponent
- All Implemented Interfaces:
Component
Component adapter that binds a compiled Template to a fixed RenderContext.
Context contract: render(RenderContext) ignores the parent context and always renders
with the bound context.
Mutability/thread-safety: immutable wrapper. Effective thread-safety depends on whether the bound context is mutated concurrently.
-
Constructor Summary
ConstructorsConstructorDescriptionTemplateComponent(Template template, RenderContext context) Creates a template-backed component with a fixed render context. -
Method Summary
Modifier and TypeMethodDescriptionstatic TemplateComponentof(Template template, RenderContext context) Factory forTemplateComponent.render(RenderContext parentContext) Renders using the bound context and ignoresparentContext.
-
Constructor Details
-
TemplateComponent
Creates a template-backed component with a fixed render context.- Parameters:
template- compiled template to rendercontext- context used for all renders
-
-
Method Details
-
of
Factory forTemplateComponent. -
render
Renders using the bound context and ignoresparentContext.
-