use of org.springframework.beans.factory.parsing.SourceExtractor 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);
}
}
use of org.springframework.beans.factory.parsing.SourceExtractor in project spring-framework by spring-projects.
the class AspectJNamespaceHandlerTests method setUp.
@Before
public void setUp() throws Exception {
SourceExtractor sourceExtractor = new PassThroughSourceExtractor();
XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(this.registry);
XmlReaderContext readerContext = new XmlReaderContext(null, null, this.readerEventListener, sourceExtractor, reader, null);
this.parserContext = new ParserContext(readerContext, null);
}
Aggregations