UIComponent is the base class for all user interface components in Jakarta Server
Faces. The set of UIComponent instances associated with a particular request and response are organized into
a component tree under a UIViewRoot that represents the entire content of the request or response.
For the convenience of component developers, UIComponentBase provides the default behavior that is specified
for a UIComponent, and is the base class for all of the concrete UIComponent "base" implementations.
Component writers are encouraged to subclass UIComponentBase, instead of directly implementing this abstract
class, to reduce the impact of any future changes to the method signatures.
If the jakarta.faces.event.ListenerFor annotation is attached to the class definition of a
Component, that class must also implement jakarta.faces.event.ComponentSystemEventListener.
Dynamically modifying the component tree can happen at any time, during and after restoring the view, but not during state saving and needs to function properly with respect to rendering and state saving
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | |
| pack-priv static enum | UIComponent.PropertyKeys
Properties that are tracked by state saving. |
| pack-priv static enum |
| Modifier and Type | Field and Description |
|---|---|
| private static final String | _CURRENT_COMPONENT_STACK_KEY
key used to look up current component stack if FacesContext attributes |
| private static final String | _CURRENT_COMPOSITE_COMPONENT_STACK_KEY
key used to look up current composite component stack if FacesContext attributes |
| private int | _isPushedAsCurrentRefCount
Track whether we have been pushed as current in order to handle mismatched pushes and pops of Jakarta Expression Language context stack. |
| pack-priv List | attributesThatAreSet
List of attributes that have been set on the component (this may be from setValueExpression, the attributes map, or setters from the concrete HTML components. |
| public static final String | ATTRS_WITH_DECLARED_DEFAULT_VALUES
This constant enables one to quickly discover the names of the declared composite component attributes that have been given default values by the composite component author. |
| public static final String | BEANINFO_KEY
The value of this constant is used as the key in the component attribute map, the value for which is a
|
| protected Map | bindings
Deprecated
|
| public static final String | COMPOSITE_COMPONENT_TYPE_KEY
The value of this constant is used as the key in the composite component BeanDescriptor for a
|
| public static final String | COMPOSITE_FACET_NAME
The value of this constant is used as the key in the |
| pack-priv UIComponent | |
| public static final String | FACETS_KEY
The value of this constant is used as the key in the composite component BeanDescriptor for the
|
| pack-priv boolean | |
| private transient Boolean | |
| private boolean | |
| private static Logger | |
| private Map | |
| pack-priv ComponentStateHelper | |
| public static final String | VIEW_LOCATION_KEY
The value of this constant is used as the key in the component attributes |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static ArrayDeque | |
| protected abstract void | addFacesListener(FacesListener
The listener)FacesListener to be registered
Add the specified |
| public abstract void | broadcast(FacesEvent
The event)FacesEvent to be broadcast
Broadcast the specified |
| public void | clearInitialState()
Implements jakarta.
An implementation of |
| public abstract void | decode(FacesContext
FacesContext for the request we are processing
Decode any new state of this |
| public void | encodeAll(FacesContext
the Faces context. context)
If this component returns |
| public abstract void | encodeBegin(FacesContext
FacesContext for the response we are creating
If our |
| public abstract void | encodeChildren(FacesContext
FacesContext for the response we are creating
If our |
| public abstract void | encodeEnd(FacesContext
FacesContext for the response we are creating
If our |
| public abstract UIComponent | findComponent(String
Search expression identifying the expr)UIComponent to be returned
Search for and return the |
| private Resource | findComponentResourceBundleLocaleMatch(FacesContext context, String resourceName, String libraryName)
|
| private ResourceBundle | |
| private ResourceBundle | |
| public abstract Map | Returns: the component attribute map.
Return a mutable |
| public abstract int | Returns: the number of child components.
Return the number of child |
| public abstract List | Returns: the list of children.
Return a mutable |
| public String | Returns: the client id.
Enable Jakarta Expression Language to access the |
| public abstract String | Returns: the client id.The context)FacesContext for the current requestReturn a client-side identifier for this component, generating one if necessary. |
| public static UIComponent | Returns: ifcomponent is null, return null, otherwise search the component's
parent hierachy for the nearest parent composite component. If no parent composite component is found, return
nullthe component from which to start the search from component)Finds the nearest composite component parent of the specified component. |
| public String | Returns: the container client id.the Faces context. context)
Allow components that implement |
| public static UIComponent | Returns: the current component, ornull.FacesContext for the request we are processing
Return the |
| public static UIComponent | Returns: the current composite component, ornull.FacesContext for the request we are processing
Return the closest ancestor component, relative to the component returned from |
| protected abstract FacesContext | Returns: the Faces context.
Convenience method to return the |
| protected abstract FacesListener[] | Returns: the Faces listeners, or a zero-length array.Class that must be implemented by a clazz)FacesListener for it to be returned
Return an array of registered |
| public abstract UIComponent | |
| public int | Returns: the number of facets.
Return the number of facet |
| public abstract Map | Returns: the map of facets.
Return a mutable |
| public abstract Iterator | Returns: the facets and children iterator.
Return an |
| public abstract String | Returns: the component family (not null).Return the identifier of the component family to which this component belongs. |
| public abstract String | |
| public List | Returns: the list of listeners, nevernull.the event class. eventClass)Implements jakarta.
This implementation throws |
| public UIComponent | Returns: the naming container, ornull.
Starting with "this", return the closest component in the ancestry that is a |
| public abstract UIComponent | Returns: the parent component.
Return the parent |
| public Map | Returns: the pass-through attribute map.
This is a convenience method that simply calls |
| public Map | Returns: AMap instance, or null.if create)true, a new Map instance will be created if it does not exist already. If
false, and there is no existing Map instance, one will not be created and null
will be returned.
This method has the same specification as |
| protected abstract Renderer | Returns: the renderer, ornull.FacesContext for the current request
Convenience method to return the |
| public abstract String | Returns: the renderer type.
Return the |
| public abstract boolean | Returns: true if the component renders its children, false otherwise.Return a flag indicating whether this component is responsible for rendering its child components. |
| public Map | Returns: the resource bundle map.
Return a |
| protected StateHelper | Returns: the state helper.
Return the |
| protected StateHelper | Returns: the state helper.if create)true, a new StateHelper instance will be created if it does not exist already.
If false, and there is no existing StateHelper instance, one will not be created and
null will be returned.
Like |
| public TransientStateHelper | Returns: the transient state helper.
Return the |
| public TransientStateHelper | Returns: the transient state helper.if create)true create, if necessary, any internal data structures. If false, do not
create any instances. In this case, it is possible for this method to return null.
Return the |
| public ValueExpression | Returns: the value expression, ornull.Name of the attribute or property for which to retrieve a name)ValueExpression
Return the |
| public boolean | initialStateMarked()
Implements jakarta.
An implementation of |
| public boolean | Returns: true if the a component with the given clientId is found, the callback method was
successfully invoked passing that component as an argument, and no Exception was thrown. Returns false
if no component with the given clientId is found.the context, String FacesContext for the current requestthe client identifier of the component to be passed to the argument callback. clientId, ContextCallback an implementation of the Callback interface. callback)
Starting at this component in the View hierarchy, search for a component
with a |
| public static boolean | Returns: true if this is a composite component, false otherwise.the component)UIComponent to test
Return |
| public boolean | Returns: true if within a view hierarchy, false otherwise.
Return |
| public abstract boolean | Returns: true if the component should be rendered, false otherwise.
Return |
| protected boolean | Returns: true if visitable, false otherwise.the Visit context. context)
Return |
| public void | markInitialState()
Implements jakarta.
An implementation of |
| public void | popComponentFromEL(FacesContext
the context)FacesContext for the current request
Pop the current |
| public abstract void | processDecodes(FacesContext
FacesContext for the request we are processingPerform the component tree processing required by the Apply Request Values phase of the request processing lifecycle for all facets of this component, all children of this component, and this component itself, as follows. |
| public void | processEvent(ComponentSystemEvent
the event)ComponentSystemEvent instance that is being processed.Implements jakarta. The default implementation performs the following action. |
| public abstract void | processRestoreState(FacesContext
FacesContext for the request we are processingthe state. state)Perform the component tree processing required by the Restore View phase of the request processing lifecycle for all facets of this component, all children of this component, and this component itself, as follows. |
| public abstract Object | Returns: the saved state.FacesContext for the request we are processingPerform the component tree processing required by the state saving portion of the Render Response phase of the request processing lifecycle for all facets of this component, all children of this component, and this component itself, as follows. |
| public abstract void | processUpdates(FacesContext
FacesContext for the request we are processingPerform the component tree processing required by the Update Model Values phase of the request processing lifecycle for all facets of this component, all children of this component, and this component itself, as follows. |
| public abstract void | processValidators(FacesContext
FacesContext for the request we are processingPerform the component tree processing required by the Process Validations phase of the request processing lifecycle for all facets of this component, all children of this component, and this component itself, as follows. |
| public void | pushComponentToEL(FacesContext
the context, UIComponent FacesContext for the current requestthe component)component to push to the EL. If component is null the
UIComponent instance that this call was invoked upon will be pushed to the EL.
Push the current |
| public abstract void | queueEvent(FacesEvent
FacesEvent to be queuedQueue an event for broadcast at the end of the current request processing lifecycle phase. |
| protected abstract void | removeFacesListener(FacesListener
The listener)FacesListener to be deregistered
Remove the specified |
| public void | restoreTransientState(FacesContext
the Faces context context, Object the object containing transient values state)Implements jakarta.
For components that need to support the concept of transient state, this method will restore any state saved on a
prior call to |
| public Object | saveTransientState(FacesContext
the Faces context. context)Implements jakarta. For components that need to support the concept of transient state, this method will save any state that is known to be transient in nature. |
| public abstract void | setId(String
The new component identifier, or id)null to indicate that this UIComponent does not have
a component identifier
Set the component identifier of this |
| public void | setInView(boolean
flag indicating whether or not this component is within the view hierachy isInView)Updates the status as to whether or not this component is currently within the view hierarchy. |
| public abstract void | setParent(UIComponent
The new parent, or parent)null for the root node of a component tree
Set the parent |
| public abstract void | setRendered(boolean
If rendered)true render this component; otherwise, do not render this component
Set the |
| public abstract void | setRendererType(String
Logical identifier of the type of rendererType)Renderer to use, or null for components
that render themselves
Set the |
| public void | setValueExpression(String
Name of the attribute or property for which to set a name, ValueExpression binding)ValueExpression
Set the |
| public void | subscribeToEvent(Class<? extends SystemEvent>
the event class. eventClass, ComponentSystemEventListener the listener. componentListener)
This implementation throws |
| public void | unsubscribeFromEvent(Class<? extends SystemEvent>
the event class. eventClass, ComponentSystemEventListener the component listener. componentListener)
This implementation throws |
| public boolean | Returns: component implementations may returntrue to indicate that the tree visit is complete (eg. all
components that need to be visited have been visited). This results in the tree visit being short-circuited such that
no more components are visited.the visitContext, VisitCallback VisitContext for this visitthe callback)VisitCallback instance whose visit method will be called for each node
visited.Perform a tree visit starting at this node in the tree. |
| private Map |