Search in sources :

Example 1 with AbstractXmlValidator

use of nl.nn.adapterframework.validation.AbstractXmlValidator in project iaf by ibissource.

the class XmlValidatorTest method getValidator.

public static XmlValidator getValidator(String schemaLocation, boolean addNamespaceToSchema, Class<AbstractXmlValidator> implementation) throws ConfigurationException {
    XmlValidator validator = getUnconfiguredValidator(schemaLocation, addNamespaceToSchema, implementation);
    validator.configure();
    return validator;
}
Also used : AbstractXmlValidator(nl.nn.adapterframework.validation.AbstractXmlValidator) XercesXmlValidator(nl.nn.adapterframework.validation.XercesXmlValidator) JavaxXmlValidator(nl.nn.adapterframework.validation.JavaxXmlValidator)

Example 2 with AbstractXmlValidator

use of nl.nn.adapterframework.validation.AbstractXmlValidator in project iaf by ibissource.

the class XmlValidatorTest2 method getValidator.

public static XmlValidator getValidator(String schemaLocation, boolean addNamespaceToSchema, Class<AbstractXmlValidator> implementation) throws ConfigurationException {
    XmlValidator validator = new XmlValidator();
    try {
        validator.setImplementation(implementation);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
    validator.setSchemaLocation(schemaLocation);
    if (addNamespaceToSchema) {
        validator.setAddNamespaceToSchema(addNamespaceToSchema);
    }
    validator.registerForward(getSuccess());
    validator.setThrowException(true);
    validator.setFullSchemaChecking(true);
    validator.configure();
    return validator;
}
Also used : AbstractXmlValidator(nl.nn.adapterframework.validation.AbstractXmlValidator) XercesXmlValidator(nl.nn.adapterframework.validation.XercesXmlValidator) JavaxXmlValidator(nl.nn.adapterframework.validation.JavaxXmlValidator) PipeRunException(nl.nn.adapterframework.core.PipeRunException) IOException(java.io.IOException) ConfigurationException(nl.nn.adapterframework.configuration.ConfigurationException) XmlValidatorException(nl.nn.adapterframework.validation.XmlValidatorException)

Example 3 with AbstractXmlValidator

use of nl.nn.adapterframework.validation.AbstractXmlValidator in project iaf by ibissource.

the class XmlValidatorTest method getUnconfiguredValidator.

public static XmlValidator getUnconfiguredValidator(String schemaLocation, boolean addNamespaceToSchema, Class<AbstractXmlValidator> implementation) {
    XmlValidator validator = new XmlValidator();
    try {
        validator.setImplementation(implementation);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
    validator.setSchemaLocation(schemaLocation);
    if (addNamespaceToSchema) {
        validator.setAddNamespaceToSchema(addNamespaceToSchema);
    }
    validator.registerForward(getSuccess());
    validator.setThrowException(true);
    validator.setFullSchemaChecking(true);
    return validator;
}
Also used : AbstractXmlValidator(nl.nn.adapterframework.validation.AbstractXmlValidator) XercesXmlValidator(nl.nn.adapterframework.validation.XercesXmlValidator) JavaxXmlValidator(nl.nn.adapterframework.validation.JavaxXmlValidator) PipeRunException(nl.nn.adapterframework.core.PipeRunException) IOException(java.io.IOException) ConfigurationException(nl.nn.adapterframework.configuration.ConfigurationException) XmlValidatorException(nl.nn.adapterframework.validation.XmlValidatorException)

Aggregations

AbstractXmlValidator (nl.nn.adapterframework.validation.AbstractXmlValidator)3 JavaxXmlValidator (nl.nn.adapterframework.validation.JavaxXmlValidator)3 XercesXmlValidator (nl.nn.adapterframework.validation.XercesXmlValidator)3 IOException (java.io.IOException)2 ConfigurationException (nl.nn.adapterframework.configuration.ConfigurationException)2 PipeRunException (nl.nn.adapterframework.core.PipeRunException)2 XmlValidatorException (nl.nn.adapterframework.validation.XmlValidatorException)2