com.compomics.util.pride.validation
Class PrideXmlValidator

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

public class PrideXmlValidator
extends Object

PRIDE XML schema validation.

Author:
Phil Jones, Florian Reisinger, Harald Barsnes

Field Summary
static org.iso_relax.verifier.VerifierFactory VERIFIER_FACTORY
          The verifier factory.
 
Constructor Summary
PrideXmlValidator()
          Set up a PrideXmlValidator using the default schema.
PrideXmlValidator(URL schemaUrl)
          Set up a PrideXmlValidator using the provided schema.
 
Method Summary
 XMLValidationErrorHandler getErrors()
          Returns the XML validation error object.
 String getErrorsAsString()
          Returns the errors formatted as s single string.
 void setSchema(URL schemaUrl)
          Set the schema.
 boolean validate(File prideXmlFile)
          Returns true of the given PRIDE XML file is valid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERIFIER_FACTORY

public static final org.iso_relax.verifier.VerifierFactory VERIFIER_FACTORY
The verifier factory.

Constructor Detail

PrideXmlValidator

public PrideXmlValidator()
                  throws IOException,
                         org.iso_relax.verifier.VerifierConfigurationException,
                         SAXException
Set up a PrideXmlValidator using the default schema.

Throws:
IOException
org.iso_relax.verifier.VerifierConfigurationException
SAXException

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
org.iso_relax.verifier.VerifierConfigurationException
SAXException
Method Detail

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
org.iso_relax.verifier.VerifierConfigurationException
SAXException

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
IOException
org.iso_relax.verifier.VerifierConfigurationException
SAXException

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


Copyright © 2013. All Rights Reserved.