Package ome.specification
Class OmeValidator
- java.lang.Object
-
- ome.specification.OmeValidator
-
public class OmeValidator extends java.lang.ObjectProvides methods to validate OME instance documents against- Since:
- Beta4.4
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringJAXP_SCHEMA_LANGUAGEPath the schema language.static java.lang.StringJAXP_SCHEMA_SOURCEThe source.static java.lang.StringW3C_XML_SCHEMAW3C.
-
Constructor Summary
Constructors Constructor Description OmeValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisValidFile(java.io.File file, java.io.File schema)Validate the specified filebooleanisValidFile(java.io.File file, javax.xml.transform.stream.StreamSource[] schemaStreamArray)Validate the specified fileorg.w3c.dom.DocumentparseFile(java.io.File file)Parses the specified file and returns the document.org.w3c.dom.DocumentparseFile(java.io.File file, java.io.File schema)Parses the specified file and returns the document.org.w3c.dom.DocumentparseFileWithStreamArray(java.io.File file, javax.xml.transform.stream.StreamSource[] schemaStreamArray)Parses the specified file and returns the document.org.w3c.dom.DocumentparseFileWithStreamArrayToSdtErr(java.io.File file, javax.xml.transform.stream.StreamSource[] schemaStreamArray)Parses the specified file and returns the document.voidvalidateFile(java.io.File file, java.io.File schema)voidvalidateFile(java.io.File file, javax.xml.transform.stream.StreamSource[] schemaStreamArray)Validate the specified file Any validation errors thrown as an exception.voidvalidateFileToStdError(java.io.File file, javax.xml.transform.stream.StreamSource[] schemaStreamArray)Validate the specified file Any validation errors are sent to StdErr, not thrown as an exception.
-
-
-
Field Detail
-
JAXP_SCHEMA_LANGUAGE
public static final java.lang.String JAXP_SCHEMA_LANGUAGE
Path the schema language.- See Also:
- Constant Field Values
-
W3C_XML_SCHEMA
public static final java.lang.String W3C_XML_SCHEMA
W3C.- See Also:
- Constant Field Values
-
JAXP_SCHEMA_SOURCE
public static final java.lang.String JAXP_SCHEMA_SOURCE
The source.- See Also:
- Constant Field Values
-
-
Method Detail
-
isValidFile
public boolean isValidFile(java.io.File file, java.io.File schema)Validate the specified file- Parameters:
file- The file to parse.schema- The schema used to validate the specified file.- Returns:
- true if no errors
-
isValidFile
public boolean isValidFile(java.io.File file, javax.xml.transform.stream.StreamSource[] schemaStreamArray)Validate the specified file- Parameters:
file- The file to parse.schemaStreamArray- The schema as array of stream sources used to validate the specified file.- Returns:
- true if no errors
-
validateFile
public void validateFile(java.io.File file, javax.xml.transform.stream.StreamSource[] schemaStreamArray) throws java.lang.ExceptionValidate the specified file Any validation errors thrown as an exception.- Parameters:
file- The file to parse.schemaStreamArray- The schema as array of stream sources used to validate the specified file.- Throws:
java.lang.Exception- Thrown if an error occurred.
-
validateFile
public void validateFile(java.io.File file, java.io.File schema) throws java.lang.Exception- Throws:
java.lang.Exception
-
validateFileToStdError
public void validateFileToStdError(java.io.File file, javax.xml.transform.stream.StreamSource[] schemaStreamArray) throws java.lang.ExceptionValidate the specified file Any validation errors are sent to StdErr, not thrown as an exception.- Parameters:
file- The file to parse.schemaStreamArray- The schema as array of stream sources used to validate the specified file.- Throws:
java.lang.Exception- Thrown if other (NON-VALIDATION) errors occurred.
-
parseFile
public org.w3c.dom.Document parseFile(java.io.File file) throws java.lang.ExceptionParses the specified file and returns the document.- Parameters:
file- The file to parse.- Returns:
- Document
- Throws:
java.lang.Exception- Thrown if an error occurred.
-
parseFile
public org.w3c.dom.Document parseFile(java.io.File file, java.io.File schema) throws java.lang.ExceptionParses the specified file and returns the document.- Parameters:
file- The file to parse.schema- The schema used to validate the specified file.- Returns:
- Document
- Throws:
java.lang.Exception- Thrown if an error occurred.
-
parseFileWithStreamArray
public org.w3c.dom.Document parseFileWithStreamArray(java.io.File file, javax.xml.transform.stream.StreamSource[] schemaStreamArray) throws java.lang.ExceptionParses the specified file and returns the document. Any validation errors are thrown as an exception.- Parameters:
file- The file to parse.schemaStreamArray- The schema as array of stream sources used to validate the specified file.- Returns:
- Document
- Throws:
java.lang.Exception- Thrown if an error occurred.
-
parseFileWithStreamArrayToSdtErr
public org.w3c.dom.Document parseFileWithStreamArrayToSdtErr(java.io.File file, javax.xml.transform.stream.StreamSource[] schemaStreamArray) throws java.lang.ExceptionParses the specified file and returns the document. Any validation errors are sent to StdErr, not thrown as an exception.- Parameters:
file- The file to parse.schemaStreamArray- The schema as array of stream sources used to validate the specified file.- Returns:
- Document
- Throws:
java.lang.Exception- Thrown if other (NON-VALIDATION) errors occurred.
-
-