org.mule.module.json.validation.JsonSchemaValidationException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mule-module-json Show documentation
Show all versions of mule-module-json Show documentation
Implementation of JSON transformers for Mule
/*
* Copyright (c) MuleSoft, Inc. All rights reserved. http://www.mulesoft.com
* The software in this package is published under the terms of the CPAL v1.0
* license, a copy of which has been included with this distribution in the
* LICENSE.txt file.
*/
package org.mule.module.json.validation;
import org.mule.api.MuleException;
import org.mule.config.i18n.MessageFactory;
/**
* Exception to signal that a given json did not
* pass validation against a json schema
*
* @since 3.6.0
*/
public class JsonSchemaValidationException extends MuleException
{
/**
* A {@link String} representation of the json
*/
private final String invalidJson;
public JsonSchemaValidationException(String validationError, String invalidJson)
{
super(MessageFactory.createStaticMessage(validationError));
this.invalidJson = invalidJson;
}
public JsonSchemaValidationException(String validationError, String invalidJson, Exception exception)
{
super(MessageFactory.createStaticMessage(validationError), exception);
this.invalidJson = invalidJson;
}
/**
* Returns a {@link String} representation of the failing json
*
* @return a {@link String}
*/
public String getInvalidJson()
{
return invalidJson;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy