public class XmlValidatingMessageSelector extends java.lang.Object implements MessageSelector
| Modifier and Type | Class and Description |
|---|---|
static class |
XmlValidatingMessageSelector.SchemaType |
| Constructor and Description |
|---|
XmlValidatingMessageSelector(org.springframework.core.io.Resource schema,
java.lang.String schemaType) |
XmlValidatingMessageSelector(org.springframework.core.io.Resource schema,
XmlValidatingMessageSelector.SchemaType schemaType)
Creates a selector with a default
XmlValidator. |
XmlValidatingMessageSelector(org.springframework.xml.validation.XmlValidator xmlValidator) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(org.springframework.messaging.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,
XmlValidatingMessageSelector.SchemaType 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;schema - The schema.schemaType - The schema type.java.io.IOException - if the XmlValidatorFactory fails to create a validatorpublic XmlValidatingMessageSelector(org.springframework.core.io.Resource schema,
java.lang.String schemaType)
throws java.io.IOException
java.io.IOExceptionpublic void setThrowExceptionOnRejection(boolean throwExceptionOnRejection)
public void setConverter(XmlPayloadConverter converter)
converter - The payload converter.public boolean accept(org.springframework.messaging.Message<?> message)
accept in interface GenericSelector<org.springframework.messaging.Message<?>>accept in interface MessageSelector