SourceForge.net Logo

de.mindmatters.faces.spring.context.support
Class DelegatingVariableResolver

java.lang.Object
  extended byjavax.faces.el.VariableResolver
      extended byde.mindmatters.faces.spring.context.support.DelegatingVariableResolver
All Implemented Interfaces:
BeanFactoryAware

public final class DelegatingVariableResolver
extends VariableResolver
implements BeanFactoryAware

VariableResolver implementation that delegates to the internal BeanFactory of the used FacesWebApplicationContext and original resolver of the underlying JSF implementation to resolve the asked beans or variables.

Author:
Andreas Kuhrwahl
See Also:
SpringManagedBeanFactory, FacesDelegatingManagedBeanFactory

Constructor Summary
DelegatingVariableResolver()
          Creates a DelegatingVariableResolver.
DelegatingVariableResolver(VariableResolver originalVariableResolver)
          Creates a DelegatingVariableResolver with the given VariableResolver originalVariableResolver.
DelegatingVariableResolver(VariableResolver originalVariableResolver, BeanFactory beanFactory)
          Creates a DelegatingVariableResolver with the given VariableResolver originalVariableResolver and the given BeanFactory beanFactory.
 
Method Summary
 java.lang.Object resolveVariable(FacesContext context, java.lang.String name)
          Checks wether there is a bean with name name in the internal BeanFactory of the used FacesWebApplicationContext and returns it.
 void setBeanFactory(BeanFactory beanFactory)
          
 void setOriginalVariableResolver(VariableResolver originalVariableResolver)
          Sets the original resolver of the underlying JSF implementation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelegatingVariableResolver

public DelegatingVariableResolver()
Creates a DelegatingVariableResolver.


DelegatingVariableResolver

public DelegatingVariableResolver(VariableResolver originalVariableResolver)
Creates a DelegatingVariableResolver with the given VariableResolver originalVariableResolver.

Parameters:
originalVariableResolver - the original resolver of the underlying JSF implementation

DelegatingVariableResolver

public DelegatingVariableResolver(VariableResolver originalVariableResolver,
                                  BeanFactory beanFactory)
Creates a DelegatingVariableResolver with the given VariableResolver originalVariableResolver and the given BeanFactory beanFactory.

Parameters:
originalVariableResolver - the original resolver of the underlying JSF implementation
beanFactory - the BeanFactory this VariableResolver uses for bean resolving
Method Detail

resolveVariable

public java.lang.Object resolveVariable(FacesContext context,
                                        java.lang.String name)
Checks wether there is a bean with name name in the internal BeanFactory of the used FacesWebApplicationContext and returns it. Otherwise delegates to the encapsulated original VariableResolver.

Parameters:
context - context against which to resolve the bean name
name - name of the bean to be resolved
Returns:
the resolved object
Throws:
EvaluationException - if an exception is thrown while resolving the variable name
See Also:
VariableResolver.resolveVariable(javax.faces.context.FacesContext, java.lang.String), FacesWebApplicationContext

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)

Specified by:
setBeanFactory in interface BeanFactoryAware

setOriginalVariableResolver

public void setOriginalVariableResolver(VariableResolver originalVariableResolver)
Sets the original resolver of the underlying JSF implementation.

Parameters:
originalVariableResolver - the original resolver of the underlying JSF implementation

SourceForge.net Logo

Copyright © 2002 mindmatters GmbH & Co. KG