Class ContextualTemplateRenderer
- java.lang.Object
-
- com.aspectran.core.component.AbstractComponent
-
- com.aspectran.core.component.template.ContextualTemplateRenderer
-
- All Implemented Interfaces:
Component
,TemplateRenderer
public class ContextualTemplateRenderer extends AbstractComponent implements TemplateRenderer
The Class ContextualTemplateRenderer.Created: 2016. 1. 14.
-
-
Constructor Summary
Constructors Constructor Description ContextualTemplateRenderer(ActivityContext context, TemplateRuleRegistry templateRuleRegistry)
Instantiates a new context template renderer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doDestroy()
protected void
doInitialize()
void
render(TemplateRule templateRule, Activity activity)
Renders the template with specified TemplateRule.void
render(TemplateRule templateRule, Activity activity, java.util.Map<java.lang.String,java.lang.Object> model)
Renders the template with specified TemplateRule.void
render(TemplateRule templateRule, Activity activity, java.util.Map<java.lang.String,java.lang.Object> model, java.io.Writer writer)
Renders the template with specified TemplateRule.java.lang.String
render(TemplateRule templateRule, java.util.Map<java.lang.String,java.lang.Object> model)
Renders the template with specified TemplateRule.java.lang.String
render(java.lang.String templateId)
Renders the template with specified TemplateRule by its ID.void
render(java.lang.String templateId, Activity activity)
Renders the template with specified TemplateRule by its ID.void
render(java.lang.String templateId, Activity activity, java.io.Writer writer)
Renders the template with specified TemplateRule by its ID.void
render(java.lang.String templateId, Activity activity, java.util.Map<java.lang.String,java.lang.Object> model)
Renders the template with specified TemplateRule by its ID.void
render(java.lang.String templateId, Activity activity, java.util.Map<java.lang.String,java.lang.Object> model, java.io.Writer writer)
TRenders the template with specified TemplateRule by its ID.java.lang.String
render(java.lang.String templateId, java.util.Map<java.lang.String,java.lang.Object> model)
Renders the template with specified TemplateRule by its ID.-
Methods inherited from class com.aspectran.core.component.AbstractComponent
destroy, getComponentName, initialize, isAvailable, isDestroyed, isDestroying, isInitialized
-
-
-
-
Constructor Detail
-
ContextualTemplateRenderer
public ContextualTemplateRenderer(ActivityContext context, TemplateRuleRegistry templateRuleRegistry)
Instantiates a new context template renderer.- Parameters:
context
- the activity contexttemplateRuleRegistry
- the template rule registry
-
-
Method Detail
-
render
public java.lang.String render(java.lang.String templateId)
Description copied from interface:TemplateRenderer
Renders the template with specified TemplateRule by its ID.- Specified by:
render
in interfaceTemplateRenderer
- Parameters:
templateId
- the template id- Returns:
- the output string of the template
-
render
public java.lang.String render(java.lang.String templateId, java.util.Map<java.lang.String,java.lang.Object> model)
Description copied from interface:TemplateRenderer
Renders the template with specified TemplateRule by its ID.- Specified by:
render
in interfaceTemplateRenderer
- Parameters:
templateId
- the template idmodel
- the holder of the variables visible from the template (name-value pairs)- Returns:
- the output string of the template
-
render
public java.lang.String render(TemplateRule templateRule, java.util.Map<java.lang.String,java.lang.Object> model)
Description copied from interface:TemplateRenderer
Renders the template with specified TemplateRule.- Specified by:
render
in interfaceTemplateRenderer
- Parameters:
templateRule
- the template rulemodel
- the holder of the variables visible from the template (name-value pairs)- Returns:
- the output string of the template
-
render
public void render(java.lang.String templateId, Activity activity)
Description copied from interface:TemplateRenderer
Renders the template with specified TemplateRule by its ID.- Specified by:
render
in interfaceTemplateRenderer
- Parameters:
templateId
- the template idactivity
- the activity
-
render
public void render(TemplateRule templateRule, Activity activity)
Description copied from interface:TemplateRenderer
Renders the template with specified TemplateRule.- Specified by:
render
in interfaceTemplateRenderer
- Parameters:
templateRule
- the template ruleactivity
- the activity
-
render
public void render(java.lang.String templateId, Activity activity, java.util.Map<java.lang.String,java.lang.Object> model)
Description copied from interface:TemplateRenderer
Renders the template with specified TemplateRule by its ID.- Specified by:
render
in interfaceTemplateRenderer
- Parameters:
templateId
- the template idactivity
- the activitymodel
- the holder of the variables visible from the template (name-value pairs)
-
render
public void render(java.lang.String templateId, Activity activity, java.io.Writer writer)
Description copied from interface:TemplateRenderer
Renders the template with specified TemplateRule by its ID.- Specified by:
render
in interfaceTemplateRenderer
- Parameters:
templateId
- the template idactivity
- the activitywriter
- theWriter
where the output of the template will go.Writer.close()
is not called.
-
render
public void render(TemplateRule templateRule, Activity activity, java.util.Map<java.lang.String,java.lang.Object> model)
Description copied from interface:TemplateRenderer
Renders the template with specified TemplateRule.- Specified by:
render
in interfaceTemplateRenderer
- Parameters:
templateRule
- the template ruleactivity
- the activitymodel
- the holder of the variables visible from the template (name-value pairs)
-
render
public void render(java.lang.String templateId, Activity activity, java.util.Map<java.lang.String,java.lang.Object> model, java.io.Writer writer)
Description copied from interface:TemplateRenderer
TRenders the template with specified TemplateRule by its ID. Writing the generated output to the suppliedWriter
.- Specified by:
render
in interfaceTemplateRenderer
- Parameters:
templateId
- the template idactivity
- the activitymodel
- the holder of the variables visible from the template (name-value pairs)writer
- theWriter
where the output of the template will go.Writer.close()
is not called.
-
render
public void render(TemplateRule templateRule, Activity activity, java.util.Map<java.lang.String,java.lang.Object> model, java.io.Writer writer)
Description copied from interface:TemplateRenderer
Renders the template with specified TemplateRule. Writing the generated output to the suppliedWriter
.- Specified by:
render
in interfaceTemplateRenderer
- Parameters:
templateRule
- the template ruleactivity
- the activitymodel
- the holder of the variables visible from the template (name-value pairs)writer
- theWriter
where the output of the template will go.Writer.close()
is not called.
-
doInitialize
protected void doInitialize() throws java.lang.Exception
- Specified by:
doInitialize
in classAbstractComponent
- Throws:
java.lang.Exception
-
doDestroy
protected void doDestroy()
- Specified by:
doDestroy
in classAbstractComponent
-
-