use of org.springframework.beans.factory.parsing.ProblemReporter in project aries by apache.
the class BlueprintNamespaceHandler method createSpringParserContext.
private org.springframework.beans.factory.xml.ParserContext createSpringParserContext(ParserContext parserContext, DefaultListableBeanFactory registry) {
try {
XmlBeanDefinitionReader xbdr = new XmlBeanDefinitionReader(registry);
Resource resource = new UrlResource(parserContext.getSourceNode().getOwnerDocument().getDocumentURI());
ProblemReporter problemReporter = new FailFastProblemReporter();
ReaderEventListener listener = new EmptyReaderEventListener();
SourceExtractor extractor = new NullSourceExtractor();
NamespaceHandlerResolver resolver = new SpringNamespaceHandlerResolver(parserContext);
xbdr.setProblemReporter(problemReporter);
xbdr.setEventListener(listener);
xbdr.setSourceExtractor(extractor);
xbdr.setNamespaceHandlerResolver(resolver);
XmlReaderContext xmlReaderContext = xbdr.createReaderContext(resource);
BeanDefinitionParserDelegate bdpd = new BeanDefinitionParserDelegate(xmlReaderContext);
return new org.springframework.beans.factory.xml.ParserContext(xmlReaderContext, bdpd);
} catch (Exception e) {
throw new RuntimeException("Error creating spring parser context", e);
}
}
Aggregations