Package com.altova.raptorxml
Interface XMLValidator
public interface XMLValidator
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumstatic enumstatic enumstatic enumstatic enumstatic enumstatic enumstatic enum -
Method Summary
Modifier and TypeMethodDescriptionbooleanextractAvroSchema(String outputPath) Extract a AVRO schema document from a binary fileGet the last error message from the engine.booleanisValid()booleanValidates the input XML data against its schema.booleanbooleanChecks the input XML data for well-formedness.voidDeprecated.voidAssessment modevoidsetAvroSchemaFileName(String filePath) Set file name for external Avro schema.voidsetAvroSchemaFromText(String schemaText) Set text value for Avro schema.voidsetDTDFileName(String filePath) Set file name for external DTD.voidsetDTDFromText(String dtdText) Set text value for external DTD.voidsetEnableNamespaces(boolean enable) Enable/disable namespace processingvoidsetInputFileCollection(Collection<String> fileCollection) Set a collection of XML files as input data.voidsetInputFileName(String filePath) Set the file name for the input XML data.voidsetInputFromText(String inputText) Set the text value for the input XML data.voidsetInputTextCollection(Collection<String> stringCollection) Set a collection of strings as inputvoidsetInputXMLFileCollection(Collection<String> fileCollection) Deprecated.voidsetInputXMLFileName(String filePath) Deprecated.usesetInputFileName(java.lang.String)instead.voidsetInputXMLFromText(String inputText) Deprecated.usesetInputFromText(java.lang.String)instead.voidsetInputXMLTextCollection(Collection<String> stringCollection) Deprecated.voidsetJson5(boolean json5) Enable/disable json5 support.voidsetJsonC(boolean jsonC) Enables support for comments in JSON.voidsetJsonLines(boolean jsonLines) Enables support for JSON Lines (that is, one JSON value per line).voidsetJSONSchemaFileName(String filePath) Set file name for external JSON schema.voidsetJSONSchemaFromText(String schemaText) Set text value for JSON schema.voidsetJsonSchemaVersion(String strJsonSchemaVersion) Specifies which version of the JSON Schema specification draft version to use.voidsetParallelAssessment(boolean support) Enable/disable parallel schema validity assessment.voidsetPythonScriptFile(String file) Python script to be executed after a successful validation.voidsetSchemaFileCollection(Collection<String> fileCollection) Set a collection of files as external schemasvoidsetSchemaFileName(String filePath) Set file name for external Schema.voidsetSchemaFromText(String schemaText) Set text value for external Schema.voidConfigure the usage of the xsi:schemaLocation hintsvoidConfigure the usage of the xsi:schemaLocation hintsvoidConfigure the usage of the xsi:schemaLocation hintsvoidsetSchemaTextCollection(Collection<String> stringCollection) Set a collection of strings as external schemasvoidsetStreaming(boolean support) Enable/disable streaming.voidsetXincludeSupport(boolean support) Enable/disable xinclude supportvoidProcessing modevoidsetXSDVersion(XMLValidator.ENUMXSDVersion version) XSD specification version
-
Method Details
-
isValid
Validates the input XML data against its schema.- Returns:
- true on success, false on failure. In case of an error, use function
getLastErrorMessage()to get additional information. - Throws:
RaptorXMLException
-
isValid
- Throws:
RaptorXMLException
-
isWellFormed
Checks the input XML data for well-formedness.- Returns:
- true on success, false on failure. In case of an error, use function
getLastErrorMessageto get additional information. - Throws:
RaptorXMLException
-
isWellFormed
- Throws:
RaptorXMLException
-
extractAvroSchema
Extract a AVRO schema document from a binary file- Parameters:
outputDir- an absolute URL to which the output should be saved.- Returns:
- true on success, false on failure. In case of an error, use function
getLastErrorMessageto get additional information. - Throws:
RaptorXMLException
-
setInputFileName
Set the file name for the input XML data. Please note that you have to use absolute URLs.- Parameters:
filePath- an absolute URL giving the base location of the XML data.
-
setInputXMLFileName
Deprecated.usesetInputFileName(java.lang.String)instead. -
setInputFileCollection
Set a collection of XML files as input data. Please note that you have to use absolute URLs.- Parameters:
fileCollection- Collection of strings containing absolute URLs
-
setInputXMLFileCollection
Deprecated. -
setSchemaFileName
Set file name for external Schema.- Parameters:
filePath- an absolute URL giving the base location of the Schema
-
setSchemaFileCollection
Set a collection of files as external schemas- Parameters:
fileCollection- array of absolute URLs of the schemas
-
setDTDFileName
Set file name for external DTD.- Parameters:
filePath- an absolute URL giving the base location of the DTD.
-
setJSONSchemaFileName
Set file name for external JSON schema.- Parameters:
filePath- an absolute URL giving the base location of the JSON schema file.
-
setAvroSchemaFileName
Set file name for external Avro schema.- Parameters:
filePath- an absolute URL giving the base location of the Avro schema file.
-
setInputFromText
Set the text value for the input XML data. Example: setInputXMLFromText( "text " )- Parameters:
inputText- a string containing XML data
-
setInputXMLFromText
Deprecated.usesetInputFromText(java.lang.String)instead. -
setInputTextCollection
Set a collection of strings as input- Parameters:
stringCollection- collection of strings containing input documents
-
setInputXMLTextCollection
Deprecated. -
setSchemaFromText
Set text value for external Schema.- Parameters:
schemaText- string containing Schema as text.
-
setSchemaTextCollection
Set a collection of strings as external schemas- Parameters:
stringCollection- collection of strings containing additional schemas as text
-
setDTDFromText
Set text value for external DTD.- Parameters:
dtdText- string containing DTD as text
-
setJSONSchemaFromText
Set text value for JSON schema.- Parameters:
schemaText- string containing JSON Schema as text
-
setAvroSchemaFromText
Set text value for Avro schema.- Parameters:
schemaText- string containing Avro Schema as text
-
getLastErrorMessage
String getLastErrorMessage()Get the last error message from the engine.- Returns:
- last error message
-
setEnableNamespaces
void setEnableNamespaces(boolean enable) Enable/disable namespace processing -
setXSDVersion
XSD specification version- Parameters:
version- Version to be used by the validation engine
-
setXincludeSupport
void setXincludeSupport(boolean support) Enable/disable xinclude support -
setAssessmentMode
Assessment mode- Parameters:
mode- Assessment mode to be used by the validation engine
-
setXMLValidationMode
Processing mode- Parameters:
mode- XML Validation mode to be used by the validation engine
-
setSchemalocationHints
Configure the usage of the xsi:schemaLocation hints -
setSchemaImports
Configure the usage of the xsi:schemaLocation hints -
seSchemaImports
Deprecated.Configure the usage of the xsi:schemaLocation hints -
setSchemaMapping
Configure the usage of the xsi:schemaLocation hints -
setPythonScriptFile
Python script to be executed after a successful validation.- Parameters:
file- path of the script file.
-
setStreaming
void setStreaming(boolean support) Enable/disable streaming. -
setParallelAssessment
void setParallelAssessment(boolean support) Enable/disable parallel schema validity assessment. -
setJson5
void setJson5(boolean json5) Enable/disable json5 support. Default value is false. -
setJsonC
void setJsonC(boolean jsonC) Enables support for comments in JSON. Default value is false. -
setJsonLines
void setJsonLines(boolean jsonLines) Enables support for JSON Lines (that is, one JSON value per line). Default value is false. -
setJsonSchemaVersion
Specifies which version of the JSON Schema specification draft version to use. Default is detect. Use one of draft04|draft06|draft07|2019-09|2020-12|latest|detect.
-
setSchemaImports(com.altova.raptorxml.XMLValidator.ENUMSchemaImports)instead.