javax.faces.component
Class UIViewRoot

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by javax.faces.component.UIViewRoot
All Implemented Interfaces:
StateHolder

@JSFComponent(name="f:view",
              bodyContent="JSP",
              tagClass="org.apache.myfaces.taglib.core.ViewTag")
@JSFJspProperty(name="binding",
                returnType="java.lang.String",
                tagExcluded=true)
public class UIViewRoot
extends UIComponentBase

Creates a JSF View, which is a container that holds all of the components that are part of the view.

Unless otherwise specified, all attributes accept static values or EL expressions.

See the javadoc for this class in the JSF Specification for further details.


Field Summary
static String COMPONENT_FAMILY
           
static String COMPONENT_TYPE
           
static String UNIQUE_ID_PREFIX
           
 
Fields inherited from class javax.faces.component.UIComponent
bindings
 
Constructor Summary
UIViewRoot()
          Construct an instance of the UIViewRoot.
 
Method Summary
 void addPhaseListener(PhaseListener phaseListener)
          Adds a The phaseListeners attached to ViewRoot.
 String createUniqueId()
          Provides a unique id for this component instance.
 void encodeBegin(FacesContext context)
           
 void encodeEnd(FacesContext context)
           
 javax.el.MethodExpression getAfterPhaseListener()
          MethodBinding pointing to a method that takes a javax.faces.event.PhaseEvent and returns void, called after every phase except for restore view.
 javax.el.MethodExpression getBeforePhaseListener()
          MethodBinding pointing to a method that takes a javax.faces.event.PhaseEvent and returns void, called before every phase except for restore view.
 String getClientId(FacesContext context)
          DO NOT USE.
 String getFamily()
           
 String getId()
          Get a string which uniquely identifies this UIComponent within the scope of the nearest ancestor NamingContainer component.
 Locale getLocale()
          The locale for this view.
 String getRenderKitId()
          Defines what renderkit should be used to render this view.
 String getViewId()
          A unique identifier for the "template" from which this view was generated.
 boolean isRendered()
          A boolean value that indicates whether this component should be rendered.
 void processApplication(FacesContext context)
           
 void processDecodes(FacesContext context)
           
 void processUpdates(FacesContext context)
          This isn't an input component, so just pass on the processUpdates call to child components and facets that might be input components.
 void processValidators(FacesContext context)
           
 void queueEvent(FacesEvent event)
           
 void removePhaseListener(PhaseListener phaseListener)
          Removes a The phaseListeners attached to ViewRoot.
 void restoreState(FacesContext facesContext, Object state)
          Invoked in the "restore view" phase, this initialises this object's members from the values saved previously into the provided state object.
 Object saveState(FacesContext facesContext)
          Invoked after the render phase has completed, this method returns an object which can be passed to the restoreState of some other instance of UIComponentBase to reset that object's state to the same values as this object currently has.
 void setAfterPhaseListener(javax.el.MethodExpression afterPhaseListener)
          Sets
 void setBeforePhaseListener(javax.el.MethodExpression beforePhaseListener)
          Sets
 void setId(String id)
          DO NOT USE.
 void setLocale(Locale locale)
           
 void setRendered(boolean state)
          DO NOT USE.
 void setRenderKitId(String renderKitId)
           
 void setViewId(String viewId)
           
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeChildren, findComponent, getAttributes, getChildCount, getChildren, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isTransient, processRestoreState, processSaveState, removeFacesListener, restoreAttachedState, saveAttachedState, setParent, setRendererType, setTransient, setValueBinding
 
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression, setValueExpression
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPONENT_TYPE

public static final String COMPONENT_TYPE
See Also:
Constant Field Values

COMPONENT_FAMILY

public static final String COMPONENT_FAMILY
See Also:
Constant Field Values

UNIQUE_ID_PREFIX

public static final String UNIQUE_ID_PREFIX
See Also:
Constant Field Values
Constructor Detail

UIViewRoot

public UIViewRoot()
Construct an instance of the UIViewRoot.

Method Detail

queueEvent

public void queueEvent(FacesEvent event)
Overrides:
queueEvent in class UIComponentBase

processDecodes

public void processDecodes(FacesContext context)
Overrides:
processDecodes in class UIComponentBase

processValidators

public void processValidators(FacesContext context)
Overrides:
processValidators in class UIComponentBase

processUpdates

public void processUpdates(FacesContext context)
Description copied from class: UIComponentBase
This isn't an input component, so just pass on the processUpdates call to child components and facets that might be input components.

Components that were never rendered can't possibly be receiving update data (no corresponding fields were ever put into the response) so if this component is not rendered then this method does not invoke processUpdates on its children.

Overrides:
processUpdates in class UIComponentBase

processApplication

public void processApplication(FacesContext context)

