Top Description Fields Constructors Methods
jakarta.faces.component.behavior

public Class ClientBehaviorBase

extends BehaviorBase
implements ClientBehavior
Class Inheritance
All Implemented Interfaces
jakarta.faces.component.behavior.ClientBehavior, jakarta.faces.component.behavior.Behavior
Known Direct Subclasses
jakarta.faces.component.behavior.AjaxBehavior
Imports
java.util.Collections, .Set, java.util.logging.Level, .Logger, jakarta.faces.component.UIComponent, jakarta.faces.context.FacesContext, jakarta.faces.render.ClientBehaviorRenderer, .RenderKit

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().

Since
2.0

Field Summary

Modifier and TypeField and Description
private static final Logger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
decode(FacesContext
FacesContext for the request we are processing
context
,
UIComponent
UIComponent the component associated with this ClientBehavior
component
)

Implements jakarta.faces.component.behavior.ClientBehavior.decode.

Default implementation of of ClientBehavior#decode.

public Set<ClientBehaviorHint>

Returns:

an empty, unmodifiable set of ClientBehaviorHints.
getHints
()

Implements jakarta.faces.component.behavior.ClientBehavior.getHints.

Default implementation of ClientBehavior#getHints().

protected ClientBehaviorRenderer

Returns:

ClientBehaviorRenderer instance from the current RenderKit or null.
getRenderer
(FacesContext
FacesContext for the request we are processing
context
)

Convenience method to return the ClientBehaviorRenderer instance associated with this ClientBehavior, if any; otherwise, return null.

public String

Returns:

the default renderer type, which is null.
getRendererType
()

Returns the renderer type of the ClientBehaviorRenderer to use for the behavior.

public String

Returns:

the script provided by the associated ClientBehaviorRenderer, or null if no ClientBehaviorRenderer is available.
getScript
(ClientBehaviorContext behaviorContext)

Implements jakarta.faces.component.behavior.ClientBehavior.getScript.

Default implementation of of ClientBehavior#getScript.

Inherited from jakarta.faces.component.behavior.BehaviorBase:
addBehaviorListenerbroadcastclearInitialStateinitialStateMarkedisTransientmarkInitialStateremoveBehaviorListenerrestoreStatesaveStatesetTransient

Field Detail

loggerback to summary
private static final Logger logger

Constructor Detail

ClientBehaviorBaseback to summary
public ClientBehaviorBase()

Method Detail

decodeback to summary
public void decode(FacesContext context, UIComponent component)

Implements jakarta.faces.component.behavior.ClientBehavior.decode.

Default implementation of of ClientBehavior#decode. 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.

Parameters
context:FacesContext

FacesContext for the request we are processing

component:UIComponent

UIComponent the component associated with this ClientBehavior

Annotations
@Override
Exceptions
NullPointerException:
if context or component is null.
Since
2.0
getHintsback to summary
public Set<ClientBehaviorHint> getHints()

Implements jakarta.faces.component.behavior.ClientBehavior.getHints.

Default implementation of ClientBehavior#getHints(). By default, no hints are specified, and this method returns an empty, umodifiable set.

Returns:Set<ClientBehaviorHint>

an empty, unmodifiable set of ClientBehaviorHints.

Annotations
@Override
Since
2.0
getRendererback to summary
protected ClientBehaviorRenderer getRenderer(FacesContext context)

Convenience method to return the ClientBehaviorRenderer instance associated with this ClientBehavior, if any; otherwise, return null.

Parameters
context:FacesContext

FacesContext for the request we are processing

Returns:ClientBehaviorRenderer

ClientBehaviorRenderer instance from the current RenderKit or null.

Exceptions
NullPointerException:
if context is null.
Since
2.0
getRendererTypeback to summary
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 and perform script rendering locally in the ClientBehavior implementation.

Returns:String

the default renderer type, which is null.

Since
2.0
getScriptback to summary
public String getScript(ClientBehaviorContext behaviorContext)

Implements jakarta.faces.component.behavior.ClientBehavior.getScript.

Default implementation of of ClientBehavior#getScript. If a ClientBehaviorRenderer is available for the specified behavior renderer type, this method delegates to the ClientBehaviorRenderer#getScript method. Otherwise, this method returns null.

Parameters
behaviorContext:ClientBehaviorContext

the ClientBehaviorContext

Returns:String

the script provided by the associated ClientBehaviorRenderer, or null if no ClientBehaviorRenderer is available.

Annotations
@Override
Exceptions
NullPointerException:
if behaviorContext is null
Since
2.0