- java.lang.Object
-
- javax.faces.component.behavior.BehaviorBase
-
- javax.faces.component.behavior.ClientBehaviorBase
-
- All Implemented Interfaces:
- Behavior, ClientBehavior, PartialStateHolder, StateHolder
- Direct Known Subclasses:
- AjaxBehavior
public class ClientBehaviorBase extends BehaviorBase implements ClientBehavior
ClientBehaviorBase is a convenience base class that implements the default concrete behavior of all methods defined by
ClientBehavior
.Subclasses should either override getRendererType() to identify the
ClientBehaviorRenderer
to delegate to, or they should overridegetScript()
to locally generate the desired Behavior script, anddecode()
.- Since:
- 2.0
-
-
Constructor Summary
Constructors Constructor and Description ClientBehaviorBase()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
decode(FacesContext context, UIComponent component)
Default implementation of of
ClientBehavior.decode(javax.faces.context.FacesContext, javax.faces.component.UIComponent)
.Set<ClientBehaviorHint>
getHints()
Default implementation of
ClientBehavior.getHints()
.protected ClientBehaviorRenderer
getRenderer(FacesContext context)
Convenience method to return the
ClientBehaviorRenderer
instance associated with thisClientBehavior
, if any; otherwise, returnnull
.String
getRendererType()
Returns the renderer type of the
ClientBehaviorRenderer
to use for the behavior.String
getScript(ClientBehaviorContext behaviorContext)
Default implementation of of
ClientBehavior.getScript(javax.faces.component.behavior.ClientBehaviorContext)
.-
Methods inherited from class javax.faces.component.behavior.BehaviorBase
addBehaviorListener, broadcast, clearInitialState, initialStateMarked, isTransient, markInitialState, removeBehaviorListener, restoreState, saveState, setTransient
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.faces.component.behavior.Behavior
broadcast
-
-
-
-
Method Detail
-
getScript
public String getScript(ClientBehaviorContext behaviorContext)
Default implementation of of
ClientBehavior.getScript(javax.faces.component.behavior.ClientBehaviorContext)
. If aClientBehaviorRenderer
is available for the specified behavior renderer type, this method delegates to theClientBehaviorRenderer.getScript(javax.faces.component.behavior.ClientBehaviorContext, javax.faces.component.behavior.ClientBehavior)
method. Otherwise, this method returns null.- Specified by:
getScript
in interfaceClientBehavior
- Parameters:
behaviorContext
- theClientBehaviorContext
- Returns:
- the script provided by the associated ClientBehaviorRenderer, or null if no ClientBehaviorRenderer is available.
- Throws:
NullPointerException
- ifbehaviorContext
isnull
- Since:
- 2.0
-
decode
public void decode(FacesContext context, UIComponent component)
Default implementation of of
ClientBehavior.decode(javax.faces.context.FacesContext, javax.faces.component.UIComponent)
. If aClientBehaviorRenderer
is available for the specified behavior renderer type, this method delegates to the ClientBehaviorRenderer's decode() method. Otherwise, no decoding is performed.- Specified by:
decode
in interfaceClientBehavior
- Parameters:
context
-FacesContext
for the request we are processingcomponent
-UIComponent
the component associated with thisClientBehavior
- Throws:
NullPointerException
- ifcontext
orcomponent
is
null
.- Since:
- 2.0
-
getRendererType
public String getRendererType()
Returns the renderer type of the
ClientBehaviorRenderer
to use for the behavior. The default implementation returns null. Subclasses should either override this method to return a string that identifies the type ofClientBehaviorRenderer
to use, or should overridegetScript(javax.faces.component.behavior.ClientBehaviorContext)
and perform script rendering locally in theClientBehavior
implementation.- Returns:
- the default renderer type, which is null.
- Since:
- 2.0
-
getHints
public Set<ClientBehaviorHint> getHints()
Default implementation of
ClientBehavior.getHints()
. By default, no hints are specified, and this method returns an empty, umodifiable set.- Specified by:
getHints
in interfaceClientBehavior
- Returns:
- an empty, unmodifiable set of
ClientBehaviorHint
s. - Since:
- 2.0
-
getRenderer
protected ClientBehaviorRenderer getRenderer(FacesContext context)
Convenience method to return the
ClientBehaviorRenderer
instance associated with thisClientBehavior
, if any; otherwise, returnnull
.- Parameters:
context
-FacesContext
for the request we are processing- Returns:
ClientBehaviorRenderer
instance from the currentRenderKit
or null.- Throws:
NullPointerException
- ifcontext
is null.- Since:
- 2.0
-
-
Traduction non disponible
Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Version en cache
21/08/2025 15:05:19 Cette version de la page est en cache (à la date du 21/08/2025 15:05:19) afin d'accélérer le traitement.Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la version plus récente de la page.
Document créé le 11/06/2005, dernière modification le 18/08/2025
Source du document imprimé : https://www.gaudry.be/java-api-javaee-rf-javax/faces/component/behavior/ClientBehaviorBase.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.