Package ome.specification
Class OmeValidator
- java.lang.Object
-
- ome.specification.OmeValidator
-
public class OmeValidator extends Object
Provides methods to validate OME instance documents against- Since:
- Beta4.4
-
-
Field Summary
Fields Modifier and Type Field Description static String
JAXP_SCHEMA_LANGUAGE
Path the schema language.static String
JAXP_SCHEMA_SOURCE
The source.static String
W3C_XML_SCHEMA
W3C.
-
Constructor Summary
Constructors Constructor Description OmeValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isValidFile(File file, File schema)
Validate the specified fileboolean
isValidFile(File file, StreamSource[] schemaStreamArray)
Validate the specified fileDocument
parseFile(File file)
Parses the specified file and returns the document.Document
parseFile(File file, File schema)
Parses the specified file and returns the document.Document
parseFileWithStreamArray(File file, StreamSource[] schemaStreamArray)
Parses the specified file and returns the document.Document
parseFileWithStreamArrayToSdtErr(File file, StreamSource[] schemaStreamArray)
Parses the specified file and returns the document.void
validateFile(File file, File schema)
void
validateFile(File file, StreamSource[] schemaStreamArray)
Validate the specified file Any validation errors thrown as an exception.void
validateFileToStdError(File file, 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 String JAXP_SCHEMA_LANGUAGE
Path the schema language.- See Also:
- Constant Field Values
-
W3C_XML_SCHEMA
public static final String W3C_XML_SCHEMA
W3C.- See Also:
- Constant Field Values
-
JAXP_SCHEMA_SOURCE
public static final String JAXP_SCHEMA_SOURCE
The source.- See Also:
- Constant Field Values
-
-
Method Detail
-
isValidFile
public boolean isValidFile(File file, 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(File file, 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(File file, StreamSource[] schemaStreamArray) throws Exception
Validate 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:
Exception
- Thrown if an error occurred.
-
validateFileToStdError
public void validateFileToStdError(File file, StreamSource[] schemaStreamArray) throws Exception
Validate 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:
Exception
- Thrown if other (NON-VALIDATION) errors occurred.
-
parseFile
public Document parseFile(File file) throws Exception
Parses the specified file and returns the document.- Parameters:
file
- The file to parse.- Returns:
- Document
- Throws:
Exception
- Thrown if an error occurred.
-
parseFile
public Document parseFile(File file, File schema) throws Exception
Parses 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:
Exception
- Thrown if an error occurred.
-
parseFileWithStreamArray
public Document parseFileWithStreamArray(File file, StreamSource[] schemaStreamArray) throws Exception
Parses 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:
Exception
- Thrown if an error occurred.
-
parseFileWithStreamArrayToSdtErr
public Document parseFileWithStreamArrayToSdtErr(File file, StreamSource[] schemaStreamArray) throws Exception
Parses 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:
Exception
- Thrown if other (NON-VALIDATION) errors occurred.
-
-