use of org.springframework.beans.factory.xml.ParserContext in project grails-core by grails.
the class BeanBuilder method createDynamicElementReader.
protected DynamicElementReader createDynamicElementReader(String namespace, final boolean decorator) {
NamespaceHandler handler = namespaceHandlers.get(namespace);
ParserContext parserContext = new ParserContext(readerContext, new BeanDefinitionParserDelegate(readerContext));
final DynamicElementReader dynamicElementReader = new DynamicElementReader(namespace, namespaces, handler, parserContext) {
@Override
protected void afterInvocation() {
if (!decorator) {
currentBeanConfig = null;
}
}
};
dynamicElementReader.setClassLoader(classLoader);
if (currentBeanConfig != null) {
dynamicElementReader.setBeanConfiguration(currentBeanConfig);
} else if (!decorator) {
currentBeanConfig = new DefaultBeanConfiguration(namespace);
dynamicElementReader.setBeanConfiguration(currentBeanConfig);
}
dynamicElementReader.setBeanDecorator(decorator);
return dynamicElementReader;
}
use of org.springframework.beans.factory.xml.ParserContext 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