public class XmlValidatingMessageSelector extends java.lang.Object implements MessageSelector
Constructor and Description |
---|
XmlValidatingMessageSelector(org.springframework.core.io.Resource schema,
java.lang.String schemaType)
Creates a selector with a default
XmlValidator . |
XmlValidatingMessageSelector(org.springframework.xml.validation.XmlValidator xmlValidator) |
Modifier and Type | Method and Description |
---|---|
boolean |
accept(Message<?> message) |
void |
setConverter(XmlPayloadConverter converter)
Specify the Converter to use when converting payloads prior to validation.
|
void |
setThrowExceptionOnRejection(boolean throwExceptionOnRejection) |
public XmlValidatingMessageSelector(org.springframework.xml.validation.XmlValidator xmlValidator)
public XmlValidatingMessageSelector(org.springframework.core.io.Resource schema, java.lang.String schemaType) throws java.io.IOException
XmlValidator
. The validator will be initialized with
the provided 'schema' location Resource
and 'schemaType'. The valid options for schema
type are XmlValidatorFactory.SCHEMA_W3C_XML
or XmlValidatorFactory.SCHEMA_RELAX_NG
.
If no 'schemaType' is provided it will default to XmlValidatorFactory.SCHEMA_W3C_XML
;java.io.IOException
- if the XmlValidatorFactory fails to create a validatorpublic void setThrowExceptionOnRejection(boolean throwExceptionOnRejection)
public void setConverter(XmlPayloadConverter converter)
public boolean accept(Message<?> message)
accept
in interface MessageSelector