public class Template extends Resource
<template>
tag in a cartridge
descriptor file.Constructor and Description |
---|
Template()
The default constructor used by the
XmlObjectFactory to instantiate the template configuration. |
Modifier and Type | Method and Description |
---|---|
File |
getOutputLocation(String metafacadeName,
String packageName,
File directory,
String outputPattern)
Returns the fully qualified output file, this means:
the output pattern has been translated
the output dir name has been prepended
|
ModelElements |
getSupportedModeElements()
Tells us the model elements that are supported by this template (i.e.
|
boolean |
isGenerateEmptyFiles()
Tells us whether output files are generated by this template if the template produces empty output.
|
boolean |
isOutputOnEmptyElements()
Indicates that when there are no elements in the collection of elements (when
isOutputToSingleFile() is
true , whether or not the file should be output. |
boolean |
isOutputToSingleFile()
If output to single file is
true then all model elements found by the processor (i.e. |
void |
setGenerateEmptyFiles(boolean generateEmptyFiles)
Tells us whether output files should be generated if this template does not produce any output.
|
void |
setOutputOnEmptyElements(boolean outputOnEmptyElements)
Sets whether or not we should output a file when no elements exist in the collection of elements when
isOutputToSingleFile() returns true . |
void |
setOutputToSingleFile(boolean outputToSingleFile)
Sets whether or not we should aggregate elements and output to a single file.
|
void |
setSupportedModelElements(ModelElements supportedModelElements)
Sets the model elements that are supported by this template.
|
String |
toString() |
getCartridge, getOutlet, getOutputCondition, getOutputLocation, getOutputPattern, getPath, isLastModifiedCheck, isOverwrite, setCartridge, setLastModifiedCheck, setOutlet, setOutputCondition, setOutputPattern, setOverwrite, setPath
public Template()
XmlObjectFactory
to instantiate the template configuration.public void setGenerateEmptyFiles(boolean generateEmptyFiles)
generateEmptyFiles
- generate files for empty output yes/nopublic boolean isGenerateEmptyFiles()
public File getOutputLocation(String metafacadeName, String packageName, File directory, String outputPattern)
metafacadeName
- name of the metafacade.packageName
- name of the package from the model in which the class
is containeddirectory
- the directory as a File.outputPattern
- if defined, this overrides the value of Resource.getOutputPattern()
.public ModelElements getSupportedModeElements()
ModelElements
public void setSupportedModelElements(ModelElements supportedModelElements)
supportedModelElements
- the ModelElements instance.ModelElements
public boolean isOutputToSingleFile()
true
then all model elements found by the processor (i.e. all those
having matching modelElements) will aggregated and output to one single file.public void setOutputToSingleFile(boolean outputToSingleFile)
outputToSingleFile
- The outputToSingleFile to set.public boolean isOutputOnEmptyElements()
isOutputToSingleFile()
is
true
, whether or not the file should be output. Default is true
isOutputToSingleFile()
public void setOutputOnEmptyElements(boolean outputOnEmptyElements)
isOutputToSingleFile()
returns true
.outputOnEmptyElements
- the boolean flag.isOutputOnEmptyElements()
,
isOutputToSingleFile()
public String toString()
toString
in class Resource
Object.toString()
Copyright © 2003–2014 AndroMDA.org. All rights reserved.