Class StaticWebTemplateWriter
- java.lang.Object
-
- net.officefloor.web.template.section.StaticWebTemplateWriter
-
- All Implemented Interfaces:
WebTemplateWriter
public class StaticWebTemplateWriter extends java.lang.Object implements WebTemplateWriter
WebTemplateWriter
to write static content.- Author:
- Daniel Sagenschneider
-
-
Constructor Summary
Constructors Constructor Description StaticWebTemplateWriter(net.officefloor.web.template.parse.StaticParsedTemplateSectionContent staticContent, java.nio.charset.Charset charset)
Initiate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
write(ServerWriter writer, boolean isDefaultCharset, java.lang.Object bean, ServerHttpConnection connection, java.lang.String templatePath)
Writes the template content to theServerWriter
.
-
-
-
Constructor Detail
-
StaticWebTemplateWriter
public StaticWebTemplateWriter(net.officefloor.web.template.parse.StaticParsedTemplateSectionContent staticContent, java.nio.charset.Charset charset) throws java.io.IOException
Initiate.- Parameters:
staticContent
-StaticParsedTemplateSectionContent
to write.charset
-Charset
for the template.- Throws:
java.io.IOException
- If fails to prepare the static content.
-
-
Method Detail
-
write
public void write(ServerWriter writer, boolean isDefaultCharset, java.lang.Object bean, ServerHttpConnection connection, java.lang.String templatePath) throws HttpException
Description copied from interface:WebTemplateWriter
Writes the template content to theServerWriter
.- Specified by:
write
in interfaceWebTemplateWriter
- Parameters:
writer
-ServerWriter
to receive the template content.isDefaultCharset
- Indicates if the defaultCharset
for outputting the template is being used. While theCharset
may be programmatically changed, it is expected in the majority of cases to be using the defaultCharset
configured for the template. This flag allows static content to be cached in bytes (using defaultCharset
) for improved performance.bean
- Bean to potentially obtain data. May benull
if template contents does not require a bean.connection
-ServerHttpConnection
.templatePath
- Current path for theWebTemplate
. As the path may be dynamic (contain path parameters), this is the path to be used by links in rending of theWebTemplate
.- Throws:
HttpException
- If fails to write content.
-
-