Top Description Fields Constructors Methods
jakarta.faces.render

public abstract Class RendererWrapper

extends Renderer
implements FacesWrapper<Renderer<T extends UIComponent>>
Class Inheritance
All Implemented Interfaces
jakarta.faces.FacesWrapper
Imports
java.io.IOException, jakarta.faces.FacesWrapper, jakarta.faces.component.UIComponent, jakarta.faces.context.FacesContext, jakarta.faces.convert.ConverterException

Provides a simple implementation of Renderer that can be subclassed by developers wishing to provide specialized behavior to an existing Renderer instance. The default implementation of all methods is to call through to the wrapped Renderer instance.

Usage: extend this class and push the implementation being wrapped to the constructor and use getWrapped to access the instance being wrapped.

Since
2.2

Field Summary

Modifier and TypeField and Description
private Renderer<T extends UIComponent>
Inherited from jakarta.faces.render.Renderer:
PASSTHROUGH_RENDERER_LOCALNAME_KEY

Constructor Summary

AccessConstructor and Description
public
RendererWrapper()
Deprecated Use the other constructor taking the implementation being wrapped.

public
RendererWrapper(Renderer<T extends UIComponent>
The implementation being wrapped.
wrapped
)

If this renderer has been decorated, the implementation doing the decorating should push the implementation being wrapped to this constructor.

Method Summary

Modifier and TypeMethod and Description
public String
convertClientId(FacesContext
FacesContext for the current request
context
,
String
the client identifier to be converted to client a specific format.
clientId
)

Overrides jakarta.faces.render.Renderer.convertClientId.

Convert the component generated client id to a form suitable for transmission to the client.

public void
decode(FacesContext
FacesContext for the request we are processing
context
,
UIComponent
UIComponent to be decoded.
component
)

Overrides jakarta.faces.render.Renderer.decode.

Decode any new state of the specified UIComponent from the request contained in the specified FacesContext, and store that state on the UIComponent.

public void
encodeBegin(FacesContext
FacesContext for the request we are processing
context
,
UIComponent
UIComponent to be rendered
component
)

Overrides jakarta.faces.render.Renderer.encodeBegin.

Render the beginning specified UIComponent to the output stream or writer associated with the response we are creating.

public void
encodeChildren(FacesContext
FacesContext for the response we are creating
context
,
UIComponent
UIComponent whose children are to be rendered
component
)

Overrides jakarta.faces.render.Renderer.encodeChildren.

Render the child components of this UIComponent, following the rules described for encodeBegin() to acquire the appropriate value to be rendered.

public void
encodeEnd(FacesContext
FacesContext for the response we are creating
context
,
UIComponent
UIComponent to be rendered
component
)

Overrides jakarta.faces.render.Renderer.encodeEnd.

Render the ending of the current state of the specified UIComponent, following the rules described for encodeBegin() to acquire the appropriate value to be rendered.

public Object
getConvertedValue(FacesContext
FacesContext for the request we are processing
context
,
UIComponent
UIComponent to be decoded.
component
,
Object
a value stored on the component during decode.
submittedValue
)

Overrides jakarta.faces.render.Renderer.getConvertedValue.

Attempt to convert previously stored state information into an object of the type required for this component (optionally using the registered jakarta.faces.convert.Converter for this component, if there is one).

public boolean
getRendersChildren()

Overrides jakarta.faces.render.Renderer.getRendersChildren.

Return a flag indicating whether this Renderer is responsible for rendering the children the component it is asked to render.

public Renderer<T extends UIComponent>
getWrapped()

Implements jakarta.faces.FacesWrapper.getWrapped.

A class that implements this interface uses this method to return an instance of the class being wrapped.

Field Detail

wrappedback to summary
private Renderer<T extends UIComponent> wrapped

Constructor Detail

RendererWrapperback to summary
public RendererWrapper()

Deprecated

Use the other constructor taking the implementation being wrapped.

Annotations
@Deprecated
RendererWrapperback to summary
public RendererWrapper(Renderer<T extends UIComponent> wrapped)

If this renderer has been decorated, the implementation doing the decorating should push the implementation being wrapped to this constructor. The getWrapped() will then return the implementation being wrapped.

Parameters
wrapped:Renderer<T extends UIComponent>

