Class BeanWebTemplateWriter
- java.lang.Object
-
- net.officefloor.web.template.section.BeanWebTemplateWriter
-
- All Implemented Interfaces:
WebTemplateWriter
public class BeanWebTemplateWriter extends java.lang.Object implements WebTemplateWriter
WebTemplateWriterto write a bean.- Author:
- Daniel Sagenschneider
-
-
Constructor Summary
Constructors Constructor Description BeanWebTemplateWriter(net.officefloor.web.template.parse.BeanParsedTemplateSectionContent content, ValueRetriever<java.lang.Object> valueRetriever, boolean isArray, WebTemplateWriter[] beanWriters)Initiate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidwrite(ServerWriter writer, boolean isDefaultCharset, java.lang.Object bean, ServerHttpConnection connection, java.lang.String templatePath)Writes the template content to theServerWriter.
-
-
-
Constructor Detail
-
BeanWebTemplateWriter
public BeanWebTemplateWriter(net.officefloor.web.template.parse.BeanParsedTemplateSectionContent content, ValueRetriever<java.lang.Object> valueRetriever, boolean isArray, WebTemplateWriter[] beanWriters) throws java.lang.ExceptionInitiate.- Parameters:
content-BeanParsedTemplateSectionContent.valueRetriever-ValueRetriever.isArray- Indicates if an array of beans to render.beanWriters-WebTemplateWriterinstances for the bean.- Throws:
java.lang.Exception- IfMethodto obtain the value to write is not available on the bean type.
-
-
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: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.
-
-