Spring Framework ParserContext - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework ParserContext class.

This code example shows how to use the following methods:getDelegate, getReaderContext
	@Override 
	public BeanDefinition parse(Element element, ParserContext parserContext) {
		boolean v7ElementsPresent = GEMFIRE7_ELEMENTS.contains(element.getLocalName());
 
		if (v7ElementsPresent) {
			ParsingUtils.throwExceptionIfNotGemfireV7(element.getLocalName(), null, parserContext);
		} 
 
		return super.parse(element, parserContext);
	} 
 
	@Override 
	public void init() { 
		registerBeanDefinitionParser("annotation-driven", new AnnotationDrivenBeanDefinitionParser()); 
		registerBeanDefinitionParser("cache", new CacheParser()); 
		registerBeanDefinitionParser("cache-server", new CacheServerParser()); 
		registerBeanDefinitionParser("auto-region-lookup", new AutoRegionLookupBeanDefinitionParser()); 
		registerBeanDefinitionParser("lookup-region", new LookupRegionParser()); 
		registerBeanDefinitionParser("region-template", new TemplateRegionParser()); 
		registerBeanDefinitionParser("local-region", new LocalRegionParser()); 

7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:extractSource
	private static final StandaloneStepParser stepParser = new StandaloneStepParser();
 
	@Override 
	protected AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext) {
 
		CoreNamespaceUtils.autoregisterBeansForNamespace(parserContext, parserContext.extractSource(element));
 
		return stepParser.parse(element, parserContext);
 
	} 
 
} 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getRegistry, registerComponent
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getReaderContext
This code example shows how to use the following methods:getRegistry, registerComponent
	@SuppressWarnings("unchecked") 
	public BeanDefinition parse(Element element, ParserContext parserContext) {
		Object source = parserContext.extractSource(element);
 
		// Register SimpleUrlHandlerMapping for view controllers 
		BeanDefinition hm = registerHandlerMapping(parserContext, source);
 
		// Ensure BeanNameUrlHandlerMapping (SPR-8289) and default HandlerAdapters are not "turned off" 
		MvcNamespaceUtils.registerDefaultComponents(parserContext, source);
 
		// Create view controller bean definition 
		RootBeanDefinition controller = new RootBeanDefinition(ParameterizableViewController.class);
		controller.setSource(source);
 
		HttpStatus statusCode = null;
		if (element.hasAttribute("status-code")) {
			int statusValue = Integer.valueOf(element.getAttribute("status-code"));
			statusCode = HttpStatus.valueOf(statusValue);
		} 
 

6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:extractSource, popAndRegisterContainingComponent, pushContainingComponent
This code example shows how to use the following methods:getRegistry
 * @author Michael Zhou 
 */ 
public abstract class AbstractConfigurationDefinitionParser<T> extends AbstractNamedBeanDefinitionParser<T> { 
    @Override 
    protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
        parseBeanDefinitionAttributes(element, parserContext, builder);
 
        String parentRef = trimToNull(element.getAttribute("parentRef"));
 
        if (parentRef != null) {
            builder.addConstructorArgValue(new RuntimeBeanReference(parentRef, true));
        } 
 
        subElementsToProperties(element, builder, and(sameNs(element), getPropertyElementSelector()));
 
        registerProductionModeSensiblePostProcessorIfNecessary(parserContext.getRegistry());
    } 
 
    protected ElementSelector getPropertyElementSelector() { 
        return any(); 
    } 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getContainingBeanDefinition
 * @author Michael Zhou 
 */ 
public class DefaultElementDefinitionParser extends AbstractBeanDefinitionParser {
    @Override 
    protected AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext) {
        Object beanOrRef = SpringExtUtil.parseBean(element, parserContext, parserContext.getContainingBeanDefinition());
        AbstractBeanDefinition abd;
 
        if (beanOrRef instanceof BeanReference) {
            BeanDefinitionBuilder refBean = BeanDefinitionBuilder.genericBeanDefinition(BeanReferenceFactoryBean.class);
 
            refBean.addPropertyValue("targetBeanName", ((RuntimeBeanReference) beanOrRef).getBeanName());
            abd = refBean.getBeanDefinition();
        } else if (beanOrRef instanceof BeanDefinitionHolder) {
            BeanDefinition bd = ((BeanDefinitionHolder) beanOrRef).getBeanDefinition();
            assertTrue(bd instanceof AbstractBeanDefinition, "unexpected bean definition type: %s", bd);
            abd = (AbstractBeanDefinition) bd;
        } else { 
            abd = null;
            unreachableCode("unexpected bean definition type: %s", beanOrRef);
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getContainingBeanDefinition, getDelegate, getReaderContext
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getDelegate