com.sun.rave.web.ui.appbase
Class FacesBean

java.lang.Object
  extended by com.sun.rave.web.ui.appbase.FacesBean
Direct Known Subclasses:
AbstractApplicationBean, AbstractFragmentBean, AbstractPageBean, AbstractRequestBean, AbstractSessionBean

public abstract class FacesBean
extends java.lang.Object

FacesBean is the abstract base class for all page beans, request scope data beans, session scope data beans, and application scope data beans that wish to participate in the provided JavaServer Faces integration support. Concrete subclasses of this class will typically be registered as managed beans, so that they get created on demand (and added to the relevant scope's attributes).

NOTE - These integration methods will operate successfully only within the lifetime of a JavaServer Faces request.


Constructor Summary
FacesBean()
           
 
Method Summary
protected  void erase()
          Erase previously submitted values for all input components on this page.
protected  void error(java.lang.String summary)
          Enqueue a global FacesMessage (not associated with any particular componen) containing the specified summary text and a message severity level of FacesMessage.SEVERITY_ERROR.
protected  void error(javax.faces.component.UIComponent component, java.lang.String summary)
          Enqueue a FacesMessage associated with the specified component, containing the specified summary text and a message severity level of FacesMessage.SEVERITY_ERROR.
protected  void fatal(java.lang.String summary)
          Enqueue a global FacesMessage (not associated with any particular componen) containing the specified summary text and a message severity level of FacesMessage.SEVERITY_FATAL.
protected  void fatal(javax.faces.component.UIComponent component, java.lang.String summary)
          Enqueue a FacesMessage associated with the specified component, containing the specified summary text and a message severity level of FacesMessage.SEVERITY_FATAL.
protected  javax.faces.application.Application getApplication()
          Return the Application instance for the current web application.
protected  java.util.Map getApplicationMap()
          Return a Map of the application scope attributes for this web application.
protected  java.lang.Object getBean(java.lang.String name)
          Return any attribute stored in request scope, session scope, or application scope under the specified name.
protected  java.util.List getCachedExceptions()
          Return a List of the exceptions that have been logged, swallowed, and cached during the processing of this request so far.
protected  javax.faces.context.FacesContext getContext()
          Deprecated. Use getFacesContext() instead
protected  javax.faces.context.ExternalContext getExternalContext()
          Return the ExternalContext instance for the current request.
protected  javax.faces.context.FacesContext getFacesContext()
          Return the FacesContext instance for the current request.
protected  javax.faces.lifecycle.Lifecycle getLifecycle()
          Return the configured Lifecycle instance for the current web application.
protected  java.util.Map getRequestMap()
          Return a Map of the request scope attributes for the current request.
protected  java.util.Map getSessionMap()
          Return a Map of the session scope attributes for the current user's session.
protected  java.lang.Object getValue(java.lang.String expr)
          Evaluate the specified value binding expression, and return the value that it points at.
protected  void info(java.lang.String summary)
          Enqueue a global FacesMessage (not associated with any particular componen) containing the specified summary text and a message severity level of FacesMessage.SEVERITY_INFO.
protected  void info(javax.faces.component.UIComponent component, java.lang.String summary)
          Enqueue a FacesMessage associated with the specified component, containing the specified summary text and a message severity level of FacesMessage.SEVERITY_INFO.
protected  void log(java.lang.String message)
          Log the specified message to the container's log file.
protected  void log(java.lang.String message, java.lang.Throwable throwable)
          Log the specified message and exception to the container's log file.
 java.lang.Object retrieveData(java.lang.String key)
          Return the data object stored (typically when the component tree was previously rendered) under the specified key, if any; otherwise, return null.
 void saveData(java.lang.String key, java.lang.Object data)
          Save the specified data object (which MUST be Serializable) under the specified key, such that it can be retrieved (via getData()) on a s subsequent request immediately after the component tree has been restored.
protected  void setBean(java.lang.String name, java.lang.Object value)
          Replace the value of any attribute stored in request scope, session scope, or application scope under the specified name.
protected  void setValue(java.lang.String expr, java.lang.Object value)
          Evaluate the specified value binding expression, and update the value that it points at.
protected  void warn(java.lang.String summary)
          Enqueue a global FacesMessage (not associated with any particular componen) containing the specified summary text and a message severity level of FacesMessage.SEVERITY_WARN.
protected  void warn(javax.faces.component.UIComponent component, java.lang.String summary)
          Enqueue a FacesMessage associated with the specified component, containing the specified summary text and a message severity level of FacesMessage.SEVERITY_WARN.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FacesBean

public FacesBean()
Method Detail

getApplication

protected javax.faces.application.Application getApplication()

Return the Application instance for the current web application.


getApplicationMap

protected java.util.Map getApplicationMap()

Return a Map of the application scope attributes for this web application.


getCachedExceptions

protected java.util.List getCachedExceptions()

Return a List of the exceptions that have been logged, swallowed, and cached during the processing of this request so far. If there are no such cached exceptions, return null instead.

The application runtime framework causes exceptions thrown from any of the following sources to be logged (to the application server's log), swallowed, and added to this list:


getContext

protected javax.faces.context.FacesContext getContext()
Deprecated. Use getFacesContext() instead

Return the FacesContext instance for the current request. This method has been restored for backwards compatibilty.


getExternalContext

protected javax.faces.context.ExternalContext getExternalContext()

Return the ExternalContext instance for the current request.


getFacesContext

protected javax.faces.context.FacesContext getFacesContext()

Return the FacesContext instance for the current request.


getLifecycle

protected javax.faces.lifecycle.Lifecycle getLifecycle()

Return the configured Lifecycle instance for the current web application.


getRequestMap

protected java.util.Map getRequestMap()

Return a Map of the request scope attributes for the current request.


getSessionMap

protected java.util.Map getSessionMap()

Return a Map of the session scope attributes for the current user's session. Note that calling this method will cause a session to be created if there is not already one associated with this request.


getBean

protected java.lang.Object getBean(java.lang.String name)

Return any attribute stored in request scope, session scope, or application scope under the specified name. If no such attribute is found, and if this name is the registered name of a managed bean, cause a new instance of this managed bean to be created (and stored in an appropriate scope, if necessary) and returned. If no attribute exists, and no managed bean was created, return null.

Parameters:
name - Name of the attribute to be retrieved

setBean

protected void setBean(java.lang.String name,
                       java.lang.Object value)

Replace the value of any attribute stored in request scope, session scope, or application scope under the specified name. If there is no such attribute, create a new request scope attribute under this name, and store the value there.


retrieveData

public java.lang.Object retrieveData(java.lang.String key)

Return the data object stored (typically when the component tree was previously rendered) under the specified key, if any; otherwise, return null.

IMPLEMENTATION NOTE: Data objects will become available only after the Restore View phase of the request processing lifecycle has been completed. A common place to reinitialize state information, then, would be in the preprocess() event handler of a page bean.

Parameters:
key - Key under which to retrieve the requested data

saveData

public void saveData(java.lang.String key,
                     java.lang.Object data)

Save the specified data object (which MUST be Serializable) under the specified key, such that it can be retrieved (via getData()) on a s subsequent request immediately after the component tree has been restored.

IMPLEMENTATION NOTE: In order to successfully save data objects, this method must be called before the Render Response phase of the request processing lifecycle is executed. A common scenario is to save state information in the prerender() event handler of a page bean.

Parameters:
key - Key under which to store the requested data
data - Data object to be stored

getValue

protected java.lang.Object getValue(java.lang.String expr)

Evaluate the specified value binding expression, and return the value that it points at.

Parameters:
expr - Value binding expression (including delimiters)

setValue

protected void setValue(java.lang.String expr,
                        java.lang.Object value)

Evaluate the specified value binding expression, and update the value that it points at.

Parameters:
expr - Value binding expression (including delimiters) that must point at a writeable property
value - New value for the property pointed at by expr

erase

protected void erase()

Erase previously submitted values for all input components on this page. This method MUST be called if you have bound input components to database columns, and then arbitrarily navigate the underlying RowSet to a different row in an event handler method.


log

protected void log(java.lang.String message)

Log the specified message to the container's log file.

Parameters:
message - Message to be logged

log

protected void log(java.lang.String message,
                   java.lang.Throwable throwable)

Log the specified message and exception to the container's log file.

Parameters:
message - Message to be logged
throwable - Exception to be logged

info

protected void info(java.lang.String summary)

Enqueue a global FacesMessage (not associated with any particular componen) containing the specified summary text and a message severity level of FacesMessage.SEVERITY_INFO.

Parameters:
summary - Summary text for this message

info

protected void info(javax.faces.component.UIComponent component,
                    java.lang.String summary)

Enqueue a FacesMessage associated with the specified component, containing the specified summary text and a message severity level of FacesMessage.SEVERITY_INFO.

Parameters:
component - Component with which this message is associated
summary - Summary text for this message

warn

protected void warn(java.lang.String summary)

Enqueue a global FacesMessage (not associated with any particular componen) containing the specified summary text and a message severity level of FacesMessage.SEVERITY_WARN.

Parameters:
summary - Summary text for this message

warn

protected void warn(javax.faces.component.UIComponent component,
                    java.lang.String summary)

Enqueue a FacesMessage associated with the specified component, containing the specified summary text and a message severity level of FacesMessage.SEVERITY_WARN.

Parameters:
component - Component with which this message is associated
summary - Summary text for this message

error

protected void error(java.lang.String summary)

Enqueue a global FacesMessage (not associated with any particular componen) containing the specified summary text and a message severity level of FacesMessage.SEVERITY_ERROR.

Parameters:
summary - Summary text for this message

error

protected void error(javax.faces.component.UIComponent component,
                     java.lang.String summary)

Enqueue a FacesMessage associated with the specified component, containing the specified summary text and a message severity level of FacesMessage.SEVERITY_ERROR.

Parameters:
component - Component with which this message is associated
summary - Summary text for this message

fatal

protected void fatal(java.lang.String summary)

Enqueue a global FacesMessage (not associated with any particular componen) containing the specified summary text and a message severity level of FacesMessage.SEVERITY_FATAL.

Parameters:
summary - Summary text for this message

fatal

protected void fatal(javax.faces.component.UIComponent component,
                     java.lang.String summary)

Enqueue a FacesMessage associated with the specified component, containing the specified summary text and a message severity level of FacesMessage.SEVERITY_FATAL.

Parameters:
component - Component with which this message is associated
summary - Summary text for this message