Package org.nuiton.eugene.writer
Interface ChainedFileWriter
-
- All Known Subinterfaces:
ChainedFileWriterToMemoryModel
- All Known Implementing Classes:
AbstractChainedFileWriter
public interface ChainedFileWriterContract to generate files from any incoming sources (zargo, xmi, ...) to any other ones. User: chemit Date: 27 nov. 2009 Time: 11:20:39- Since:
- 2.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanacceptInclude(String include)Test in a entry can be treated by this writer.booleanacceptModel(String modelType)Test if a type of model can be treated by this writer.voidaddEntry(ChainedFileWriterEntry entry)Add an entry to treate.voidclear()Clear all internal statesvoidgenerate(ChainedFileWriterConfiguration configuration, ChainedFileWriterData data)Launch the generation for this writer with all pre-computed data to treate and resources to copy.Map<String,String>getAuthorizedPropertyDescriptions()String[]getAuthorizedPropertyNames()StringgetDefaultIncludes()StringgetDefaultInputDirectory()StringgetDefaultOutputDirectory()StringgetDefaultTestInputDirectory()StringgetDefaultTestOutputDirectory()List<ChainedFileWriterEntry>getEntries()FilegetExtractDirectory(File outputBasedir, boolean testPhase)Obtain the real directory where to extract files (when using resources from class-path).StringgetInputProtocol()StringgetInputProtocol(String modelType)Obtain the input protocol of this writer given the passedmodelType.FilegetOutputDirectory(File outputBasedir, boolean testPhase)Obtain the real directory where to write files.StringgetOutputProtocol(String modelType)Obtain the output protocol of this writer given the passedmodelType.<T> TgetProperty(String key, Class<T> type)Obtain a writer extra property.WriterReportgetWriterReport()voidsetWriterReport(WriterReport writerReport)
-
-
-
Method Detail
-
getInputProtocol
String getInputProtocol()
- Returns:
- the accepted incoming protocol
-
getInputProtocol
String getInputProtocol(String modelType)
Obtain the input protocol of this writer given the passedmodelType.- Parameters:
modelType- the type of model used- Returns:
- the input protocol or
nullif this writer does not accept the type of model
-
getOutputProtocol
String getOutputProtocol(String modelType)
Obtain the output protocol of this writer given the passedmodelType.- Parameters:
modelType- the type of model used- Returns:
- the output protocol or
nullif should not be chained
-
acceptModel
boolean acceptModel(String modelType)
Test if a type of model can be treated by this writer.- Parameters:
modelType- model type to test- Returns:
trueif this writer accept the given type of model,falseotherwise.
-
acceptInclude
boolean acceptInclude(String include)
Test in a entry can be treated by this writer.- Parameters:
include- the include to test- Returns:
trueif the writer accept the entry,falseotherwise.
-
getDefaultIncludes
String getDefaultIncludes()
- Returns:
- the default includes files to be treated by the writer (can be an ant-like expression)
-
getDefaultInputDirectory
String getDefaultInputDirectory()
- Returns:
- the defalt relative path where to pick files to treate.
-
getDefaultTestInputDirectory
String getDefaultTestInputDirectory()
- Returns:
- the defalt relative path where to pick files to treate on a test phase.
-
getDefaultOutputDirectory
String getDefaultOutputDirectory()
- Returns:
- the default relative path to add to output basedir
-
getDefaultTestOutputDirectory
String getDefaultTestOutputDirectory()
- Returns:
- the default relative path to add to output basedir on a test phase.
-
getOutputDirectory
File getOutputDirectory(File outputBasedir, boolean testPhase)
Obtain the real directory where to write files. //FIXME-TC20091126 make this configurable (via the properties)- Parameters:
outputBasedir- the output base directorytestPhase-trueif writer is used in a test phase- Returns:
- the real output directory where to generate for this particular writer
-
getExtractDirectory
File getExtractDirectory(File outputBasedir, boolean testPhase)
Obtain the real directory where to extract files (when using resources from class-path).- Parameters:
outputBasedir- the output base directorytestPhase-trueif writer is used in a test phase- Returns:
- the real output directory where to extract for this particular writer
- Since:
- 2.1.3
-
generate
void generate(ChainedFileWriterConfiguration configuration, ChainedFileWriterData data) throws IOException
Launch the generation for this writer with all pre-computed data to treate and resources to copy.- Parameters:
configuration- the share configuration of all writers.data- data to treate (files to react + resources to copy)- Throws:
IOException- if any io pb.- Since:
- 2.1.3
-
clear
void clear()
Clear all internal states
-
addEntry
void addEntry(ChainedFileWriterEntry entry)
Add an entry to treate.- Parameters:
entry- the entry to add to writer
-
getAuthorizedPropertyNames
String[] getAuthorizedPropertyNames()
- Returns:
- the array of properties names authorized for the chained writer.
-
getAuthorizedPropertyDescriptions
Map<String,String> getAuthorizedPropertyDescriptions()
- Returns:
- the dictionnary of authorized property descriptions (keys are property names and values are descriptions).
-
getProperty
<T> T getProperty(String key, Class<T> type)
Obtain a writer extra property.- Type Parameters:
T- the type of property- Parameters:
key- the key of required propertytype- the type of property- Returns:
- the property found or
nullif not found.
-
getEntries
List<ChainedFileWriterEntry> getEntries()
- Returns:
- the list of all entries registered
-
getWriterReport
WriterReport getWriterReport()
- Returns:
- the writer report (to save generated file to later report)
-
setWriterReport
void setWriterReport(WriterReport writerReport)
-
-