Class DictionaryGenerator
- All Implemented Interfaces:
Generator<Dictionary>,TransformingGenerator<Dictionary,,Dictionary> ElementWriter<Dictionary>
A generator that writes the contents of a
Dictionary to the file-system as XML.- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionselectFileExtension(OutputWriteSettings settings, Optional<Logger> logger) Selects the file/extension to be used for outputting the file.voidwriteToFile(Dictionary element, OutputWriteSettings settings, Path filePath) Write generated content for {code element} to the filefilePath.Methods inherited from class org.anchoranalysis.io.generator.OneStageGenerator
transformMethods inherited from class org.anchoranalysis.io.generator.SingleFileTypeGenerator
write, writeWithIndex
-
Constructor Details
-
DictionaryGenerator
public DictionaryGenerator()
-
-
Method Details
-
writeToFile
public void writeToFile(Dictionary element, OutputWriteSettings settings, Path filePath) throws OutputWriteFailedException Description copied from class:SingleFileTypeGeneratorWrite generated content for {code element} to the filefilePath.This function deliberately leaves ambiguity over what occurs if a file already exists at
filePath.- Specified by:
writeToFilein classSingleFileTypeGenerator<Dictionary,Dictionary> - Parameters:
element- element to be assigned and then transformed.settings- settings for outputting.filePath- the path to the file to write to.- Throws:
OutputWriteFailedException- if the content cannot be written successfully.
-
selectFileExtension
Description copied from class:SingleFileTypeGeneratorSelects the file/extension to be used for outputting the file.- Specified by:
selectFileExtensionin classSingleFileTypeGenerator<Dictionary,Dictionary> - Parameters:
settings- settings for outputting.logger- logger for warning for information messages when outputting.- Returns:
- the file extension (without leading period) to be used for outputting.
-