Class XmlValidatingMessageSelector
java.lang.Object
org.springframework.integration.xml.selector.XmlValidatingMessageSelector
- All Implemented Interfaces:
GenericSelector<Message<?>>
,MessageSelector
public class XmlValidatingMessageSelector extends Object implements MessageSelector
The XML validation-specific
MessageSelector
.- Since:
- 2.0
- Author:
- Oleg Zhurakousky, Gary Russell, Liujiong, Artem Bilan
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
XmlValidatingMessageSelector.SchemaType
-
Constructor Summary
Constructors Constructor Description XmlValidatingMessageSelector(Resource schema, String schemaType)
XmlValidatingMessageSelector(Resource schema, XmlValidatingMessageSelector.SchemaType schemaType)
Create a selector with a defaultXmlValidator
.XmlValidatingMessageSelector(XmlValidator xmlValidator)
-
Method Summary
Modifier and Type Method Description boolean
accept(Message<?> message)
void
setConverter(XmlPayloadConverter converter)
Specify the Converter to use when converting payloads prior to validation.void
setThrowExceptionOnRejection(boolean throwExceptionOnRejection)
-
Constructor Details
-
XmlValidatingMessageSelector
public XmlValidatingMessageSelector(Resource schema, XmlValidatingMessageSelector.SchemaType schemaType) throws IOExceptionCreate a selector with a defaultXmlValidator
. The validator will be initialized with the provided 'schema' locationResource
and 'schemaType'. The valid options for schema type areXmlValidatorFactory.SCHEMA_W3C_XML
orXmlValidatorFactory.SCHEMA_RELAX_NG
. If no 'schemaType' is provided it will default toXmlValidatorFactory.SCHEMA_W3C_XML
;- Parameters:
schema
- The schema.schemaType
- The schema type.- Throws:
IOException
- if the XmlValidatorFactory fails to create a validator
-
XmlValidatingMessageSelector
-
XmlValidatingMessageSelector
- Throws:
IOException
-
-
Method Details
-
setThrowExceptionOnRejection
public void setThrowExceptionOnRejection(boolean throwExceptionOnRejection) -
setConverter
Specify the Converter to use when converting payloads prior to validation.- Parameters:
converter
- The payload converter.
-
accept
- Specified by:
accept
in interfaceGenericSelector<Message<?>>
- Specified by:
accept
in interfaceMessageSelector
-