Package com.altova.raptorxml
Interface XMLValidator
public interface XMLValidator
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enum
static enum
static enum
static enum
static enum
static enum
static enum
static enum
-
Method Summary
Modifier and TypeMethodDescriptionboolean
extractAvroSchema
(String outputPath) Extract a AVRO schema document from a binary fileGet the last error message from the engine.boolean
isValid()
boolean
Validates the input XML data against its schema.boolean
boolean
Checks the input XML data for well-formedness.void
Deprecated.void
Assessment modevoid
setAvroSchemaFileName
(String filePath) Set file name for external Avro schema.void
setAvroSchemaFromText
(String schemaText) Set text value for Avro schema.void
setDTDFileName
(String filePath) Set file name for external DTD.void
setDTDFromText
(String dtdText) Set text value for external DTD.void
setEnableNamespaces
(boolean enable) Enable/disable namespace processingvoid
setInputFileCollection
(Collection<String> fileCollection) Set a collection of XML files as input data.void
setInputFileName
(String filePath) Set the file name for the input XML data.void
setInputFromText
(String inputText) Set the text value for the input XML data.void
setInputTextCollection
(Collection<String> stringCollection) Set a collection of strings as inputvoid
setInputXMLFileCollection
(Collection<String> fileCollection) Deprecated.void
setInputXMLFileName
(String filePath) Deprecated.usesetInputFileName(java.lang.String)
instead.void
setInputXMLFromText
(String inputText) Deprecated.usesetInputFromText(java.lang.String)
instead.void
setInputXMLTextCollection
(Collection<String> stringCollection) Deprecated.void
setJson5
(boolean json5) Enable/disable json5 support.void
setJsonC
(boolean jsonC) Enables support for comments in JSON.void
setJsonLines
(boolean jsonLines) Enables support for JSON Lines (that is, one JSON value per line).void
setJSONSchemaFileName
(String filePath) Set file name for external JSON schema.void
setJSONSchemaFromText
(String schemaText) Set text value for JSON schema.void
setJsonSchemaVersion
(String strJsonSchemaVersion) Specifies which version of the JSON Schema specification draft version to use.void
setParallelAssessment
(boolean support) Enable/disable parallel schema validity assessment.void
setPythonScriptFile
(String file) Python script to be executed after a successful validation.void
setSchemaFileCollection
(Collection<String> fileCollection) Set a collection of files as external schemasvoid
setSchemaFileName
(String filePath) Set file name for external Schema.void
setSchemaFromText
(String schemaText) Set text value for external Schema.void
Configure the usage of the xsi:schemaLocation hintsvoid
Configure the usage of the xsi:schemaLocation hintsvoid
Configure the usage of the xsi:schemaLocation hintsvoid
setSchemaTextCollection
(Collection<String> stringCollection) Set a collection of strings as external schemasvoid
setStreaming
(boolean support) Enable/disable streaming.void
setXincludeSupport
(boolean support) Enable/disable xinclude supportvoid
Processing modevoid
setXSDVersion
(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
getLastErrorMessage
to 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
getLastErrorMessage
to 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.