|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.faces.component.UIComponentBase
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
return false. Subclasses that wish to manage the rendering
of their children should override this method to return true
instead.
By default, this class defines getRendersSelf() to
return false. Subclasses that have directly implemented
decoding and encoding functionality, without the requirement for an
associated Renderer, should override this method to return
true instead.
| Field Summary |
| Fields inherited from interface javax.faces.component.UIComponent |
SEPARATOR_CHAR |
| Constructor Summary | |
UIComponentBase()
|
|
| Method Summary | |
void |
addChild(int index,
UIComponent component)
Insert the specified UIComponent at the specified
position in the child list for this component. |
void |
addChild(UIComponent component)
Append the specified UIComponent to the end of the
child list for this component. |
void |
addFacet(java.lang.String facetName,
UIComponent facet)
Add the specified UIComponent as a facet
associated with the name specified by the facetName
argument, replacing any previous facet with that name. |
void |
addValidator(Validator validator)
Add a Validator instance to the set associated with
this UIComponent. |
boolean |
broadcast(FacesEvent event,
PhaseId phaseId)
Broadcast the specified FacesEvent to all registered
event listeners who have expressed an interest in events of this
type, for the specified PhaseId (or for any phase, if the
listener returns PhaseId.ANY_PHASE from its
getPhaseId() method. |
void |
clearChildren()
Remove all child UIComponents from the child list. |
void |
clearFacets()
Remove all facet UIComponents from this component. |
void |
clearValidators()
Clear any Validators that have been registered for
processing by this component. |
boolean |
containsChild(UIComponent component)
Return true if the specified UIComponent
is a direct child of this UIComponent; otherwise,
return false. |
void |
decode(FacesContext context)
Decode the current state of this UIComponent from the
request contained in the specified FacesContext, and attempt
to convert this state information into an object of the required type
for this component (optionally using the registered
Converter for this component, if there
is one. |
void |
encodeBegin(FacesContext context)
Render the beginning of the current state of this UIComponent to the response contained in the specified
FacesContext. |
void |
encodeChildren(FacesContext context)
Render the child UIComponents of this UIComponent,
following the rules described for encodeBegin() to acquire
the appropriate value to be rendered. |
void |
encodeEnd(FacesContext context)
Render the ending of the current state of this UIComponent, following the rules described for
encodeBegin() to acquire the appropriate value
to be rendered. |
UIComponent |
findComponent(java.lang.String expr)
Find the UIComponent named by the specified expression,
if any is found. |
java.lang.Object |
getAttribute(java.lang.String name)
Return the value of the attribute with the specified name (if any); otherwise, return null. |
java.util.Iterator |
getAttributeNames()
Return an Iterator over the names of all
currently defined attributes of this UIComponent that
have a non-null value. |
UIComponent |
getChild(int index)
Return the UIComponent at the specified position
in the child list for this component. |
int |
getChildCount()
Return the number of UIComponents on the child list
for this component. |
java.util.Iterator |
getChildren()
Return an Iterator over the child
UIComponents of this UIComponent,
in the order of their position in the child list. |
java.lang.String |
getClientId(FacesContext context)
Return a client-side identifier for this component, generating one if necessary. |
java.lang.String |
getComponentId()
Return the identifier of this UIComponent. |
java.lang.String |
getConverter()
Return the converter id of the Converter
that is registered for this component. |
UIComponent |
getFacet(java.lang.String name)
Return the facet UIComponent associated with the
specified name, if any. |
java.util.Iterator |
getFacetNames()
Return an Iterator over the names of the facet
UIComponents of this UIComponent. |
java.util.Iterator |
getFacetsAndChildren()
Return an Iterator over the facet followed by child
UIComponents of this UIComponent. |
UIComponent |
getParent()
Return the parent UIComponent of this
UIComponent, if any. |
java.lang.String |
getRendererType()
Return the Renderer type for this UIComponent
(if any). |
boolean |
getRendersChildren()
Return a flag indicating whether this component is responsible for rendering its child components. |
boolean |
getRendersSelf()
Return a flag indicating whether this component has concrete implementations of the decode() and
encodeXxx() methods, and is therefore suitable for
use in the direct implementation programming model
for rendering. |
java.util.Iterator |
getValidators()
Return an Iterator over the Validators
associated with this UIComponent. |
boolean |
isRendered()
Return true if this component (and its children)
should be rendered during the Render Response phase
of the request processing lifecycle. |
boolean |
isValid()
Return the current validity state of this component. |
void |
processDecodes(FacesContext context)
Perform 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. |
void |
processReconstitutes(FacesContext context)
Perform the component tree processing required by the Reconstitute Component Tree phase of the request processing lifecycle for all facets of this component, all children of this component, and this component itself, as follows. |
void |
processUpdates(FacesContext context)
Perform 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. |
void |
processValidators(FacesContext context)
Perform 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. |
void |
reconstitute(FacesContext context)
Perform any processing required to correct the state of this component as a result of the owning component tree having been reconstructed during Reconstitute Component Tree phase of the request processing lifecycle. |
void |
removeChild(int index)
Remove the child UIComponent at the specified position
in the child list for this component. |
void |
removeChild(UIComponent component)
Remove the child UIComponent from the child list
for this component. |
void |
removeFacet(java.lang.String name)
Remove the facet UIComponent associated with the
specified name, if there is one. |
void |
removeValidator(Validator validator)
Remove a Validator instance from the set associated with
this UIComponent, if it was previously associated. |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Set the new value of the attribute with the specified name, replacing any existing value for that name. |
void |
setComponentId(java.lang.String componentId)
Set the identifier of this UIComponent. |
void |
setConverter(java.lang.String converter)
Set the converter id of the Converter
that is registered for this component, or null to indicate
that there is no registered Converter. |
void |
setParent(UIComponent parent)
Set the parent UIComponent of this
UIComponent. |
void |
setRendered(boolean rendered)
Set the rendered property of this
UIComponent. |
void |
setRendererType(java.lang.String rendererType)
Set the Renderer type for this UIComponent,
or null for components that render themselves. |
void |
setValid(boolean valid)
Set the current validity state of this component. |
void |
updateModel(FacesContext context)
Update the model data associated with this UIComponent,
if any. |
void |
validate(FacesContext context)
Perform any correctness checks that this component wishes to perform on itself. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public UIComponentBase()
| Method Detail |
public java.lang.Object getAttribute(java.lang.String name)
UIComponentReturn the value of the attribute with the specified name
(if any); otherwise, return null.
getAttribute in interface UIComponentname - Name of the requested attributepublic java.util.Iterator getAttributeNames()
UIComponentReturn an Iterator over the names of all
currently defined attributes of this UIComponent that
have a non-null value.
getAttributeNames in interface UIComponent
public void setAttribute(java.lang.String name,
java.lang.Object value)
UIComponentSet the new value of the attribute with the specified name, replacing any existing value for that name.
setAttribute in interface UIComponentname - Name of the requested attributevalue - New value (or null to remove
any attribute value for the specified namepublic java.lang.String getClientId(FacesContext context)
UIComponentReturn a client-side identifier for this component, generating
one if necessary. Generation will be delegated to the associated
Renderer (if there is one).
getClientId in interface UIComponentcontext - The FacesContext for the current requestpublic java.lang.String getComponentId()
UIComponentReturn the identifier of this UIComponent.
getComponentId in interface UIComponentpublic void setComponentId(java.lang.String componentId)
UIComponentSet the identifier of this UIComponent.
setComponentId in interface UIComponentcomponentId - The new identifierpublic java.lang.String getConverter()
UIComponentReturn the converter id of the Converter
that is registered for this component.
getConverter in interface UIComponentpublic void setConverter(java.lang.String converter)
UIComponentSet the converter id of the Converter
that is registered for this component, or null to indicate
that there is no registered Converter.
setConverter in interface UIComponentconverter - New converter identifier (or null)public UIComponent getParent()
UIComponentReturn the parent UIComponent of this
UIComponent, if any.
getParent in interface UIComponentpublic void setParent(UIComponent parent)
UIComponentSet the parent UIComponent of this
UIComponent.
setParent in interface UIComponentparent - The new parent, or null for the root node
of a component treepublic boolean isRendered()
UIComponentReturn true if this component (and its children)
should be rendered during the Render Response phase
of the request processing lifecycle.
isRendered in interface UIComponentpublic void setRendered(boolean rendered)
UIComponentSet the rendered property of this
UIComponent.
setRendered in interface UIComponentrendered - If true render this component;
otherwise, do not render this componentpublic java.lang.String getRendererType()
UIComponentReturn the Renderer type for this UIComponent
(if any).
getRendererType in interface UIComponentpublic void setRendererType(java.lang.String rendererType)
UIComponentSet the Renderer type for this UIComponent,
or null for components that render themselves.
setRendererType in interface UIComponentrendererType - Logical identifier of the type of
Renderer to use, or null for components
that render themselvespublic boolean getRendersChildren()
UIComponentReturn a flag indicating whether this component is responsible for rendering its child components.
getRendersChildren in interface UIComponentpublic boolean getRendersSelf()
UIComponentReturn a flag indicating whether this component has concrete
implementations of the decode() and
encodeXxx() methods, and is therefore suitable for
use in the direct implementation programming model
for rendering.
getRendersSelf in interface UIComponentpublic boolean isValid()
UIComponentReturn the current validity state of this component. The validity state of a component is adjusted at the following points during the request processing lifecycle:
true or false by decode(),
based on the success or failure of decoding a new local value for
this component.false by processValidations() if any
call to a validate() method returned
false.false by updateModel() if any conversion
or update error occurred.
isValid in interface UIComponentpublic void setValid(boolean valid)
UIComponentSet the current validity state of this component.
setValid in interface UIComponentvalid - The new validity statepublic void addChild(UIComponent component)
UIComponentAppend the specified UIComponent to the end of the
child list for this component.
If the child to be added has a non-null and valid component identifier, the identifier is added to the namespace of the closest ancestor that is a naming container.
It is valid for a component to have a null component identifier or a component identifier that is the empty string.
addChild in interface UIComponentcomponent - UIComponent to be added
public void addChild(int index,
UIComponent component)
UIComponentInsert the specified UIComponent at the specified
position in the child list for this component.
If the child to be added has a non-null and valid component identifier, the identifier is added to the namespace of the closest ancestor that is a naming container.
It is valid for a component to have a null component identifier or a component identifier that is the empty string.
addChild in interface UIComponentindex - Zero-relative index at which to add this
UIComponentcomponent - The UIComponent to be addedpublic void clearChildren()
UIComponentRemove all child UIComponents from the child list.
clearChildren in interface UIComponentpublic boolean containsChild(UIComponent component)
UIComponentReturn true if the specified UIComponent
is a direct child of this UIComponent; otherwise,
return false.
containsChild in interface UIComponentcomponent - UIComponent to be checkedpublic UIComponent findComponent(java.lang.String expr)
UIComponentFind the UIComponent named by the specified expression,
if any is found. This is done by locating the closest parent
UIComponent that is a NamingContainer, and
calling its findComponentInNamespace() method.
The specified expr may contain either a
component identifier, or a set of component identifiers separated
by SEPARATOR_CHAR characters.
findComponent in interface UIComponentexpr - Expression identifying the UIComponent
to be returned
UIComponent, or null
if the component was not found.public UIComponent getChild(int index)
UIComponentReturn the UIComponent at the specified position
in the child list for this component.
getChild in interface UIComponentindex - Position of the desired componentpublic int getChildCount()
UIComponentReturn the number of UIComponents on the child list
for this component.
getChildCount in interface UIComponentpublic java.util.Iterator getChildren()
UIComponentReturn an Iterator over the child
UIComponents of this UIComponent,
in the order of their position in the child list. If this
component has no children, an empty Iterator
is returned.
getChildren in interface UIComponentpublic void removeChild(int index)
UIComponentRemove the child UIComponent at the specified position
in the child list for this component.
removeChild in interface UIComponentindex - Position of the component to be removedpublic void removeChild(UIComponent component)
UIComponentRemove the child UIComponent from the child list
for this component.
removeChild in interface UIComponentcomponent - Child component to be removed
public void addFacet(java.lang.String facetName,
UIComponent facet)
UIComponentAdd the specified UIComponent as a facet
associated with the name specified by the facetName
argument, replacing any previous facet with that name. The
newly added facet will have its parent
property set to this component.
addFacet in interface UIComponentfacetName - The name of this facetfacet - The new facet UIComponentpublic void clearFacets()
UIComponentRemove all facet UIComponents from this component.
clearFacets in interface UIComponentpublic UIComponent getFacet(java.lang.String name)
UIComponentReturn the facet UIComponent associated with the
specified name, if any. Otherwise, return null.
getFacet in interface UIComponentname - Name of the facet to be retrievedpublic java.util.Iterator getFacetNames()
UIComponentReturn an Iterator over the names of the facet
UIComponents of this UIComponent. If
this component has no facets, an empty Iterator is
returned.
getFacetNames in interface UIComponentpublic void removeFacet(java.lang.String name)
UIComponentRemove the facet UIComponent associated with the
specified name, if there is one. The removed facet
will have its parent property cleared.
removeFacet in interface UIComponentname - Name of the facet to be removedpublic java.util.Iterator getFacetsAndChildren()
UIComponentReturn an Iterator over the facet followed by child
UIComponents of this UIComponent.
Facets are returned in an undefined order, followed by
all the children in the order they are stored in the child list. If this
component has no facets or children, an empty Iterator
is returned.
getFacetsAndChildren in interface UIComponentpublic void addValidator(Validator validator)
UIComponentAdd a Validator instance to the set associated with
this UIComponent.
addValidator in interface UIComponentvalidator - The Validator to addpublic void clearValidators()
UIComponentClear any Validators that have been registered for
processing by this component.
clearValidators in interface UIComponentpublic java.util.Iterator getValidators()
UIComponentReturn an Iterator over the Validators
associated with this UIComponent.
getValidators in interface UIComponentpublic void removeValidator(Validator validator)
UIComponentRemove a Validator instance from the set associated with
this UIComponent, if it was previously associated.
Otherwise, do nothing.
removeValidator in interface UIComponentvalidator - The Validator to remove
public boolean broadcast(FacesEvent event,
PhaseId phaseId)
throws AbortProcessingException
UIComponentBroadcast the specified FacesEvent to all registered
event listeners who have expressed an interest in events of this
type, for the specified PhaseId (or for any phase, if the
listener returns PhaseId.ANY_PHASE from its
getPhaseId() method. The order in which
registered listeners are notified is implementation dependent.
After all interested listeners have been notified, return
false if this event does not have any listeners
interested in this event in future phases of the request processing
lifecycle. Otherwise, return true.
broadcast in interface UIComponentevent - The FacesEvent to be broadcastphaseId - The PhaseId of the current phase of the
request processing lifecycle
AbortProcessingException - Signal the JavaServer Faces
implementation that no further processing on the current event
should be performed
public void decode(FacesContext context)
throws java.io.IOException
UIComponentDecode the current state of this UIComponent from the
request contained in the specified FacesContext, and attempt
to convert this state information into an object of the required type
for this component (optionally using the registered
Converter for this component, if there
is one.
If conversion is successful:
setValue() and passing the new value.valid property of this component
to true.If conversion is not successful:
context.addMessage().valid property of this comonent
to false.During decoding, events may be enqueued for later processing
(by event listeners who have registered an interest), by calling
addFacesEvent() on the associated FacesContext.
decode in interface UIComponentcontext - FacesContext for the request we are processing
java.io.IOException - if an input/output error occurs during decoding
public void encodeBegin(FacesContext context)
throws java.io.IOException
UIComponentRender the beginning of the current state of this
UIComponent to the response contained in the specified
FacesContext. If the conversion attempted in a previous call
to decode() for this component failed, the state
information saved during execution of decode() should be
utilized to reproduce the incorrect input. If the conversion was
successful, or if there was no previous call to decode(),
the value to be displayed should be acquired by calling
currentValue(), and rendering the value as appropriate.
encodeBegin in interface UIComponentcontext - FacesContext for the response we are creating
java.io.IOException - if an input/output error occurs while rendering
public void encodeChildren(FacesContext context)
throws java.io.IOException
UIComponentRender the child UIComponents of this UIComponent,
following the rules described for encodeBegin() to acquire
the appropriate value to be rendered. This method will only be called
if the rendersChildren property is true.
encodeChildren in interface UIComponentcontext - FacesContext for the response we are creating
java.io.IOException - if an input/output error occurs while rendering
public void encodeEnd(FacesContext context)
throws java.io.IOException
UIComponentRender the ending of the current state of this
UIComponent, following the rules described for
encodeBegin() to acquire the appropriate value
to be rendered.
encodeEnd in interface UIComponentcontext - FacesContext for the response we are creating
java.io.IOException - if an input/output error occurs while rendering
public void reconstitute(FacesContext context)
throws java.io.IOException
UIComponentPerform any processing required to correct the state of this component as a result of the owning component tree having been reconstructed during Reconstitute Component Tree phase of the request processing lifecycle. The default implementation of this method does nothing.
reconstitute in interface UIComponentcontext - FacesContext for the request we are processing
java.io.IOException - if an input/output error occurs during processingpublic void updateModel(FacesContext context)
UIComponentUpdate the model data associated with this UIComponent,
if any. The default implementation in UIComponentBase does
no processing; concrete implementations of components that represent
controls that can be altered by users (such as UIInput must
provide an apppropriate implementation of this method.
updateModel in interface UIComponentcontext - FacesContext for the request we are processingpublic void validate(FacesContext context)
UIComponentPerform any correctness checks that this component wishes to perform
on itself. This method will be called during the
Process Validations phase of the request processing
lifecycle. If errors are encountered, appropriate Message
instances should be added to the FacesContext for the current
request, and the valid property of this UIComponent
should be set to false.
validate in interface UIComponentcontext - FacesContext for the request we are processing
public void processReconstitutes(FacesContext context)
throws java.io.IOException
UIComponentPerform the component tree processing required by the Reconstitute Component Tree phase of the request processing lifecycle for all facets of this component, all children of this component, and this component itself, as follows.
processReconstitutes() method of all facets
and children of this UIComponent in the order determined
by a call to getFacetsAndChildren().reconstitute() method of this component.
processReconstitutes in interface UIComponentcontext - FacesContext for the request we are processing
java.io.IOException - if an input/output error occurs during processing
public void processDecodes(FacesContext context)
throws java.io.IOException
UIComponentPerform 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.
processDecodes() method of all facets
and children of this UIComponent, in the order determined
by a call to getFacetsAndChildren().decode() method of this component.
processDecodes in interface UIComponentcontext - FacesContext for the request we are processing
java.io.IOException - if an input/output error occurs during decodingpublic void processValidators(FacesContext context)
UIComponentPerform 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.
processValidators() method of all facets
and children of this UIComponent, in the order determined
by a call to getFacetsAndChildren().valid property of this component is
currently true:
validate() method of each
Validator registered for this UIComponent.validate() method of this component.valid property of this component
to the result returned from the validate()
method.valid property of this UIComponent
is now false, call
FacesContext.renderResponse()
to transfer control at the end of the current phase.
processValidators in interface UIComponentcontext - FacesContext for the request we are processingpublic void processUpdates(FacesContext context)
UIComponentPerform 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.
processUpdates() method of all facets
and children of this UIComponent, in the order determined
by a call to getFacetsAndChildren().updateModel() method of this component.valid property of this UIComponent
is now false, call
FacesContext.renderResponse()
to transfer control at the end of the current phase.
processUpdates in interface UIComponentcontext - FacesContext for the request we are processing
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||