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

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 Javadoc of JSF Specification

Version:
$Revision: 949070 $ $Date: 2010-05-27 21:22:03 -0500 (Thu, 27 May 2010) $
Author:
Manfred Geiler (latest modification by $Author: lu4242 $)

Field Summary
static String COMPONENT_FAMILY
           
static String COMPONENT_TYPE
           
static String UNIQUE_ID_PREFIX
           
 
Constructor Summary
UIViewRoot()
           
 
Method Summary
 String createUniqueId()
          Provides a unique id for this component instance.
 void encodeBegin(FacesContext context)
           
 String getClientId(FacesContext context)
          DO NOT USE.
 String getFamily()
           
 String getId()
          An identifier for this particular component instance within a component view.
 Locale getLocale()
          The locale of this view.
 String getRenderKitId()
          Defines what renderkit should be used to render this view.
 String getViewId()
           
 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 restoreState(FacesContext context, 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 context)
          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 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, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getFacesContext, getFacesListeners, getFacet, getFacets, getFacetsAndChildren, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, isTransient, processRestoreState, processSaveState, removeFacesListener, restoreAttachedState, saveAttachedState, setParent, setRendererType, setTransient, setValueBinding
 
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()
Method Detail

getViewId

public String getViewId()

setViewId

public void setViewId(String viewId)

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

createUniqueId

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


getLocale

public Locale getLocale()
The locale of this view. Default: the default locale from the configuration file.


setLocale

public void setLocale(Locale locale)

getFamily

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

getRenderKitId

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

Note that in JSF1.1 this property cannot be set via the f:view tag (this is possible in JSF1.2).


setRenderKitId

public void setRenderKitId(String renderKitId)

setRendered

public void setRendered(boolean state)
DO NOT USE.

Although this class extends a base-class that defines a read/write rendered property, it makes no sense for this particular subclass to support it. Yes, this is broken OO design: direct all complaints to the JSF spec group.

Ideally this method would throw an UnsupportedOperationException when invoked. Unfortunately, the JSF TCK calls this method, so instead we just pass on the call to the default inherited implementation.

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
An identifier for this particular component instance within a component view.

The id must be unique within the scope of the tag's enclosing NamingContainer (eg h:form or f:subview). The id is not necessarily unique across all components in the current view

This value must be a static value, ie not change over the lifetime of a component. It cannot be defined via an EL expression; only a string is permitted.

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.

Ideally, this method would just return null when called (or even throw an exception) Unforunately, the TCK invokes it so we just invoke the interited implementation instead.

Overrides:
getClientId in class UIComponentBase

saveState

public Object saveState(FacesContext context)
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 context,
                         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.


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