Class Validate
java.lang.Object
org.libxmq.imp.Validate
A compiled xsd 1.0 schema, used to validate documents (XMQXsd, xmqCompileXsd,
xmqSetXsdMessageCallback, xmqValidate in the C version).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceReceives the messages of compilation and validation (XMQXsdMessageCallback). -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intXMQ_ERROR_XSD_COMPILE: the schema is not usable.static final intXMQ_ERROR_XSD_INVALID: the document is not valid.static final intThe status of xmqValidate: the document is valid. -
Method Summary
Modifier and TypeMethodDescriptionstatic Validatecompile(XmlDocument src, Validate.MessageCallback callback, Object user_data) Compile a schema (xmqCompileXsd).voidsetMessageCallback(Validate.MessageCallback callback, Object user_data) Set the message callback used by validate (xmqSetXsdMessageCallback).intvalidate(XmlDocument doc) Validate a document (xmqValidate).
-
Field Details
-
OK
public static final int OKThe status of xmqValidate: the document is valid.- See Also:
-
ERROR_XSD_COMPILE
public static final int ERROR_XSD_COMPILEXMQ_ERROR_XSD_COMPILE: the schema is not usable.- See Also:
-
ERROR_XSD_INVALID
public static final int ERROR_XSD_INVALIDXMQ_ERROR_XSD_INVALID: the document is not valid.- See Also:
-
-
Method Details
-
compile
public static Validate compile(XmlDocument src, Validate.MessageCallback callback, Object user_data) Compile a schema (xmqCompileXsd).- Parameters:
src- The schema document.callback- The message callback, or null to print the messages on stderr.user_data- The user data of the callback.- Returns:
- The compiled schema, or null.
-
setMessageCallback
Set the message callback used by validate (xmqSetXsdMessageCallback).- Parameters:
callback- The callback.user_data- The user data.
-
validate
Validate a document (xmqValidate).- Parameters:
doc- The document.- Returns:
- OK, ERROR_XSD_COMPILE or ERROR_XSD_INVALID.
-