The implementation being wrapped.

Since
2.3

Method Detail

convertClientIdback to summary
public String convertClientId(FacesContext context, String clientId)

Overrides jakarta.faces.render.Renderer.convertClientId.

Doc from jakarta.faces.render.Renderer.convertClientId.

Convert the component generated client id to a form suitable for transmission to the client.

The default implementation returns the argument clientId unchanged.

Parameters
context:FacesContext

FacesContext for the current request

clientId:String

the client identifier to be converted to client a specific format.

Returns:String

the converted clientId

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

Overrides jakarta.faces.render.Renderer.decode.

Doc from jakarta.faces.render.Renderer.decode.

Decode any new state of the specified UIComponent from the request contained in the specified FacesContext, and store that state on the UIComponent.

During decoding, events may be enqueued for later processing (by event listeners that have registered an interest), by calling queueEvent() on the associated UIComponent.

Parameters
context:FacesContext

FacesContext for the request we are processing

component:UIComponent

UIComponent to be decoded.

Annotations
@Override
encodeBeginback to summary
public void encodeBegin(FacesContext context, UIComponent component) throws IOException

Overrides jakarta.faces.render.Renderer.encodeBegin.

Doc from jakarta.faces.render.Renderer.encodeBegin.

Render the beginning specified UIComponent to the output stream or writer associated with the response we are creating. If the conversion attempted in a previous call to getConvertedValue() for this component failed, the state information saved during execution of decode() should be used to reproduce the incorrect input.

Parameters
context:FacesContext

FacesContext for the request we are processing

component:UIComponent

UIComponent to be rendered

Annotations
@Override
Exceptions
IOException:
if an input/output error occurs while rendering
encodeChildrenback to summary
public void encodeChildren(FacesContext context, UIComponent component) throws IOException

Overrides jakarta.faces.render.Renderer.encodeChildren.

Doc from jakarta.faces.render.Renderer.encodeChildren.

Render the child components 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 of this component is true.

Parameters
context:FacesContext

FacesContext for the response we are creating

component:UIComponent

UIComponent whose children are to be rendered

Annotations
@Override
Exceptions
IOException:
if an input/output error occurs while rendering
encodeEndback to summary
public void encodeEnd(FacesContext context, UIComponent component) throws IOException

Overrides jakarta.faces.render.Renderer.encodeEnd.

Doc from jakarta.faces.render.Renderer.encodeEnd.

Render the ending of the current state of the specified UIComponent, following the rules described for encodeBegin() to acquire the appropriate value to be rendered.

Parameters
context:FacesContext

FacesContext for the response we are creating

component:UIComponent

UIComponent to be rendered

Annotations
@Override
Exceptions
IOException:
if an input/output error occurs while rendering
getConvertedValueback to summary
public Object getConvertedValue(FacesContext context, UIComponent component, Object submittedValue) throws ConverterException

Overrides jakarta.faces.render.Renderer.getConvertedValue.

Doc from jakarta.faces.render.Renderer.getConvertedValue.

Attempt to convert previously stored state information into an object of the type required for this component (optionally using the registered jakarta.faces.convert.Converter for this component, if there is one). If conversion is successful, the new value should be returned from this method; if not, a ConverterException should be thrown.

Parameters
context:FacesContext

FacesContext for the request we are processing

component:UIComponent

UIComponent to be decoded.

submittedValue:Object

a value stored on the component during decode.

Returns:Object

the converted value

Annotations
@Override
Exceptions
ConverterException:
if the submitted value cannot be converted successfully.
getRendersChildrenback to summary
public boolean getRendersChildren()

Overrides jakarta.faces.render.Renderer.getRendersChildren.

Doc from jakarta.faces.render.Renderer.getRendersChildren.

Return a flag indicating whether this Renderer is responsible for rendering the children the component it is asked to render. The default implementation returns false.

Returns:boolean

the current value of the flag

Annotations
@Override
getWrappedback to summary
public Renderer<T extends UIComponent> getWrapped()

Implements jakarta.faces.FacesWrapper.getWrapped.

Doc from jakarta.faces.FacesWrapper.getWrapped.

A class that implements this interface uses this method to return an instance of the class being wrapped.

Returns:Renderer<T extends UIComponent>

the wrapped instance.

Annotations
@Override