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 override
getScript()
to locally generate the desired Behavior
script, and decode()
.
Constructor and Description |
---|
ClientBehaviorBase() |
Modifier and Type | Method and Description |
---|---|
void |
decode(FacesContext context,
UIComponent component)
Default implementation of of |
Set<ClientBehaviorHint> |
getHints()
Default implementation of
|
protected ClientBehaviorRenderer |
getRenderer(FacesContext context)
Convenience method to return the
|
String |
getRendererType()
Returns the renderer type of the
|
String |
getScript(ClientBehaviorContext behaviorContext)
Default implementation of of |
addBehaviorListener, broadcast, clearInitialState, initialStateMarked, isTransient, markInitialState, removeBehaviorListener, restoreState, saveState, setTransient
public String getScript(ClientBehaviorContext behaviorContext)
Default implementation of of ClientBehavior.getScript(javax.faces.component.behavior.ClientBehaviorContext)
. If a ClientBehaviorRenderer
is available for the specified behavior renderer type, this
method delegates to the ClientBehaviorRenderer.getScript(javax.faces.component.behavior.ClientBehaviorContext, javax.faces.component.behavior.ClientBehavior)
method. Otherwise, this method returns null.
getScript
in interface ClientBehavior
behaviorContext
- the ClientBehaviorContext
NullPointerException
- if behaviorContext
is
null
public void decode(FacesContext context, UIComponent component)
Default implementation of of ClientBehavior.decode(javax.faces.context.FacesContext, javax.faces.component.UIComponent)
. If a ClientBehaviorRenderer
is
available for the specified behavior renderer type, this method
delegates to the ClientBehaviorRenderer's decode() method.
Otherwise, no decoding is performed.
decode
in interface ClientBehavior
context
- FacesContext
for the request we are processingcomponent
- UIComponent
the component associated with this ClientBehavior
NullPointerException
- if context
or
component 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 of
ClientBehaviorRenderer
to use, or should override
getScript(javax.faces.component.behavior.ClientBehaviorContext)
and perform script rendering locally in the
ClientBehavior
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 interface ClientBehavior
- 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 this
ClientBehavior
, if any; otherwise, return
null
.
- Parameters:
context
- FacesContext
for the request we are processing
- Returns:
ClientBehaviorRenderer
instance from the current RenderKit
or null.
- Throws:
NullPointerException
- if context
is null.- Since:
- 2.0
Copyright © 1996-2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.