Class RecordingWriters

Object
RecordingWriters

public class RecordingWriters extends Object
Two writers that record any output-names that are passed as arguments.

The two writers are:

Author:
Owen Feehan
  • Constructor Details

    • RecordingWriters

      public RecordingWriters(ElementOutputter outputter, Optional<WriterExecuteBeforeEveryOperation> preop, Optional<MultiLevelRecordedOutputs> recordedOutputs)
      Creates the two writers.
      Parameters:
      outputter - the output-manager with which the writers are associated.
      preop - an operation executed before creation of every directory, if defined.
      recordedOutputs - all output-names that are passed as arguments to both writers are recorded here.
  • Method Details

    • multiplex

      public Writer multiplex(boolean selectSelective)
      Multiplexes between the selective and permissive writers based on a flag.
      Parameters:
      selectSelective - if true, selective is returned, otherwise permissive.
      Returns:
      the chosen writer
    • secondLevel

      public Writer secondLevel(String outputNameFirstLevel)
      A writer that performs a second-level check on which outputs occur, but writes to the top-level directory.
      Parameters:
      outputNameFirstLevel - the first (top-most) level of an output name, with which writing any second-level outputs is associated.
      Returns:
      a newly created writer checking on particular second-level output names.
    • permissive

      public Writer permissive()
      A writer that allows all output-names, and records the written output-names.
      Returns:
      the writer.
    • selective

      public Writer selective()
      A writer that allows only certain selected output-names, and records the written output-names.
      Returns:
      the writer.
    • recordedOutputs

      public Optional<MultiLevelRecordedOutputs> recordedOutputs()
      If defined, all output-names that are passed as arguments to both writers are recorded here.