Package com.globant.google.mendoza.malbec.SchemaValidator

Examples of com.globant.google.mendoza.malbec.SchemaValidator.SchemaValidationResult


  public void setMerchantCalculation(final String callbackMsg,
      final String resultMsg, final Date startTime, final Date endTime) {
    log.trace("Entering setMerchantCalculation");

    SchemaValidator validator = new SchemaValidator();
    SchemaValidationResult result = validator.validate(resultMsg);
    boolean resultXMLValid = result.isXmlValid();
    String validationMessage = "Merchant calculation results XML is valid.";
    if (!resultXMLValid) {
      validationMessage = "Merchant calculation results XML is not valid.\n";
      validationMessage = validationMessage + result.getMessage();
      log.debug("Merchant calculation result message: " + resultMsg);
      log.debug("The merchant calculation result message is not a valid XML: "
      + validationMessage);
    }
View Full Code Here


        throw new RuntimeException(
                "No shopping cart found."
            + " Please checkout one first.");
      }
      SchemaValidator validator = new SchemaValidator();
      SchemaValidationResult validationResult =
        validator.validate(getMendozaState().getShoppingCart());
      if (!validationResult.isXmlValid()) {
        log.trace("Leaving execute");
        throw new RuntimeException(
            "The shopping cart XML is not valid. "
            + validationResult.getMessage());
      }
      result.setSuccess(commandResultMsg);
    } catch (RuntimeException e) {
      commandResultMsg = e.getMessage();
      result.setError(commandResultMsg);
View Full Code Here

TOP

Related Classes of com.globant.google.mendoza.malbec.SchemaValidator.SchemaValidationResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.