Class HelloModelView
java.lang.Object
io.jstach.opt.spring.webflux.example.hello.HelloModelView
- All Implemented Interfaces:
- Renderer<HelloModel>,- JStachioFilter.FilterChain,- TemplateProvider,- Template<HelloModel>,- TemplateInfo
@Component
public class HelloModelView
extends Object
implements Template<HelloModel>, TemplateInfo, TemplateProvider, JStachioFilter.FilterChain
Generated Renderer.
- 
Nested Class SummaryNested classes/interfaces inherited from interface io.jstach.jstachio.TemplateInfoTemplateInfo.TemplateSource
- 
Constructor SummaryConstructorsConstructorDescriptionRenderer constructor for reflection (use of() instead).HelloModelView(TemplateConfig templateConfig) Renderer constructor using config.Renderer constructor for manual wiring.
- 
Method SummaryModifier and TypeMethodDescriptionvoidexecute(HelloModel model, Appendable a) Renders the passed in model.voidexecute(HelloModel model, Appendable a, Formatter formatter, Escaper escaper) Renders the passed in model.Class<?>Model class.static HelloModelViewof()Convience static factory that will reuse the same singleton instance.static <A extends Appendable>
 voidrender(HelloModel data, A unescapedWriter, Formatter formatter, Appender<? super A> escaper, Appender<A> appender) Renders the passed in model.booleansupportsType(Class<?> type) Checks to see if a template supports the model class.Appender.Class<?>The template content type is the class annotated withJStacheContentTypewhich also describes the escaper to be used.The escaper to be used on the template.The base formatter to be used on the template.The logical name of the template which maybe different thanTemplateInfo.templatePath().If the template is a classpath resource file this will return the location that was originally resolved viaconfig resolution.The raw contents of the template.Methods inherited from class java.lang.Objectequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.jstach.jstachio.TemplateInfodescription, lastLoaded, normalizePath, templateSourceMethods inherited from interface io.jstach.jstachio.spi.TemplateProviderprovideTemplates
- 
Constructor Details- 
HelloModelViewRenderer constructor for manual wiring.- Parameters:
- formatter- formatter if null the static formatter will be used.
- escaper- escaper if null the static escaper will be used
 
- 
HelloModelViewpublic HelloModelView()Renderer constructor for reflection (use of() instead). For programmatic consider usingof()for a shared singleton.
- 
HelloModelViewRenderer constructor using config.- Parameters:
- templateConfig- config that has collaborators
 
 
- 
- 
Method Details- 
executeDescription copied from interface:TemplateRenders the passed in model.- Specified by:
- executein interface- Renderer<HelloModel>
- Specified by:
- executein interface- Template<HelloModel>
- Parameters:
- model- a model assumed never to be- null.
- a- the appendable to write to.
- Throws:
- IOException- if there is an error writing to the appendable
 
- 
executepublic void execute(HelloModel model, Appendable a, Formatter formatter, Escaper escaper) throws IOException Description copied from interface:TemplateRenders the passed in model.- Specified by:
- executein interface- Template<HelloModel>
- Parameters:
- model- a model assumed never to be- null.
- a- appendable to write to.
- formatter- formats variables before they are passed to the escaper
- escaper- used to write escaped variables
- Throws:
- IOException- if an error occurs while writing to the appendable
 
- 
supportsTypeDescription copied from interface:TemplateInfoChecks to see if a template supports the model class.- Specified by:
- supportsTypein interface- TemplateInfo
- Parameters:
- type- the class of the model.
- Returns:
- if this renderer supports the class.
 
- 
templatePathDescription copied from interface:TemplateInfoIf the template is a classpath resource file this will return the location that was originally resolved viaconfig resolution.- Specified by:
- templatePathin interface- TemplateInfo
- Returns:
- the location of the template or empty if the template is inlined.
- See Also:
 
- 
templateNameDescription copied from interface:TemplateInfoThe logical name of the template which maybe different thanTemplateInfo.templatePath().- Specified by:
- templateNamein interface- TemplateInfo
- Returns:
- logical name of template. Never null.
 
- 
templateStringDescription copied from interface:TemplateInfoThe raw contents of the template. Useful if the template is inline. To determine if the template is actually inline useTemplateInfo.templateSource().- Specified by:
- templateStringin interface- TemplateInfo
- Returns:
- the raw contents of the template never null.
- See Also:
 
- 
templateContentTypeDescription copied from interface:TemplateInfoThe template content type is the class annotated withJStacheContentTypewhich also describes the escaper to be used.- Specified by:
- templateContentTypein interface- TemplateInfo
- Returns:
- the template content type.
 
- 
templateEscaperDescription copied from interface:TemplateInfoThe escaper to be used on the template. SeeEscaper.of(Function).- Specified by:
- templateEscaperin interface- TemplateInfo
- Returns:
- the escaper.
- See Also:
 
- 
templateFormatterDescription copied from interface:TemplateInfoThe base formatter to be used on the template. SeeFormatter.of(Function).- Specified by:
- templateFormatterin interface- TemplateInfo
- Returns:
- the formatter.
- See Also:
 
- 
templateAppenderAppender.- Returns:
- appender for writing unescaped variables.
 
- 
modelClassModel class.- Specified by:
- modelClassin interface- Template<HelloModel>
- Returns:
- class used as model (annotated with JStache).
 
- 
ofConvience static factory that will reuse the same singleton instance.- Returns:
- renderer same as calling no-arg constructor but is cached with singleton instance
 
- 
renderpublic static <A extends Appendable> void render(HelloModel data, A unescapedWriter, Formatter formatter, Appender<? super A> escaper, Appender<A> appender) throws IOException Renders the passed in model.- Type Parameters:
- A- appendable type.
- Parameters:
- data- model
- unescapedWriter- appendable to write to.
- formatter- formats variables before they are passed to the escaper.
- escaper- used to write escaped variables.
- appender- used to write unescaped variables.
- Throws:
- IOException- if an error occurs while writing to the appendable
 
 
-