Class Hierarchy All Classes All Fields and Methods
Class javax.faces.component.UIComponentBase
java.lang.Object javax.faces.component.UIComponent javax.faces.component.UIComponentBasepublic abstract class UIComponentBase
extends UIComponent
UIComponentBase is a convenience base class that implements the default concrete behavior of all methods defined by UIComponent.
By default, this class defines getRendersChildren() to find the renderer for this component and call its getRendersChildren() method. The default implementation on the Renderer returns false. Subclasses that wish to manage the rendering of their children should override this method to return true instead.
Constructor Index Constructor Description UIComponentBase()
Method Index Method Description void addFacesListener(FacesListener) Add the specified FacesListener to the set of listeners registered to receive event notifications from this UIComponent. void broadcast(FacesEvent) void decode(FacesContext) void encodeBegin(FacesContext) void encodeChildren(FacesContext) void encodeEnd(FacesContext) UIComponent findComponent(String) Map getAttributes() int getChildCount() List getChildren() String getClientId(FacesContext) FacesContext getFacesContext() FacesListener[] getFacesListeners(Class) UIComponent getFacet(String) Map getFacets() Iterator getFacetsAndChildren() String getId() UIComponent getParent() Renderer getRenderer(FacesContext) String getRendererType() boolean getRendersChildren() ValueBinding getValueBinding(String) boolean isRendered() boolean isTransient() void processDecodes(FacesContext) void processRestoreState(FacesContext, Object) Object processSaveState(FacesContext) void processUpdates(FacesContext) void processValidators(FacesContext) void queueEvent(FacesEvent) void removeFacesListener(FacesListener) Remove the specified FacesListener from the set of listeners registered to receive event notifications from this UIComponent. Object restoreAttachedState(FacesContext, Object) This method is called by UIComponent subclasses that need to restore the objects they saved using saveAttachedState. void restoreState(FacesContext, Object) Object saveAttachedState(FacesContext, Object) This method is called by UIComponent subclasses that want to save one or more attached objects. Object saveState(FacesContext) void setId(String) void setParent(UIComponent) void setRendered(boolean) void setRendererType(String) void setTransient(boolean) void setValueBinding(String, ValueBinding)
Constructors
UIComponentBase
public UIComponentBase()
Methods
addFacesListener
protected void addFacesListener(FacesListener listener)
Add the specified FacesListener to the set of listeners registered to receive event notifications from this UIComponent. It is expected that UIComponent classes acting as event sources will have corresponding typesafe APIs for registering listeners of the required type, and the implementation of those registration methods will delegate to this method. For example:
public class FooEvent extends FacesEvent { ... protected boolean isAppropriateListener(FacesListener listener) { return (listener instanceof FooListener); } protected void processListener(FacesListener listener) { ((FooListener) listener).processFoo(this); } ... } public interface FooListener extends FacesListener { public void processFoo(FooEvent event); } public class FooComponent extends UIComponentBase { ... public void addFooListener(FooListener listener) { addFacesListener(listener); } public void removeFooListener(FooListener listener) { removeFacesListener(listener); } ... }
- Parameters
- listener - The FacesListener to be registered
- Throws
- NullPointerException if listener is null
- Overrides
- addFacesListener in class UIComponent
broadcast
public void broadcast(FacesEvent event) throws AbortProcessingException
- Throws
- AbortProcessingException {@inheritDoc}
- Throws
- IllegalStateException {@inheritDoc}
- Throws
- NullPointerException {@inheritDoc}
- Overrides
- broadcast in class UIComponent
decode
public void decode(FacesContext context)
- Throws
- NullPointerException {@inheritDoc}
- Overrides
- decode in class UIComponent
encodeBegin
public void encodeBegin(FacesContext context) throws IOException
- Throws
- NullPointerException {@inheritDoc}
- Overrides
- encodeBegin in class UIComponent
encodeChildren
public void encodeChildren(FacesContext context) throws IOException
- Throws
- NullPointerException {@inheritDoc}
- Overrides
- encodeChildren in class UIComponent
encodeEnd
public void encodeEnd(FacesContext context) throws IOException
- Throws
- NullPointerException {@inheritDoc}
- Overrides
- encodeEnd in class UIComponent
findComponent
public UIComponent findComponent(String expr)
- Throws
- NullPointerException {@inheritDoc}
- Overrides
- findComponent in class UIComponent
getAttributes
public Map getAttributes()
getChildCount
public int getChildCount()
getChildren
public List getChildren()
getClientId
public String getClientId(FacesContext context)
- Throws
- NullPointerException {@inheritDoc}
- Overrides
- getClientId in class UIComponent
getFacesContext
protected FacesContext getFacesContext()
getFacesListeners
protected FacesListener[] getFacesListeners(Class clazz)
- Throws
- IllegalArgumentException {@inheritDoc}
- Throws
- NullPointerException {@inheritDoc}
- Overrides
- getFacesListeners in class UIComponent
getFacet
public UIComponent getFacet(String name)
getFacets
public Map getFacets()
getFacetsAndChildren
public Iterator getFacetsAndChildren()
getId
public String getId()
getParent
public UIComponent getParent()
getRenderer
protected Renderer getRenderer(FacesContext context)
getRendererType
public String getRendererType()
getRendersChildren
public boolean getRendersChildren()
getValueBinding
public ValueBinding getValueBinding(String name)
- Throws
- NullPointerException {@inheritDoc}
- Overrides
- getValueBinding in class UIComponent
isRendered
public boolean isRendered()
isTransient
public boolean isTransient()
processDecodes
public void processDecodes(FacesContext context)
- Throws
- NullPointerException {@inheritDoc}
- Overrides
- processDecodes in class UIComponent
processRestoreState
public void processRestoreState(FacesContext context, Object state)
- Throws
- NullPointerException {@inheritDoc}
- Overrides
- processRestoreState in class UIComponent
processSaveState
public Object processSaveState(FacesContext context)
- Throws
- NullPointerException {@inheritDoc}
- Overrides
- processSaveState in class UIComponent
processUpdates
public void processUpdates(FacesContext context)
- Throws
- NullPointerException {@inheritDoc}
- Overrides
- processUpdates in class UIComponent
processValidators
public void processValidators(FacesContext context)
- Throws
- NullPointerException {@inheritDoc}
- Overrides
- processValidators in class UIComponent
queueEvent
public void queueEvent(FacesEvent event)
- Throws
- IllegalStateException {@inheritDoc}
- Throws
- NullPointerException {@inheritDoc}
- Overrides
- queueEvent in class UIComponent
removeFacesListener
protected void removeFacesListener(FacesListener listener)
Remove the specified FacesListener from the set of listeners registered to receive event notifications from this UIComponent.
- Parameters
- listener - The FacesListener to be deregistered
- Throws
- NullPointerException if listener is null
- Overrides
- removeFacesListener in class UIComponent
restoreAttachedState
public static Object restoreAttachedState(FacesContext context, Object stateObj) throws IllegalStateException
This method is called by UIComponent subclasses that need to restore the objects they saved using saveAttachedState. This method is tightly coupled with saveAttachedState.
This method supports restoring all attached objects types supported by saveAttachedState.
- Parameters
- context - the FacesContext for this request
- stateObj - the opaque object returned from saveAttachedState
- Throws
- NullPointerException if context is null.
- Throws
- IllegalStateException if the object is not previously returned by saveAttachedState.
restoreState
public void restoreState(FacesContext context, Object state)
saveAttachedState
public static Object saveAttachedState(FacesContext context, Object attachedObject)
This method is called by UIComponent subclasses that want to save one or more attached objects. It is a convenience method that does the work of saving attached objects that may or may not implement the StateHolder interface. Using this method implies the use of restoreAttachedState to restore the attached objects.
This method supports saving attached objects of the following type: Objects, null values, and Lists of these objects. If any contained objects are not Lists and do not implement StateHolder, they must have zero-argument public constructors. The exact structure of the returned object is undefined and opaque, but will be serializable.
- Parameters
- context - the FacesContext for this request.
- attachedObject - the object, which may be a List instance, or an Object. The attachedObject (or the elements that comprise attachedObject may implement StateHolder.
- Throws
- NullPointerException if the context argument is null.
saveState
public Object saveState(FacesContext context)
setId
public void setId(String id)
- Throws
- IllegalArgumentException {@inheritDoc}
- Throws
- IllegalStateException {@inheritDoc}
- Overrides
- setId in class UIComponent
setParent
public void setParent(UIComponent parent)
setRendered
public void setRendered(boolean rendered)
setRendererType
public void setRendererType(String rendererType)
setTransient
public void setTransient(boolean transientFlag)
setValueBinding
public void setValueBinding(String name, ValueBinding binding)
- Throws
- IllegalArgumentException {@inheritDoc}
- Throws
- NullPointerException {@inheritDoc}
- Overrides
- setValueBinding in class UIComponent
Class Hierarchy All Classes All Fields and Methods