public class TemplateRenderer extends Object implements Renderer, Appendable
Retrieves a template from the provider application and renders it to the writer replacing the parameters with the
given map. If name
param is null
, the whole page will be used as the template.
eg: The template mytemplate
can be delimited in the provider page by comments
<!--$begintemplate$mytemplate$-->
and <!--$endtemplate$mytemplate$-->
.
Inside the template, the parameters can be defined by comments.
eg: parameter named myparam
should be delimited by comments
<!--$beginparam$myparam$-->
and <!--$endparam$myparam$-->
Constructor and Description |
---|
TemplateRenderer(String name,
Map<String,String> params,
String page) |
Modifier and Type | Method and Description |
---|---|
Appendable |
append(char c) |
Appendable |
append(CharSequence csq) |
Appendable |
append(CharSequence csq,
int start,
int end) |
String |
getName() |
String |
getParam(String pName) |
void |
render(DriverRequest httpRequest,
String content,
Writer pOut)
Renders provided source and writes results to the output.
|
void |
setWrite(boolean write) |
public void render(DriverRequest httpRequest, String content, Writer pOut) throws IOException, HttpErrorPage
render
in interface Renderer
httpRequest
- request received by esigate.content
- source to be renderedpOut
- output destination. This writer is not thread-safe, use proper synchronization if writing output from
multiple threads.IOException
HttpErrorPage
public String getName()
public void setWrite(boolean write)
public Appendable append(CharSequence csq) throws IOException
append
in interface Appendable
IOException
public Appendable append(char c) throws IOException
append
in interface Appendable
IOException
public Appendable append(CharSequence csq, int start, int end) throws IOException
append
in interface Appendable
IOException
Copyright © 2008–2018. All rights reserved.