Class CvMappingValidator

  • All Implemented Interfaces:
    Validator<MzTab>

    public class CvMappingValidator
    extends Object
    implements Validator<MzTab>
    Validator implementation that uses a provided xml mapping file with rules for required, recommended and optional CV parameters to assert that an mzTab follows these rules. First, all preValidators are run, then, the cv parameter validation is executed, before finally, the postValidators are run. Each validator can add validation messages to the output.
    Author:
    nilshoffmann
    • Method Detail

      • of

        public static CvMappingValidator of​(File mappingFile,
                                            boolean errorIfTermNotInRule)
                                     throws JAXBException
        Create a new instance of CvMappingValidator. Uses a default instance of the CvParameterLookupService.
        Parameters:
        mappingFile - the mapping file to use
        errorIfTermNotInRule - raise an error if a term is not defined within an otherwise matching rule for the element
        Returns:
        a new CvMappingValidator instance
        Throws:
        JAXBException - if errors occur during unmarshalling of the mapping xml file.
      • of

        public static CvMappingValidator of​(File mappingFile,
                                            CvParameterLookupService client,
                                            boolean errorIfTermNotInRule)
                                     throws JAXBException
        Create a new instance of CvMappingValidator. Uses the provided CvParameterLookupService.
        Parameters:
        mappingFile - the mapping file to use
        client - the ontology lookup service client
        errorIfTermNotInRule - raise an error if a term is not defined within an otherwise matching rule for the element
        Returns:
        a new CvMappingValidator instance
        Throws:
        JAXBException - if errors occur during unmarshalling of the mapping xml file.
      • withPreValidator

        public CvMappingValidator withPreValidator​(Validator<MzTab> preValidator)
        Add the provided validator implementation to the list of validators that run first.
        Parameters:
        preValidator - the validator
        Returns:
        an instance of this object
      • withPostValidator

        public CvMappingValidator withPostValidator​(Validator<MzTab> postValidator)
        Add the provided validator implementation to the list of validators that run last.
        Parameters:
        postValidator - the validator
        Returns:
        an instance of this object
      • of

        public static CvMappingValidator of​(URL mappingFile,
                                            boolean errorIfTermNotInRule)
                                     throws JAXBException
        Create a new instance of CvMappingValidator. Uses a default instance of the CvParameterLookupService.
        Parameters:
        mappingFile - the mapping file URL to use
        errorIfTermNotInRule - raise an error if a term is not defined within an otherwise matching rule for the element
        Returns:
        a new CvMappingValidator instance
        Throws:
        JAXBException - if errors occur during unmarshalling of the mapping xml file.
      • of

        public static CvMappingValidator of​(URL mappingFile,
                                            CvParameterLookupService client,
                                            boolean errorIfTermNotInRule)
                                     throws JAXBException
        Create a new instance of CvMappingValidator. Uses the provided CvParameterLookupService.
        Parameters:
        mappingFile - the mapping file URL to use
        client - the ontology lookup service client
        errorIfTermNotInRule - raise an error if a term is not defined within an otherwise matching rule for the element
        Returns:
        a new CvMappingValidator instance
        Throws:
        JAXBException - if errors occur during unmarshalling of the mapping xml file.
      • of

        public static CvMappingValidator of​(CvMapping mapping,
                                            CvParameterLookupService client,
                                            boolean errorIfTermNotInRule)
        Create a new instance of CvMappingValidator. Uses the provided CvParameterLookupService.
        Parameters:
        mapping - the cv mapping to use
        client - the ontology lookup service client
        errorIfTermNotInRule - raise an error if a term is not defined within an otherwise matching rule for the element
        Returns:
        a new CvMappingValidator instance