encodeBegin

public void encodeBegin(FacesContext context)
                 throws IOException
Overrides:
encodeBegin in class UIComponentBase
Throws:
IOException

encodeEnd

public void encodeEnd(FacesContext context)
               throws IOException
Overrides:
encodeEnd in class UIComponentBase
Throws:
IOException

createUniqueId

public String createUniqueId()
Provides a unique id for this component instance.


getLocale

@JSFProperty
public Locale getLocale()
The locale for this view.

Defaults to the default locale specified in the faces configuration file.


setLocale

public void setLocale(Locale locale)

getRenderKitId

@JSFProperty
public String getRenderKitId()
Defines what renderkit should be used to render this view.


setRenderKitId

public void setRenderKitId(String renderKitId)

setRendered

@JSFProperty(tagExcluded=true)
public void setRendered(boolean state)
DO NOT USE.

This inherited property is disabled. Although this class extends a base-class that defines a read/write rendered property, this particular subclass does not support setting it. Yes, this is broken OO design: direct all complaints to the JSF spec group.

Overrides:
setRendered in class UIComponentBase

isRendered

public boolean isRendered()
Description copied from class: UIComponentBase
A boolean value that indicates whether this component should be rendered. Default value: true.

Overrides:
isRendered in class UIComponentBase

setId

public void setId(String id)
DO NOT USE.

Although this class extends a base-class that defines a read/write id property, it makes no sense for this particular subclass to support it. The tag library does not export this property for use, but there is no way to "undeclare" a java method. Yes, this is broken OO design: direct all complaints to the JSF spec group.

This property should be disabled (ie throw an exception if invoked). However there are currently several places that call this method (eg during restoreState) so it just does the normal thing for the moment. TODO: fix callers then make this throw an exception.

Overrides:
setId in class UIComponentBase

getId

public String getId()
Description copied from class: UIComponentBase
Get a string which uniquely identifies this UIComponent within the scope of the nearest ancestor NamingContainer component. The id is not necessarily unique across all components in the current view.

Overrides:
getId in class UIComponentBase

getClientId

public String getClientId(FacesContext context)
DO NOT USE.

As this component has no "id" property, it has no clientId property either.

Overrides:
getClientId in class UIComponentBase

getViewId

@JSFProperty(tagExcluded=true)
public String getViewId()
A unique identifier for the "template" from which this view was generated.

Typically this is the filesystem path to the template file, but the exact details are the responsibility of the current ViewHandler implementation.


setViewId

public void setViewId(String viewId)

addPhaseListener

public void addPhaseListener(PhaseListener phaseListener)
Adds a The phaseListeners attached to ViewRoot.


removePhaseListener

public void removePhaseListener(PhaseListener phaseListener)
Removes a The phaseListeners attached to ViewRoot.


getBeforePhaseListener

@JSFProperty(stateHolder=true,
             returnSignature="void",
             methodSignature="javax.faces.event.PhaseEvent",
             jspName="beforePhase")
public javax.el.MethodExpression getBeforePhaseListener()
MethodBinding pointing to a method that takes a javax.faces.event.PhaseEvent and returns void, called before every phase except for restore view.

Returns:
the new beforePhaseListener value

setBeforePhaseListener

public void setBeforePhaseListener(javax.el.MethodExpression beforePhaseListener)
Sets

Parameters:
beforePhaseListener - the new beforePhaseListener value

getAfterPhaseListener

@JSFProperty(stateHolder=true,
             returnSignature="void",
             methodSignature="javax.faces.event.PhaseEvent",
             jspName="afterPhase")
public javax.el.MethodExpression getAfterPhaseListener()
MethodBinding pointing to a method that takes a javax.faces.event.PhaseEvent and returns void, called after every phase except for restore view.

Returns:
the new afterPhaseListener value

setAfterPhaseListener

public void setAfterPhaseListener(javax.el.MethodExpression afterPhaseListener)
Sets

Parameters:
afterPhaseListener - the new afterPhaseListener value

saveState

public Object saveState(FacesContext facesContext)
Description copied from class: UIComponentBase
Invoked after the render phase has completed, this method returns an object which can be passed to the restoreState of some other instance of UIComponentBase to reset that object's state to the same values as this object currently has.

Specified by:
saveState in interface StateHolder
Overrides:
saveState in class UIComponentBase

restoreState

public void restoreState(FacesContext facesContext,
                         Object state)
Description copied from class: UIComponentBase
Invoked in the "restore view" phase, this initialises this object's members from the values saved previously into the provided state object.

Specified by:
restoreState in interface StateHolder
Overrides:
restoreState in class UIComponentBase
state - is an object previously returned by the saveState method of this class.

getFamily

public String getFamily()
Specified by:
getFamily in class UIComponent


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.