edu.nrao.sss.webapp
Class ManagedBeanRepository

java.lang.Object
  extended by edu.nrao.sss.webapp.ManagedBeanRepository

public class ManagedBeanRepository
extends Object

This class provides an easy way to get access to JSF Managed Beans via their EL value bindings (For example "#{managedBean}").

Author:
btruitt

Constructor Summary
ManagedBeanRepository()
           
 
Method Summary
static
<T> T
getManagedBean(Class<T> c, String elStatement)
          Fetches the Object that is currently being used in the FacesContext by using its JSF Expression Language ValueBinding.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ManagedBeanRepository

public ManagedBeanRepository()
Method Detail

getManagedBean

public static <T> T getManagedBean(Class<T> c,
                                   String elStatement)
Fetches the Object that is currently being used in the FacesContext by using its JSF Expression Language ValueBinding. The reference returned is a refrence of type c

Parameters:
c - The class of the object being referenced by elStatement
elStatement - a JSF EL statement (i.e. "#{managedBean}").
Returns:
null if the ValueBinding doesn't exist or is of the wrong type.
Throws:
IllegalArgumentException - if elStatement is invalid.


Copyright © 2009. All Rights Reserved.