@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 implements UniqueIdVendor
Unless otherwise specified, all attributes accept static values or EL expressions.
See the javadoc for this class in the JSF Specification for further details.
Modifier and Type | Field and Description |
---|---|
static String |
COMPONENT_FAMILY |
static String |
COMPONENT_TYPE |
static String |
METADATA_FACET_NAME |
static String |
UNIQUE_ID_PREFIX |
static String |
VIEW_PARAMETERS_KEY |
ATTRS_WITH_DECLARED_DEFAULT_VALUES, BEANINFO_KEY, bindings, COMPOSITE_COMPONENT_TYPE_KEY, COMPOSITE_FACET_NAME, CURRENT_COMPONENT, CURRENT_COMPOSITE_COMPONENT, FACETS_KEY, HONOR_CURRENT_COMPONENT_ATTRIBUTES_PARAM_NAME, VIEW_LOCATION_KEY
Constructor and Description |
---|
UIViewRoot()
Construct an instance of the UIViewRoot.
|
Modifier and Type | Method and Description |
---|---|
void |
addComponentResource(FacesContext context,
UIComponent componentResource) |
void |
addComponentResource(FacesContext context,
UIComponent componentResource,
String target) |
void |
addPhaseListener(PhaseListener phaseListener)
Adds a The phaseListeners attached to ViewRoot.
|
void |
broadcastEvents(FacesContext context,
PhaseId phaseId) |
String |
createUniqueId()
Provides a unique id for this component instance.
|
String |
createUniqueId(FacesContext context,
String seed) |
void |
encodeBegin(FacesContext context) |
void |
encodeChildren(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.
|
Map<String,Object> |
getAttributes()
Get a map through which all the UIComponent's properties, value-bindings and non-property attributes can be read
and written.
|
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.
|
List<UIComponent> |
getComponentResources(FacesContext context,
String target) |
String |
getFamily() |
Locale |
getLocale()
The locale for this view.
|
List<PhaseListener> |
getPhaseListeners() |
String |
getRenderKitId()
Defines what renderkit should be used to render this view.
|
boolean |
getRendersChildren()
Indicates whether this component or its renderer manages the invocation of the rendering methods of its child
components.
|
String |
getViewId()
A unique identifier for the "template" from which this view was generated.
|
List<SystemEventListener> |
getViewListenersForEventClass(Class<? extends SystemEvent> systemEvent) |
Map<String,Object> |
getViewMap() |
Map<String,Object> |
getViewMap(boolean create) |
boolean |
isInView()
Indicate if this component is inside a view,
or in other words is contained by an UIViewRoot
instance (which represents the view).
|
void |
processApplication(FacesContext context) |
void |
processDecodes(FacesContext context) |
void |
processRestoreState(FacesContext context,
Object state) |
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 |
removeComponentResource(FacesContext context,
UIComponent componentResource) |
void |
removeComponentResource(FacesContext context,
UIComponent componentResource,
String target) |
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 |
setInView(boolean isInView)
Define if the component is on the view or not.
|
void |
setLocale(Locale locale) |
void |
setRendered(boolean state)
DO NOT USE.
|
void |
setRenderKitId(String renderKitId) |
void |
setViewId(String viewId) |
void |
subscribeToViewEvent(Class<? extends SystemEvent> systemEvent,
SystemEventListener listener) |
void |
unsubscribeFromViewEvent(Class<? extends SystemEvent> systemEvent,
SystemEventListener listener) |
addClientBehavior, addFacesListener, broadcast, clearInitialState, decode, encodeAll, findComponent, getChildCount, getChildren, getClientBehaviors, getDefaultEventName, getEventNames, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getValueBinding, initialStateMarked, invokeOnComponent, isRendered, isTransient, markInitialState, processSaveState, removeFacesListener, restoreAttachedState, saveAttachedState, setParent, setRendererType, setTransient, setValueBinding, visitTree
getClientId, getCompositeComponentParent, getContainerClientId, getCurrentComponent, getCurrentCompositeComponent, getListenersForEventClass, getNamingContainer, getResourceBundleMap, getStateHelper, getStateHelper, getTransientStateHelper, getTransientStateHelper, getValueExpression, isCompositeComponent, isVisitable, popComponentFromEL, processEvent, pushComponentToEL, restoreTransientState, saveTransientState, setValueExpression, subscribeToEvent, unsubscribeFromEvent
public static final String COMPONENT_FAMILY
public static final String COMPONENT_TYPE
public static final String METADATA_FACET_NAME
public static final String UNIQUE_ID_PREFIX
public static final String VIEW_PARAMETERS_KEY
public void addComponentResource(FacesContext context, UIComponent componentResource)
public void addComponentResource(FacesContext context, UIComponent componentResource, String target)
public void addPhaseListener(PhaseListener phaseListener)
public void broadcastEvents(FacesContext context, PhaseId phaseId)
public String createUniqueId()
public String createUniqueId(FacesContext context, String seed)
createUniqueId
in interface UniqueIdVendor
public void encodeBegin(FacesContext context) throws IOException
encodeBegin
in class UIComponentBase
IOException
public void encodeChildren(FacesContext context) throws IOException
encodeChildren
in class UIComponentBase
IOException
public void encodeEnd(FacesContext context) throws IOException
encodeEnd
in class UIComponentBase
IOException
@JSFProperty(returnSignature="void", methodSignature="javax.faces.event.PhaseEvent", jspName="afterPhase", stateHolder=true) public javax.el.MethodExpression getAfterPhaseListener()
@JSFProperty(returnSignature="void", methodSignature="javax.faces.event.PhaseEvent", jspName="beforePhase", stateHolder=true) public javax.el.MethodExpression getBeforePhaseListener()
public String getClientId(FacesContext context)
As this component has no "id" property, it has no clientId property either.
getClientId
in class UIComponentBase
public List<UIComponent> getComponentResources(FacesContext context, String target)
public String getFamily()
getFamily
in class UIComponent
@JSFProperty public Locale getLocale()
Defaults to the default locale specified in the faces configuration file.
public List<PhaseListener> getPhaseListeners()
@JSFProperty public String getRenderKitId()
public boolean getRendersChildren()
UIComponentBase
getRendersChildren
in class UIComponentBase
@JSFProperty(tagExcluded=true) public String getViewId()
Typically this is the filesystem path to the template file, but the exact details are the responsibility of the current ViewHandler implementation.
public boolean isInView()
isInView
in class UIComponent
public void processApplication(FacesContext context)
public void processDecodes(FacesContext context)
processDecodes
in class UIComponentBase
public void processRestoreState(FacesContext context, Object state)
processRestoreState
in class UIComponentBase
public void queueEvent(FacesEvent event)
queueEvent
in class UIComponentBase
public void processValidators(FacesContext context)
processValidators
in class UIComponentBase
public void processUpdates(FacesContext context)
UIComponentBase
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.
processUpdates
in class UIComponentBase
public void setLocale(Locale locale)
public void setRenderKitId(String renderKitId)
@JSFProperty(tagExcluded=true) public void setRendered(boolean state)
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.
setRendered
in class UIComponentBase
public void setId(String id)
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.
setId
in class UIComponentBase
public void setInView(boolean isInView)
This value is set in the following conditions:
setInView
in class UIComponent
public void removeComponentResource(FacesContext context, UIComponent componentResource)
public void removeComponentResource(FacesContext context, UIComponent componentResource, String target)
public void setViewId(String viewId)
public void removePhaseListener(PhaseListener phaseListener)
public void setBeforePhaseListener(javax.el.MethodExpression beforePhaseListener)
beforePhaseListener
- the new beforePhaseListener valuepublic void setAfterPhaseListener(javax.el.MethodExpression afterPhaseListener)
afterPhaseListener
- the new afterPhaseListener valuepublic Map<String,Object> getAttributes()
UIComponentBase
When writing to the returned map:
When reading from the returned map:
Assigning values to the map which are not explicit properties on the underlying component can be used to "tunnel" attributes from the JSP tag (or view-specific equivalent) to the associated renderer without modifying the component itself.
Any value-bindings and non-property attributes stored in this map are automatically serialized along with the component when the view is serialized.
getAttributes
in class UIComponentBase
public Object saveState(FacesContext facesContext)
UIComponentBase
saveState
in interface StateHolder
saveState
in class UIComponentBase
public void restoreState(FacesContext facesContext, Object state)
UIComponentBase
restoreState
in interface StateHolder
restoreState
in class UIComponentBase
state
- is an object previously returned by the saveState method of this class.public List<SystemEventListener> getViewListenersForEventClass(Class<? extends SystemEvent> systemEvent)
public void subscribeToViewEvent(Class<? extends SystemEvent> systemEvent, SystemEventListener listener)
public void unsubscribeFromViewEvent(Class<? extends SystemEvent> systemEvent, SystemEventListener listener)
Copyright © 2016 The Apache Software Foundation. All Rights Reserved.