Class StaticWebTemplateWriter
java.lang.Object
net.officefloor.web.template.section.StaticWebTemplateWriter
- All Implemented Interfaces:
WebTemplateWriter
WebTemplateWriter to write static content.- Author:
- Daniel Sagenschneider
-
Constructor Summary
ConstructorsConstructorDescriptionStaticWebTemplateWriter(net.officefloor.web.template.parse.StaticParsedTemplateSectionContent staticContent, Charset charset) Initiate. -
Method Summary
Modifier and TypeMethodDescriptionvoidwrite(ServerWriter writer, boolean isDefaultCharset, Object bean, ServerHttpConnection connection, String templatePath) Writes the template content to theServerWriter.
-
Constructor Details
-
StaticWebTemplateWriter
public StaticWebTemplateWriter(net.officefloor.web.template.parse.StaticParsedTemplateSectionContent staticContent, Charset charset) throws IOException Initiate.- Parameters:
staticContent-StaticParsedTemplateSectionContentto write.charset-Charsetfor the template.- Throws:
IOException- If fails to prepare the static content.
-
-
Method Details
-
write
public void write(ServerWriter writer, boolean isDefaultCharset, Object bean, ServerHttpConnection connection, String templatePath) throws HttpException Description copied from interface:WebTemplateWriterWrites the template content to theServerWriter.- Specified by:
writein interfaceWebTemplateWriter- Parameters:
writer-ServerWriterto receive the template content.isDefaultCharset- Indicates if the defaultCharsetfor outputting the template is being used. While theCharsetmay be programmatically changed, it is expected in the majority of cases to be using the defaultCharsetconfigured 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 benullif 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.
-