Class AbstractChainedFileWriter

    • Constructor Detail

      • AbstractChainedFileWriter

        protected AbstractChainedFileWriter​(String... propertyNameAndDescriptions)
    • Method Detail

      • generate

        protected abstract void generate​(ChainedFileWriterConfiguration configuration,
                                         File outputDir,
                                         Map<File,​List<File>> filesByRoot,
                                         Map<File,​List<File>> resourcesByFile)
                                  throws IOException
        Generates for all given files (filesByRoot and then copy resources given for his file reacted in the resourcesByFile dictionnary.
        Parameters:
        configuration - the shared configuration for all writers
        outputDir - where to generate files
        filesByRoot - all files to treate
        resourcesByFile - resources associated to files to treate
        Throws:
        IOException - for any IO pb.
        Since:
        2.1.3
      • getProperty

        public <T> T getProperty​(String key,
                                 Class<T> type)
        Description copied from interface: ChainedFileWriter
        Obtain a writer extra property.
        Specified by:
        getProperty in interface ChainedFileWriter
        Type Parameters:
        T - the type of property
        Parameters:
        key - the key of required property
        type - the type of property
        Returns:
        the property found or null if not found.
      • getInputProtocol

        public String getInputProtocol​(String modelType)
        Description copied from interface: ChainedFileWriter
        Obtain the input protocol of this writer given the passed modelType.
        Specified by:
        getInputProtocol in interface ChainedFileWriter
        Parameters:
        modelType - the type of model used
        Returns:
        the input protocol or null if this writer does not accept the type of model
      • getOutputDirectory

        public File getOutputDirectory​(File outputBasedir,
                                       boolean testPhase)
        Description copied from interface: ChainedFileWriter
        Obtain the real directory where to write files. //FIXME-TC20091126 make this configurable (via the properties)
        Specified by:
        getOutputDirectory in interface ChainedFileWriter
        Parameters:
        outputBasedir - the output base directory
        testPhase - true if writer is used in a test phase
        Returns:
        the real output directory where to generate for this particular writer
      • getExtractDirectory

        public File getExtractDirectory​(File outputBasedir,
                                        boolean testPhase)
        Description copied from interface: ChainedFileWriter
        Obtain the real directory where to extract files (when using resources from class-path).
        Specified by:
        getExtractDirectory in interface ChainedFileWriter
        Parameters:
        outputBasedir - the output base directory
        testPhase - true if writer is used in a test phase
        Returns:
        the real output directory where to extract for this particular writer
      • initWriter

        protected void initWriter​(ChainedFileWriterConfiguration configuration)
        Initialize the writer before the generation.
        Parameters:
        configuration - the configuration to use for int