Class PrideXmlValidator
java.lang.Object
com.compomics.util.pride.validation.PrideXmlValidator
PRIDE XML schema validation.
- Author:
- Phil Jones, Florian Reisinger, Harald Barsnes
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.iso_relax.verifier.VerifierFactoryThe verifier factory. -
Constructor Summary
ConstructorsConstructorDescriptionSet up a PrideXmlValidator using the default schema.PrideXmlValidator(URL schemaUrl) Set up a PrideXmlValidator using the provided schema. -
Method Summary
Modifier and TypeMethodDescriptionReturns the XML validation error object.Returns the errors formatted as s single string.voidSet the schema.booleanReturns true of the given PRIDE XML file is valid.
-
Field Details
-
VERIFIER_FACTORY
public static final org.iso_relax.verifier.VerifierFactory VERIFIER_FACTORYThe verifier factory.
-
-
Constructor Details
-
PrideXmlValidator
public PrideXmlValidator() throws IOException, org.iso_relax.verifier.VerifierConfigurationException, SAXExceptionSet up a PrideXmlValidator using the default schema.- Throws:
IOException- if an IOException occursorg.iso_relax.verifier.VerifierConfigurationException- if a VerifierConfigurationException occursSAXException- 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 occursorg.iso_relax.verifier.VerifierConfigurationException- if a VerifierConfigurationException occursSAXException- 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 occursorg.iso_relax.verifier.VerifierConfigurationException- if a VerifierConfigurationException occursSAXException- 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 occursIOException- if an IOException occursorg.iso_relax.verifier.VerifierConfigurationException- if a VerifierConfigurationException occursSAXException- if a SAXException occurs
-
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
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
-