Home » Mojarra-2.0.1 » javax » faces » component » [javadoc | source]
abstract public class: UIComponentBase [javadoc | source]

All Implemented Interfaces:
    PartialStateHolder, ComponentSystemEventListener, SystemEventListenerHolder

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. As of version 1.2 of the JavaServer Faces Specification, component authors are encouraged to return true from this method and rely on the implementation of #encodeChildren in this class and in the Renderer (Renderer#encodeChildren ). Subclasses that wish to manage the rendering of their children should override this method to return true instead.

Fields inherited from javax.faces.component.UIComponent:
 public UIComponentBase() 
Method from javax.faces.component.UIComponentBase Summary:
addClientBehavior,   addFacesListener,   broadcast,   clearInitialState,   decode,   encodeBegin,   encodeChildren,   encodeEnd,   findComponent,   getAttributes,   getChildCount,   getChildren,   getClientBehaviors,   getClientId,   getDefaultEventName,   getDescriptorMap,   getEventNames,   getFacesContext,   getFacesListeners,   getFacet,   getFacetCount,   getFacets,   getFacetsAndChildren,   getId,   getParent,   getRenderer,   getRendererType,   getRendersChildren,   getValueBinding,   invokeOnComponent,   isRendered,   isTransient,   markInitialState,   processDecodes,   processRestoreState,   processSaveState,   processUpdates,   processValidators,   queueEvent,   removeFacesListener,   restoreAttachedState,   restoreState,   saveAttachedState,   saveState,   setId,   setParent,   setRendered,   setRendererType,   setTransient,   setValueBinding
Methods from javax.faces.component.UIComponent:
addFacesListener,   broadcast,   clearInitialState,   decode,   encodeAll,   encodeBegin,   encodeChildren,   encodeEnd,   findComponent,   getAttributes,   getChildCount,   getChildren,   getClientId,   getClientId,   getCompositeComponentParent,   getContainerClientId,   getCurrentComponent,   getCurrentCompositeComponent,   getFacesContext,   getFacesListeners,   getFacet,   getFacetCount,   getFacets,   getFacetsAndChildren,   getFamily,   getId,   getListenersForEventClass,   getNamingContainer,   getParent,   getRenderer,   getRendererType,   getRendersChildren,   getResourceBundleMap,   getStateHelper,   getStateHelper,   getValueBinding,   getValueExpression,   initialStateMarked,   invokeOnComponent,   isCompositeComponent,   isInView,   isRendered,   isVisitable,   markInitialState,   popComponentFromEL,   processDecodes,   processEvent,   processRestoreState,   processSaveState,   processUpdates,   processValidators,   pushComponentToEL,   queueEvent,   removeFacesListener,   setId,   setInView,   setParent,   setRendered,   setRendererType,   setValueBinding,   setValueExpression,   subscribeToEvent,   unsubscribeFromEvent,   visitTree
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.faces.component.UIComponentBase Detail:
 public  void addClientBehavior(String eventName,
    ClientBehavior behavior) 
 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); } ... }

 public  void broadcast(FacesEvent event) throws AbortProcessingException 
 public  void clearInitialState() 
 public  void decode(FacesContext context) 
 public  void encodeBegin(FacesContext context) throws IOException 
 public  void encodeChildren(FacesContext context) throws IOException 
 public  void encodeEnd(FacesContext context) throws IOException 
 public UIComponent findComponent(String expr) 
 public Map<String, Object> getAttributes() 
 public int getChildCount() 
 public List<UIComponent> getChildren() 
 public Map<ClientBehavior> getClientBehaviors() 
 public String getClientId(FacesContext context) 
 public String getDefaultEventName() 
 Map<String, PropertyDescriptor> getDescriptorMap() 
 public Collection<String> getEventNames() 
 protected FacesContext getFacesContext() 
 protected FacesListener[] getFacesListeners(Class clazz) 
 public UIComponent getFacet(String name) 
 public int getFacetCount() 
 public Map<String, UIComponent> getFacets() 
 public Iterator<UIComponent> getFacetsAndChildren() 
 public String getId() 
 public UIComponent getParent() 
 protected Renderer getRenderer(FacesContext context) 
 public String getRendererType() 
 public boolean getRendersChildren() 
 public ValueBinding getValueBinding(String name) 
Deprecated! This - has been replaced by #getValueExpression .

 public boolean invokeOnComponent(FacesContext context,
    String clientId,
    ContextCallback callback) throws FacesException 
 public boolean isRendered() 
 public boolean isTransient() 
 public  void markInitialState() 
 public  void processDecodes(FacesContext context) 
 public  void processRestoreState(FacesContext context,
    Object state) 
 public Object processSaveState(FacesContext context) 
 public  void processUpdates(FacesContext context) 
 public  void processValidators(FacesContext context) 
 public  void queueEvent(FacesEvent event) 
 protected  void removeFacesListener(FacesListener listener) 

    Remove the specified FacesListener from the set of listeners registered to receive event notifications from this UIComponent .

 public static Object restoreAttachedState(FacesContext context,
    Object stateObj) throws IllegalStateException 
 public  void restoreState(FacesContext context,
    Object state) 
 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 Collections of these objects. If any contained objects are not Collections 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.

 public Object saveState(FacesContext context) 
 public  void setId(String id) 
 public  void setParent(UIComponent parent) 
 public  void setRendered(boolean rendered) 
 public  void setRendererType(String rendererType) 
 public  void setTransient(boolean transientFlag) 
 public  void setValueBinding(String name,
    ValueBinding binding) 
Deprecated! This - has been replaced by #setValueExpression .