org.javagen.agile.core.emitter
Interface Emitter

All Superinterfaces:
ContextHolder
All Known Implementing Classes:
TemplateEmitter

public interface Emitter
extends ContextHolder

An emitter is anything that emits code or data files.

When the emit method is called by the framework, it is passed a context containing properties needed to generate an artifact. The emitter will typically bind the context to an associated template.

The artifact property contains the location and name of the resulting generated file. Artifacts are typically passed the same context handed to the template which allows the file name and path to be determined by the same properties that the template uses.

An emitter can also hold its own local context which can be used to customize it's behavior.

Author:
Richard Easterling

Method Summary
 void emit(Context context)
          invoke an emitter
 Artifact getArtifact()
          The unique artifact instance that provides the file name and path to this emitter.
 
Methods inherited from interface org.javagen.agile.core.context.ContextHolder
getContext
 

Method Detail

emit

void emit(Context context)
invoke an emitter

Parameters:
context - - usually a composite of leaf, parent and template contexts.

getArtifact

Artifact getArtifact()
The unique artifact instance that provides the file name and path to this emitter.

WARNING: Artifact instances should not be shared between different emitters.

Returns:
the artifact associated with this emitter


Copyright 2006-2006-2007 Outsource Cafe Inc.. All Rights Reserved.