org.javagen.agile.core.emitter
Class TemplateEmitter
java.lang.Object
org.javagen.agile.core.emitter.TemplateEmitter
- All Implemented Interfaces:
- ContextHolder, Emitter
public class TemplateEmitter
- extends Object
- implements ContextHolder, Emitter
This emitter utillizes a template engine to generate artifacts.
It has the following attributes:
1) a template instance
2) an Artifact instance
3) an optional local context
4) a reference to a TemplateGenerator
5) a optional emitCondition Predicate
- Author:
- Richard Easterling
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
templatePath
protected String templatePath
context
protected Map<String,Object> context
emitCondition
protected Predicate emitCondition
artifact
protected Artifact artifact
templateGenerator
protected TemplateGenerator templateGenerator
sourceDirectoryProperty
protected String sourceDirectoryProperty
relativeFilePathProperty
protected String relativeFilePathProperty
TemplateEmitter
public TemplateEmitter()
emit
public void emit(Context context)
- Description copied from interface:
Emitter
- invoke an emitter
- Specified by:
emit in interface Emitter
- Parameters:
context - - usually a composite of leaf, parent and template contexts.
getContext
public Map<String,Object> getContext()
- Specified by:
getContext in interface ContextHolder
- Returns:
- either a map instance populated with key-value pairs or null
setContext
public void setContext(Map<String,Object> context)
getTemplatePath
public String getTemplatePath()
setTemplatePath
public void setTemplatePath(String templatePath)
getEmitCondition
public Predicate getEmitCondition()
setEmitCondition
public void setEmitCondition(Predicate predicate)
putContext
public void putContext(String key,
Object value)
getArtifact
public Artifact getArtifact()
- Description copied from interface:
Emitter
- The unique artifact instance that provides the file name and path to this emitter.
WARNING: Artifact instances should not be shared between different emitters.
- Specified by:
getArtifact in interface Emitter
- Returns:
- the artifact associated with this emitter
setArtifact
public void setArtifact(Artifact artifact)
getTemplateGenerator
public TemplateGenerator getTemplateGenerator()
setTemplateGenerator
public void setTemplateGenerator(TemplateGenerator templateGenerator)
getRelativeFilePathProperty
public String getRelativeFilePathProperty()
setRelativeFilePathProperty
public void setRelativeFilePathProperty(String relativeFilePathProperty)
getSourceDirectoryProperty
public String getSourceDirectoryProperty()
setSourceDirectoryProperty
public void setSourceDirectoryProperty(String sourceDirectoryProperty)
Copyright 2006-2006-2007 Outsource Cafe Inc.. All Rights Reserved.