Class PrideXmlValidator

java.lang.Object
com.compomics.util.pride.validation.PrideXmlValidator

public class PrideXmlValidator
extends Object
PRIDE XML schema validation.
Author:
Phil Jones, Florian Reisinger, Harald Barsnes
  • Field Details

    • VERIFIER_FACTORY

      public static final org.iso_relax.verifier.VerifierFactory VERIFIER_FACTORY
      The verifier factory.
  • Constructor Details

    • PrideXmlValidator

      public PrideXmlValidator() throws IOException, org.iso_relax.verifier.VerifierConfigurationException, SAXException
      Set up a PrideXmlValidator using the default schema.
      Throws:
      IOException - if an IOException occurs
      org.iso_relax.verifier.VerifierConfigurationException - if a VerifierConfigurationException occurs
      SAXException - if a SAXException occurs
    • PrideXmlValidator

      public PrideXmlValidator​(URL schemaUrl) throws IOException, org.iso_relax.verifier.VerifierConfigurationException, SAXException
      Set up a PrideXmlValidator using the provided schema.
      Parameters:
      schemaUrl - the URL to the schema
      Throws:
      IOException - if an IOException occurs
      org.iso_relax.verifier.VerifierConfigurationException - if a VerifierConfigurationException occurs
      SAXException - if a SAXException occurs
  • Method Details

    • setSchema

      public void setSchema​(URL schemaUrl) throws IOException, org.iso_relax.verifier.VerifierConfigurationException, SAXException
      Set the schema.
      Parameters:
      schemaUrl - the schema to set
      Throws:
      IOException - if an IOException occurs
      org.iso_relax.verifier.VerifierConfigurationException - if a VerifierConfigurationException occurs
      SAXException - if a SAXException occurs
    • validate

      public boolean validate​(File prideXmlFile) throws FileNotFoundException, IOException, org.iso_relax.verifier.VerifierConfigurationException, SAXException
      Returns true of the given PRIDE XML file is valid.
      Parameters:
      prideXmlFile - the PRIDE XML file to test
      Returns:
      true of the given PRIDE XML file is valid
      Throws:
      FileNotFoundException - if a FileNotFoundException occurs
      IOException - if an IOException occurs
      org.iso_relax.verifier.VerifierConfigurationException - if a VerifierConfigurationException occurs
      SAXException - if a SAXException occurs
    • getErrorsAsString

      public String getErrorsAsString()
      Returns the errors formatted as s single string. Returns null if the file has not been validated.
      Returns:
      the errors formatted as s single string, null if the file has not yet been validated
    • getErrors

      public XMLValidationErrorHandler getErrors()
      Returns the XML validation error object. Returns null if the file has not been validated.
      Returns:
      the XML validation error object, null if the file has not yet been validated