@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 |
static String |
VIEWROOT_PHASE_LISTENER_QUEUES_EXCEPTIONS_PARAM_NAME |
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.
|
List<UIComponent> |
getComponentResources(FacesContext context) |
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 |
resetValues(FacesContext context,
Collection<String> clientIds) |
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.
|
void |
restoreViewScopeState(FacesContext facesContext,
Object state) |
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)
Set an identifier for this component which is unique within the scope of the nearest ancestor NamingContainer
component.
|
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, getClientId, getDefaultEventName, getEventNames, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getPassThroughAttributes, getRenderer, getRendererType, getValueBinding, invokeOnComponent, isRendered, isTransient, markInitialState, processSaveState, removeFacesListener, restoreAttachedState, saveAttachedState, setParent, setRendererType, setTransient, setValueBinding, visitTree
getClientId, getCompositeComponentParent, getContainerClientId, getCurrentComponent, getCurrentCompositeComponent, getListenersForEventClass, getNamingContainer, getPassThroughAttributes, getResourceBundleMap, getStateHelper, getStateHelper, getTransientStateHelper, getTransientStateHelper, getValueExpression, initialStateMarked, 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
@JSFWebConfigParam(defaultValue="false", expectedValues="true, false", since="2.3") public static final String VIEWROOT_PHASE_LISTENER_QUEUES_EXCEPTIONS_PARAM_NAME
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 List<UIComponent> getComponentResources(FacesContext context, String target)
public List<UIComponent> getComponentResources(FacesContext context)
context
- 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
@JSFProperty(tagExcluded=true) public void setId(String id)
UIComponentBase
The id must start with an underscore if it is generated by the JSF framework, and must not start with an underscore if it has been specified by the user (eg in a JSP tag).
The first character of the id must be an underscore or letter. Following characters may be letters, digits, underscores or dashes.
Null is allowed as a parameter, and will reset the id to null.
The clientId of this component is reset by this method; see getClientId for more info.
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 void resetValues(FacesContext context, Collection<String> clientIds)
context
- clientIds
- 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 void restoreViewScopeState(FacesContext facesContext, Object state)
facesContext
- state
- 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 © 2020 The Apache Software Foundation. All rights reserved.