Class EvmXmlValidator

java.lang.Object
net.finmath.smartcontracts.representablestate.xml.EvmXmlValidator

public class EvmXmlValidator extends Object
Utility to validate the XML output of an IXMLRepresentableState contract against the evmstate binding schema (and optionally additional business XSDs). This is intended for tests / tooling.
Author:
Christian Fries
  • Constructor Details

    • EvmXmlValidator

      public EvmXmlValidator(String evmstateXsdPath, String... businessXsdPaths) throws SAXException
      Create a validator using the evmstate-binding XSD and optional additional XSDs (e.g. business schemas such as FpML or BDT). The given paths are treated as classpath resources (e.g. placed under src/main/resources) and resolved via the context ClassLoader.
      Parameters:
      evmstateXsdPath - classpath path to evmstate-bindings.xsd (e.g. "evmstate-bindings.xsd" or "xsd/evmstate-bindings.xsd")
      businessXsdPaths - optional additional XSDs (classpath paths) to validate the business XML structure
      Throws:
      SAXException - if schema compilation fails
  • Method Details

    • validate

      public void validate(String xml) throws SAXException, IOException
      Validate an XML string against the configured schema.
      Parameters:
      xml - the XML document as string
      Throws:
      SAXException - if validation fails (structurally invalid)
      IOException - if an IO error occurs while reading the XML