Class Validate

java.lang.Object
org.libxmq.imp.Validate

public class Validate extends Object
A compiled xsd 1.0 schema, used to validate documents (XMQXsd, xmqCompileXsd, xmqSetXsdMessageCallback, xmqValidate in the C version).
  • Field Details

    • OK

      public static final int OK
      The status of xmqValidate: the document is valid.
      See Also:
    • ERROR_XSD_COMPILE

      public static final int ERROR_XSD_COMPILE
      XMQ_ERROR_XSD_COMPILE: the schema is not usable.
      See Also:
    • ERROR_XSD_INVALID

      public static final int ERROR_XSD_INVALID
      XMQ_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

      public void setMessageCallback(Validate.MessageCallback callback, Object user_data)
      Set the message callback used by validate (xmqSetXsdMessageCallback).
      Parameters:
      callback - The callback.
      user_data - The user data.
    • validate

      public int validate(XmlDocument doc)
      Validate a document (xmqValidate).
      Parameters:
      doc - The document.
      Returns:
      OK, ERROR_XSD_COMPILE or ERROR_XSD_INVALID.