Class XStreamGenerator<T>
Object
SingleFileTypeGenerator<T,T>
OneStageGenerator<T>
SerializedGenerator<T>
XStreamGenerator<T>
- Type Parameters:
T
- iteration-type
- All Implemented Interfaces:
Generator<T>
,TransformingGenerator<T,
,T> ElementWriter<T>
A generator that serialized using the XStream library
and format.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String
extensionSuffix
(OutputWriteSettings outputWriteSettings) Appended to the standard "serialized" extension, to form the complete extension.void
writeToFile
(T element, OutputWriteSettings settings, Path filePath) Write generated content for {code element} to the filefilePath
.Methods inherited from class org.anchoranalysis.io.generator.serialized.SerializedGenerator
selectFileExtension
Methods inherited from class org.anchoranalysis.io.generator.OneStageGenerator
transform
Methods inherited from class org.anchoranalysis.io.generator.SingleFileTypeGenerator
write, writeWithIndex
-
Constructor Details
-
XStreamGenerator
public XStreamGenerator()
-
-
Method Details
-
writeToFile
public void writeToFile(T element, OutputWriteSettings settings, Path filePath) throws OutputWriteFailedException Description copied from class:SingleFileTypeGenerator
Write 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:
writeToFile
in classSingleFileTypeGenerator<T,
T> - 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.
-
extensionSuffix
Description copied from class:SerializedGenerator
Appended to the standard "serialized" extension, to form the complete extension.- Specified by:
extensionSuffix
in classSerializedGenerator<T>
- Parameters:
outputWriteSettings
- the associatedOutputWriteSettings
.- Returns:
- the suffix for the extension including any leading period, when appropriate. This may be the empty string if no suffix exists.
-