Class ElementOutputter
Object
ElementOutputter
Outputs an element to the file-system.
- Author:
- Owen Feehan
-
Constructor Summary
ConstructorsConstructorDescriptionElementOutputter
(OutputterChecked outputter, ExecutionTimeRecorder executionTimeRecorder, Supplier<Optional<Logger>> logger) Creates a newElementOutputter
instance. -
Method Summary
Modifier and TypeMethodDescriptionderiveSubdirectory
(String subdirectoryName, boolean inheritOutputRulesAndRecording) Derives a bound-output-manager for a (possibly newly created) subdirectory of the existing manager.Records the execution time of particular operations.Which outputs are enabled or not enabled.The outputter for writing the element.General settings for outputting.A suggestion on what file-format to write.logger()
The associated logger.makeOutputPath
(Optional<String> suffixWithoutExtension, String extension, String fallbackSuffix) Creates a full absolute path that completes the part of the path present in the outputter with an additional suffix.
-
Constructor Details
-
ElementOutputter
public ElementOutputter(OutputterChecked outputter, ExecutionTimeRecorder executionTimeRecorder, Supplier<Optional<Logger>> logger) Creates a newElementOutputter
instance.- Parameters:
outputter
- The outputter for writing the element.executionTimeRecorder
- Records the execution time of particular operations.logger
- Supplies a logger for information messages when outputting.
-
-
Method Details
-
deriveSubdirectory
public OutputterChecked deriveSubdirectory(String subdirectoryName, boolean inheritOutputRulesAndRecording) Derives a bound-output-manager for a (possibly newly created) subdirectory of the existing manager.- Parameters:
subdirectoryName
- the subdirectory-name.inheritOutputRulesAndRecording
- if true, the output rules and recording are inherited from the parent directory. if false, they are not, and all outputs are allowed and are unrecorded.- Returns:
- a bound-output-manager for the subdirectory.
-
makeOutputPath
public Path makeOutputPath(Optional<String> suffixWithoutExtension, String extension, String fallbackSuffix) Creates a full absolute path that completes the part of the path present in the outputter with an additional suffix.- Parameters:
suffixWithoutExtension
- the suffix for the path (without any extension).extension
- the file extension (without a leading period).fallbackSuffix
- if neither aprefix
is defined nor asuffix
, then this provides a suffix to use so a file isn't only an extension.- Returns:
- a newly created absolute path, combining directory, prefix (if it exists), suffix and extension.
-
getSettings
General settings for outputting.- Returns:
- the settings.
-
getSuggestedFormatToWrite
A suggestion on what file-format to write.- Returns:
- a suggestion for the file-format, if known.
-
getOutputsEnabled
Which outputs are enabled or not enabled.- Returns:
- an interface that can be used to determine if an individual output is enabled.
-
logger
The associated logger.- Returns:
- the logger.
-
getOutputter
The outputter for writing the element. -
getExecutionTimeRecorder
Records the execution time of particular operations.
-