public void afterPropertiesSet ( ) throws Exception { // try to find xml message validator in registry for ( MessageValidator < ? extends ValidationContext > messageValidator : messageValidatorRegistry . getMessageValidators ( ) ) { if ( messageValidator instanceof DomXmlMessageValidator && messageValidator . supportsMessageType ( MessageType . XML . name ( ) , new DefaultMessage ( "" ) ) ) { xmlMessageValidator = ( DomXmlMessageValidator ) messageValidator ; } } if ( xmlMessageValidator == null ) { LOG . warn ( "No XML message validator found in Spring bean context - setting default validator" ) ; xmlMessageValidator = new DomXmlMessageValidator ( ) ; xmlMessageValidator . setApplicationContext ( applicationContext ) ; } }
Initialize xml message validator if not injected by Spring bean context .