Class MzTabValidatingWriter

  • All Implemented Interfaces:
    MzTabWriter<List<ValidationMessage>>

    public class MzTabValidatingWriter
    extends Object
    implements MzTabWriter<List<ValidationMessage>>

    MzTabValidatingWriter allows to write MzTab objects after validation with a custom or default validator. Use this if you want to make sure that your fail satisfies the structural and minimal reporting constraints of mzTab. Otherwise, use the MzTabNonValidatingWriter.

    To create a validating writer using the default checks also applied by the parser, call:

    MzTabWriter validatingWriter = new MzTabValidatingWriter.Default();

    Otherwise, to create a non-validating instance, call:

    MzTabWriter plainWriter = new MzTabNonValidatingWriter();
    Author:
    nilshoffmann
    See Also:
    MzTabValidatingWriter, MzTabValidator
    • Constructor Detail

      • MzTabValidatingWriter

        public MzTabValidatingWriter()
        Uses default structural validation based on writing and parsing the written file with the default parsing checks. The output file will not be written, if any validation failures occur.
      • MzTabValidatingWriter

        public MzTabValidatingWriter​(Validator<MzTab> validator,
                                     boolean skipWriteOnValidationFailure)
        Uses the provided validator and default writer configuration. The output file will not be written, if any validation failures occur.
        Parameters:
        validator - the validator instance.
        skipWriteOnValidationFailure - if true, skips writing of the file if validation fails.
      • MzTabValidatingWriter

        public MzTabValidatingWriter​(Validator<MzTab> validator,
                                     MzTabWriterDefaults writerDefaults,
                                     boolean skipWriteOnValidationFailure)
        Uses the provided validator and writerDefaults.
        Parameters:
        validator - the validator instance.
        writerDefaults - the default writer settings.
        skipWriteOnValidationFailure - if true, skips writing of the file if validation fails.