Package org.nuiton.eugene.writer
Interface ChainedFileWriter
-
- All Known Subinterfaces:
ChainedFileWriterToMemoryModel
- All Known Implementing Classes:
AbstractChainedFileWriter
public interface ChainedFileWriter
Contract 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 boolean
acceptInclude(String include)
Test in a entry can be treated by this writer.boolean
acceptModel(String modelType)
Test if a type of model can be treated by this writer.void
addEntry(ChainedFileWriterEntry entry)
Add an entry to treate.void
clear()
Clear all internal statesvoid
generate(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()
String
getDefaultIncludes()
String
getDefaultInputDirectory()
String
getDefaultOutputDirectory()
String
getDefaultTestInputDirectory()
String
getDefaultTestOutputDirectory()
List<ChainedFileWriterEntry>
getEntries()
File
getExtractDirectory(File outputBasedir, boolean testPhase)
Obtain the real directory where to extract files (when using resources from class-path).String
getInputProtocol()
String
getInputProtocol(String modelType)
Obtain the input protocol of this writer given the passedmodelType
.File
getOutputDirectory(File outputBasedir, boolean testPhase)
Obtain the real directory where to write files.String
getOutputProtocol(String modelType)
Obtain the output protocol of this writer given the passedmodelType
.<T> T
getProperty(String key, Class<T> type)
Obtain a writer extra property.WriterReport
getWriterReport()
void
setWriterReport(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
null
if 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
null
if 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:
true
if this writer accept the given type of model,false
otherwise.
-
acceptInclude
boolean acceptInclude(String include)
Test in a entry can be treated by this writer.- Parameters:
include
- the include to test- Returns:
true
if the writer accept the entry,false
otherwise.
-
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
-true
if 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
-true
if 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
null
if 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)
-
-