public class Cartridge extends BasePlugin
META-INF/andromda/cartridge.xml
files discovered on the classpath.Constructor and Description |
---|
Cartridge() |
Modifier and Type | Method and Description |
---|---|
void |
addCondition(String name,
String value)
Adds the outputCondition given the
name and value
to the outputConditions map. |
void |
addResource(Resource resource)
Adds a resource to the list of defined resources.
|
void |
addTemplatePostProcessor(TemplateObject postProcessor)
Adds new postProcessor to the cartridge
|
Map<String,String> |
getConditions()
Gets the current outputConditions defined within this cartridge
|
List<Resource> |
getResources()
Returns the list of templates configured in this cartridge.
|
Collection<PostProcessor> |
getTemplatePostProcessor()
Gets the current postProcessors defined within this cartridge
|
protected void |
populateTemplateContext(Map<String,Object> templateContext)
Populates the
templateContext with the properties and template objects defined in the
plugin 's descriptor. |
void |
processModelElements(MetafacadeFactory factory)
Processes all model elements with relevant stereotypes by retrieving the model elements from the model facade
contained within the context.
|
protected void |
processResource(Resource resource)
Processes the given
resource |
protected void |
processTemplate(MetafacadeFactory factory,
Template template)
Processes the given
template . |
protected void |
processTemplateWithMetafacades(MetafacadeFactory factory,
Template template)
Processes all
modelElements for this template. |
protected void |
processTemplateWithoutMetafacades(Template template)
Processes the
template without metafacades. |
void |
shutdown()
Override to provide cartridge specific shutdown (
|
String |
toString() |
addMacrolibrary, addPropertyReference, addTemplateObject, getContents, getLogger, getMergeLocation, getPropertyReferences, getTemplateEngine, getTemplateObjects, initialize, setTemplateEngineClass
getNamespace, getResource, setNamespace, setResource
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getNamespace, getResource, setNamespace, setResource
public Cartridge()
public void processModelElements(MetafacadeFactory factory)
factory
- the metafacade factory (which is used to manage the lifecycle of metafacades).protected void processTemplate(MetafacadeFactory factory, Template template)
template
.factory
- the metafacade factory instance.template
- the Template instance to process.protected void processTemplateWithMetafacades(MetafacadeFactory factory, Template template)
modelElements
for this template.factory
- the metafacade factorytemplate
- the template to processprotected void processTemplateWithoutMetafacades(Template template)
template
without metafacades. This is useful if you need to generate something that
is part of your cartridge, however you only need to use a property passed in from a namespace or a template
object defined in your cartridge descriptor.template
- the template to process.protected void processResource(Resource resource)
resource
resource
- the resource to process.public List<Resource> getResources()
public void addResource(Resource resource)
resource
- the new resource to addprotected void populateTemplateContext(Map<String,Object> templateContext)
templateContext
with the properties and template objects defined in the
plugin
's descriptor. If the templateContext
is null, a new Map instance will be created
before populating the context.populateTemplateContext
in class BasePlugin
templateContext
- the context of the template to populate.public void addCondition(String name, String value)
name
and value
to the outputConditions map.name
- the name of the outputCondition.value
- the value of the outputCondition.public Map<String,String> getConditions()
public Collection<PostProcessor> getTemplatePostProcessor()
public void addTemplatePostProcessor(TemplateObject postProcessor)
postProcessor
- new postProcessorpublic void shutdown()
shutdown
in interface Plugin
shutdown
in class BasePlugin
Plugin.shutdown()
public String toString()
toString
in class BasePlugin
Object.toString()
Copyright © 2003–2014 AndroMDA.org. All rights reserved.