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

This code example shows how to use the following methods:
 * @author Juergen Hoeller 
 * @since 2.5 
 * @see WebApplicationContextFacesELResolver 
 * @see org.springframework.web.jsf.FacesContextUtils#getRequiredWebApplicationContext 
 */ 
public class SpringBeanFacesELResolver extends SpringBeanELResolver { 
 
	/** 
	 * This implementation delegates to {@link #getWebApplicationContext}. 
	 * Can be overridden to provide an arbitrary BeanFactory reference to resolve 
	 * against; usually, this will be a full Spring ApplicationContext. 
	 * @param elContext the current JSF ELContext 
	 * @return the Spring BeanFactory (never {@code null}) 
	 */ 
	@Override 
	protected BeanFactory getBeanFactory(ELContext elContext) { 
		return getWebApplicationContext(elContext); 
	} 
 
	/** 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
		add(new ScopeSearchingELResolver()); 
		add(new MapAdaptableELResolver()); 
		add(new BeanELResolver()); 
	} 
 
	private static class BeanELResolver extends SpringBeanELResolver { 
 
		private static final BeanFactory EMPTY_BEAN_FACTORY = new StaticListableBeanFactory(); 
 
		protected BeanFactory getBeanFactory(ELContext elContext) { 
			RequestContext requestContext = RequestContextHolder.getRequestContext(); 
			if (requestContext == null) { 
				return EMPTY_BEAN_FACTORY; 
			} 
			BeanFactory beanFactory = requestContext.getActiveFlow().getApplicationContext(); 
			return beanFactory != null ? beanFactory : EMPTY_BEAN_FACTORY; 
		} 
	} 
 
} 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
 
	private static final BeanFactory EMPTY_BEAN_FACTORY = new StaticListableBeanFactory(); 
 
	private RequestContext requestContext; 
 
	public SpringBeanWebFlowELResolver() { 
	} 
 
	public SpringBeanWebFlowELResolver(RequestContext context) { 
		this.requestContext = context; 
	} 
 
	protected BeanFactory getBeanFactory(ELContext elContext) { 
		RequestContext requestContext = getRequestContext(); 
		if (requestContext == null) { 
			return EMPTY_BEAN_FACTORY; 
		} 
		BeanFactory beanFactory = requestContext.getActiveFlow().getApplicationContext(); 
		return beanFactory != null ? beanFactory : EMPTY_BEAN_FACTORY; 
	} 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
 * Unified EL {@link ELResolver} that delegates to the appropriate {@link SpringFacesContext#getWebApplicationContext() 
 * BeanFactory} when a {@link SpringFacesContext} is active and rendering a view. 
 *  
 * @author Phillip Webb 
 */ 
public class SpringFacesBeanELResolver extends SpringBeanELResolver { 
 
	private static final BeanFactory EMPTY_BEAN_FACTORY = new StaticListableBeanFactory(); 
 
	@Override 
	protected BeanFactory getBeanFactory(ELContext elContext) { 
		if (SpringFacesContext.getCurrentInstance() == null) { 
			return EMPTY_BEAN_FACTORY; 
		} 
		return SpringFacesContext.getCurrentInstance().getWebApplicationContext(); 
	} 
 
} 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getValue
	public static final String MESSAGE_ATTRIBUTE = FacesELResolver.class.getName() + ".MESSAGE_ATTRIBUTE"; 
	public static final String PROPERTY_ATTRIBUTE = FacesELResolver.class.getName() + ".PROPERTY_ATTRIBUTE"; 
	 
	public Object getValue(ELContext elContext, Object base, Object property) throws ELException { 
		 
		Object value = super.getValue(elContext, base, property); 
		 
		if (value == null) { 
			if (property instanceof String) { 
				final String current = (String) property; 
				if (base == null && MESSAGES.equals(current)) { 
					elContext.setPropertyResolved(true); 
					RequestUtils.setAttribute(MESSAGE_ATTRIBUTE, null); 
					RequestUtils.setAttribute(PROPERTY_ATTRIBUTE, null); 
					return current;						 
				} else if (base == null && PROPERTIES.equals(current)) { 
					elContext.setPropertyResolved(true); 
					RequestUtils.setAttribute(MESSAGE_ATTRIBUTE, null); 
					RequestUtils.setAttribute(PROPERTY_ATTRIBUTE, null); 
					return current;						 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getCurrentConversation, getType
    } 
 
    @Override 
    public Class<?> getType(ELContext elContext, Object base, Object property) throws ELException { 
        if (base == null && property != null) { 
            Conversation currentConversation = getCurrentConversation(); 
            if (currentConversation != null) { 
                Object value = currentConversation.getVar(property.toString()); 
                if (value != null) { 
                    elContext.setPropertyResolved(true); 
                    return value.getClass(); 
                } 
            } 
        } 
 
        return super.getType(elContext, base, property); 
    } 
} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java