Class AbstractGeneratorTemplateRenderer<R,S>
- java.lang.Object
-
- science.aist.gtf.transformation.renderer.AbstractConditionalTransformationRenderer<R,GeneratorTemplate,S>
-
- science.aist.gtf.template.impl.renderer.AbstractGeneratorTemplateRenderer<R,S>
-
- All Implemented Interfaces:
GeneratorTemplateRenderer<R,S>
,TransformationRender<Optional<R>,R,GeneratorTemplate,S>
- Direct Known Subclasses:
DeleteFileRenderer
,DirectoryCopyRenderer
,DirectoryCreateRenderer
,FileOperationRenderer
,GeneratorTemplateRendererImpl
,InstantiateTemplateRenderer
,ShellCommandRenderer
public abstract class AbstractGeneratorTemplateRenderer<R,S> extends AbstractConditionalTransformationRenderer<R,GeneratorTemplate,S> implements GeneratorTemplateRenderer<R,S>
Abstract generator template renderer
- Since:
- 1.0
- Author:
- Andreas Pointner, Andreas Schuler
-
-
Constructor Summary
Constructors Constructor Description AbstractGeneratorTemplateRenderer(RendererCondition<S> rendererCondition)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description R
createElement()
Creates a new element same as the one which is renderedR
executeTask(R taskResult, GeneratorTemplate container, S task)
Executes a given taskR
mapProperties(R r, GeneratorTemplate generatorTemplate, S currentElement)
maps propertiesOptional<R>
renderElement(GeneratorTemplate container, S currentElement)
Renders a given element
-
-
-
Constructor Detail
-
AbstractGeneratorTemplateRenderer
public AbstractGeneratorTemplateRenderer(RendererCondition<S> rendererCondition)
-
-
Method Detail
-
executeTask
public R executeTask(R taskResult, GeneratorTemplate container, S task)
Description copied from interface:GeneratorTemplateRenderer
Executes a given task- Specified by:
executeTask
in interfaceGeneratorTemplateRenderer<R,S>
- Parameters:
taskResult
- the task resultcontainer
- the generator templatetask
- the task that should be executed- Returns:
- the result of the task
-
createElement
public R createElement()
Description copied from interface:TransformationRender
Creates a new element same as the one which is rendered- Specified by:
createElement
in interfaceTransformationRender<Optional<R>,R,GeneratorTemplate,S>
- Returns:
- the new element
-
mapProperties
public R mapProperties(R r, GeneratorTemplate generatorTemplate, S currentElement)
Description copied from interface:TransformationRender
maps properties- Specified by:
mapProperties
in interfaceTransformationRender<Optional<R>,R,GeneratorTemplate,S>
- Parameters:
r
- the element, same as which is renderedgeneratorTemplate
- the containercurrentElement
- the current element- Returns:
- the rendered element
-
renderElement
public Optional<R> renderElement(GeneratorTemplate container, S currentElement)
Description copied from interface:TransformationRender
Renders a given element- Specified by:
renderElement
in interfaceTransformationRender<Optional<R>,R,GeneratorTemplate,S>
- Overrides:
renderElement
in classAbstractConditionalTransformationRenderer<R,GeneratorTemplate,S>
- Parameters:
container
- the containercurrentElement
- the current element- Returns:
- the rendered element
-
-