Spring Framework BeanFactoryResolver - 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 BeanFactoryResolver class.

This code example shows how to use the following methods:
		evaluationContext.addPropertyAccessor(new MapAccessor());
		if (conversionService != null) {
			evaluationContext.setTypeConverter(new StandardTypeConverter(conversionService));
		} 
		if (beanFactory != null) {
			evaluationContext.setBeanResolver(new BeanFactoryResolver(beanFactory));
		} 
		return evaluationContext;
	} 
 
	/** 
	 * Used to create a context with no BeanFactory, usually in tests. 
	 * @return The evaluation context. 
	 */ 
	public static StandardEvaluationContext createStandardEvaluationContext() { 
		return doCreateContext(null); 
	} 
 
	/** 
	 * Obtains the context from the beanFactory if not null; emits a warning if the beanFactory 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
    private EvaluationContext createEvaluationContext(Exchange exchange) { 
        StandardEvaluationContext evaluationContext = new StandardEvaluationContext(new RootObject(exchange)); 
        if (exchange.getContext() instanceof SpringCamelContext) { 
            // Support references (like @foo) in expressions to beans defined in the Registry/ApplicationContext 
            ApplicationContext applicationContext = ((SpringCamelContext) exchange.getContext()).getApplicationContext(); 
            evaluationContext.setBeanResolver(new BeanFactoryResolver(applicationContext)); 
        } 
        return evaluationContext; 
    } 
 
    private Expression parseExpression() { 
        // Support template parsing with #{ } delimiters 
        ParserContext parserContext = new TemplateParserContext(); 
        Expression expression = expressionParser.parseExpression(expressionString, parserContext); 
        return expression; 
    } 
 
    public Class<?> getType() { 
        return type; 
    } 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
	@Test
	public void testBytesNotCopied() throws Exception {
		Expression expression = new SpelExpressionParser().parseExpression("@service.handleBytes(#root)");
		byte[] bytes = new byte[100];
		StandardEvaluationContext evaluationContext = new StandardEvaluationContext(bytes);
		evaluationContext.setBeanResolver(new BeanFactoryResolver(this.beanFactory));
		byte[] outBytes = expression.getValue(evaluationContext, byte[].class);
		assertSame(bytes, outBytes);
	} 
 
} 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
		if (accessor != null) { 
			evaluationContext.addPropertyAccessor(accessor); 
		} 
 
		if (factory != null) { 
			evaluationContext.setBeanResolver(new BeanFactoryResolver(factory)); 
		} 
 
		return evaluationContext; 
	} 
 
} 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
	public void setBeanFactory(final BeanFactory beanFactory) {
		if (beanFactory != null) {
			this.beanFactory = beanFactory;
			this.typeConverter.setBeanFactory(beanFactory);
			if (this.evaluationContext != null && this.evaluationContext.getBeanResolver() == null) {
				this.evaluationContext.setBeanResolver(new BeanFactoryResolver(beanFactory));
			} 
			this.messageBuilderFactory = IntegrationUtils.getMessageBuilderFactory(beanFactory);
		} 
	} 
 
	protected BeanFactory getBeanFactory() {
		return beanFactory;
	} 
 
	public void setConversionService(ConversionService conversionService) {
		if (conversionService != null) {
			this.typeConverter.setConversionService(conversionService);
		} 
	} 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
    public void setPermissionEvaluator(PermissionEvaluator permissionEvaluator) { 
        this.permissionEvaluator = permissionEvaluator; 
    } 
 
    public void setApplicationContext(ApplicationContext applicationContext) { 
        br = new BeanFactoryResolver(applicationContext); 
    } 
} 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
		this.evaluationContext.addPropertyAccessor(new MapAccessor());
 
		final BeanFactory beanFactory = this.getBeanFactory();
 
		if (beanFactory != null) {
			this.evaluationContext.setBeanResolver(new BeanFactoryResolver(
					beanFactory));
		} 
 
		if (this.destinationDirectoryExpression instanceof LiteralExpression) {
			final Path directory = new Path(
					this.destinationDirectoryExpression.getValue(
							this.evaluationContext, null, String.class));
			validateDestinationDirectory(directory, this.autoCreateDirectory);
		} 
 
	} 
 
	private void validateDestinationDirectory(Path destinationDirectory,
			boolean autoCreateDirectory) {
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
		this.evaluationContext.addPropertyAccessor(new MapAccessor());
 
		final BeanFactory beanFactory = this.getBeanFactory();
 
		if (beanFactory != null) {
			this.evaluationContext.setBeanResolver(new BeanFactoryResolver(
					beanFactory));
		} 
 
		if (this.destinationDirectoryExpression instanceof LiteralExpression) {
			final Path directory = new Path(
					this.destinationDirectoryExpression.getValue(
							this.evaluationContext, null, String.class));
			validateDestinationDirectory(directory, this.autoCreateDirectory);
		} 
 
	} 
 
	private void validateDestinationDirectory(Path destinationDirectory,
			boolean autoCreateDirectory) {
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
	public void setBeanFactory(final BeanFactory beanFactory) {
		if (beanFactory != null) {
			this.beanFactory = beanFactory;
			this.typeConverter.setBeanFactory(beanFactory);
			if (this.evaluationContext != null && this.evaluationContext.getBeanResolver() == null) {
				this.evaluationContext.setBeanResolver(new BeanFactoryResolver(beanFactory));
			} 
		} 
	} 
 
	@Override 
	public void afterPropertiesSet() throws Exception {
		getEvaluationContext(); 
	} 
 
	/** 
	 * Sets the conversion service. 
	 * 
	 * @param conversionService the new conversion service 
	 */ 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
	 * @return A new {@link reactor.event.selector.Selector} 
	 */ 
	public static Selector expressionSelector(String expr, BeanFactory beanFactory) { 
		StandardEvaluationContext evalCtx = new StandardEvaluationContext(); 
		if(null != beanFactory) { 
			evalCtx.setBeanResolver(new BeanFactoryResolver(beanFactory)); 
		} 
		return expressionSelector(expr, evalCtx); 
	} 
 
    /** 
     * Helper method for creating an {@code ExpressionSelector}. 
     * 
     * @param expr 
     * 		The expression to parse. 
     * @param evalCtx 
     * 		The {@link org.springframework.expression.EvaluationContext} to use. 
     * 
     * @return A new {@link reactor.event.selector.Selector} 
     */ 
4
CodeRank
Experience pair programming with AI  Get Codota for Java