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