Top Description Constructors Methods
jakarta.faces.render

public abstract Class RenderKit

extends Object
Class Inheritance
Known Direct Subclasses
jakarta.faces.render.RenderKitWrapper
Imports
java.io.OutputStream, .Writer, java.util.Collections, .Iterator, .Set, jakarta.faces.component.UIComponent, jakarta.faces.context.ResponseStream, .ResponseWriter

RenderKit represents a collection of Renderer instances that, together, know how to render Jakarta Faces UIComponent instances for a specific client. Typically, RenderKits are specialized for some combination of client device type, markup language, and/or user Locale. A RenderKit also acts as a Factory for associated Renderer instances, which perform the actual rendering process for each component.

A typical Jakarta Faces implementation will configure one or more RenderKit instances at web application startup. They are made available through calls to the getRenderKit() methods of RenderKitFactory. Because RenderKit instances are shared, they must be implemented in a thread-safe manner. Due to limitations in the current specification having multiple RenderKit instances at play in the same application requires a custom jakarta.faces.application.ViewHandler instance that is aware of how to deal with this case. This limitation will be lifted in a future version of the spec.

The RenderKit instance must also vend a ResponseStateManager instance, which is used in the process of saving and restoring tree structure and state.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
addClientBehaviorRenderer(String
type of the ClientBehaviorRenderer to register
type
,
ClientBehaviorRenderer
ClientBehaviorRenderer instance we are registering
renderer
)

Register the specified ClientBehaviorRenderer instance, associated with the specified component type, to the set of ClientBehaviorRenderers registered with this RenderKit, replacing any previously registered ClientBehaviorRenderer for this type.

public abstract void
addRenderer(String
Component family of the Renderer to register
family
,
String
Renderer type of the Renderer to register
rendererType
,
Renderer<T extends UIComponent>
Renderer instance we are registering
renderer
)

Register the specified Renderer instance, associated with the specified component family and rendererType, to the set of Renderers registered with this RenderKit, replacing any previously registered Renderer for this combination of identifiers.

public abstract ResponseStream

Returns:

the new ResponseStream
createResponseStream
(OutputStream
the OutputStream around which to create the ResponseStream
out
)

Use the provided OutputStream to create a new ResponseStream instance.

public abstract ResponseWriter

Returns:

a new ResponseWriter.
createResponseWriter
(Writer
the Writer around which this ResponseWriter must be built.
writer
,
String
an "Accept header style" list of content types for this response, or null if the RenderKit should choose the best fit. As of the current version, the values accepted by the Standard render-kit for this parameter include any valid "Accept header style" String that includes the String text/html, application/xhtml+xml, application/xml or text/xml. This may change in a future version. The RenderKit must support a value for this argument that comes straight from the Accept HTTP header, and therefore requires parsing according to the specification of the Accept header. Please see Section 14.1 of RFC 2616 for the specification of the Accept header.
contentTypeList
,
String
such as "ISO-8859-1" for this ResponseWriter, or null if the RenderKit should choose the best fit. Please see the IANA for a list of character encodings.
characterEncoding
)

Use the provided Writer to create a new ResponseWriter instance for the specified (optional) content type, and character encoding.

public ClientBehaviorRenderer

Returns:

the ClientBehaviorRenderer instance
getClientBehaviorRenderer
(String
type of the requested ClientBehaviorRenderer instance
type
)

Return the ClientBehaviorRenderer instance most recently registered for the specified type, if any; otherwise, return null.

public Iterator<String>

Returns:

an Iterator over the ClientBehaviorRenderer
getClientBehaviorRendererTypes
()

Return an Iterator over the ClientBehaviorRenderer types.

public Iterator<String>

Returns:

Return an Iterator over the component-family entries
getComponentFamilies
()

Return an Iterator over the component-family entries supported by this RenderKit instance.

public abstract Renderer<T extends UIComponent>

Returns:

the Renderer instance
getRenderer
(String
Component family of the requested Renderer instance
family
,
String
Renderer type of the requested Renderer instance
rendererType
)

Return the Renderer instance most recently registered for the specified component family and rendererType, if any; otherwise, return null.

public Iterator<String>

Returns:

an Iterator over the renderer-type
getRendererTypes
(String
one of the members of the Iterator returned by getComponentFamilies.
componentFamily
)

Return an Iterator over the renderer-type entries for the given component-family.

public abstract ResponseStateManager
getResponseStateManager()

Return an instance of ResponseStateManager to handle rendering technology specific state management decisions.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

RenderKitback to summary
public RenderKit()

Method Detail

addClientBehaviorRendererback to summary
public void addClientBehaviorRenderer(String type, ClientBehaviorRenderer renderer)

Register the specified ClientBehaviorRenderer instance, associated with the specified component type, to the set of ClientBehaviorRenderers registered with this RenderKit, replacing any previously registered ClientBehaviorRenderer for this type.

Parameters
type:String

type of the ClientBehaviorRenderer to register

renderer:ClientBehaviorRenderer

ClientBehaviorRenderer instance we are registering

Exceptions
NullPointerException:
if type or renderer is null
Since
2.0
addRendererback to summary
public abstract void addRenderer(String family, String rendererType, Renderer<T extends UIComponent> renderer)

Register the specified Renderer instance, associated with the specified component family and rendererType, to the set of Renderers registered with this RenderKit, replacing any previously registered Renderer for this combination of identifiers.

Parameters
family:String

Component family of the Renderer to register

rendererType:String

Renderer type of the Renderer to register

renderer:Renderer<T extends UIComponent>

Renderer instance we are registering

Exceptions
NullPointerException:
if family or rendererType or renderer is null
createResponseStreamback to summary
public abstract ResponseStream createResponseStream(OutputStream out)

Use the provided OutputStream to create a new ResponseStream instance.

Parameters
out:OutputStream

the OutputStream around which to create the ResponseStream

Returns:ResponseStream

the new ResponseStream

createResponseWriterback to summary
public abstract ResponseWriter createResponseWriter(Writer writer, String contentTypeList, String characterEncoding)

Use the provided Writer to create a new ResponseWriter instance for the specified (optional) content type, and character encoding.

Implementors are advised to consult the getCharacterEncoding() method of class jakarta.servlet.ServletResponse to get the required value for the characterEncoding for this method. Since the Writer for this response will already have been obtained (due to it ultimately being passed to this method), we know that the character encoding cannot change during the rendering of the response.

Parameters
writer:Writer

the Writer around which this ResponseWriter must be built.

contentTypeList:String

an "Accept header style" list of content types for this response, or null if the RenderKit should choose the best fit. As of the current version, the values accepted by the Standard render-kit for this parameter include any valid "Accept header style" String that includes the String text/html, application/xhtml+xml, application/xml or text/xml. This may change in a future version. The RenderKit must support a value for this argument that comes straight from the Accept HTTP header, and therefore requires parsing according to the specification of the Accept header. Please see Section 14.1 of RFC 2616 for the specification of the Accept header.

characterEncoding:String

such as "ISO-8859-1" for this ResponseWriter, or null if the RenderKit should choose the best fit. Please see the IANA for a list of character encodings.

Returns:ResponseWriter

a new ResponseWriter.

Exceptions
IllegalArgumentException:
if no matching content type can be found in contentTypeList, no appropriate content type can be found with the implementation dependent best fit algorithm, or no matching character encoding can be found for the argument characterEncoding.
getClientBehaviorRendererback to summary
public ClientBehaviorRenderer getClientBehaviorRenderer(String type)

Return the ClientBehaviorRenderer instance most recently registered for the specified type, if any; otherwise, return null.

Parameters
type:String

type of the requested ClientBehaviorRenderer instance

Returns:ClientBehaviorRenderer

the ClientBehaviorRenderer instance

Exceptions
NullPointerException:
if type is null
Since
2.0
getClientBehaviorRendererTypesback to summary
public Iterator<String> getClientBehaviorRendererTypes()

Return an Iterator over the ClientBehaviorRenderer types.

Returns:Iterator<String>

an Iterator over the ClientBehaviorRenderer

Since
2.0
getComponentFamiliesback to summary
public Iterator<String> getComponentFamilies()

Return an Iterator over the component-family entries supported by this RenderKit instance.

The default implementation of this method returns an empty Iterator

Returns:Iterator<String>

Return an Iterator over the component-family entries

Since
2.0
getRendererback to summary
public abstract Renderer<T extends UIComponent> getRenderer(String family, String rendererType)

Return the Renderer instance most recently registered for the specified component family and rendererType, if any; otherwise, return null.

Parameters
family:String

Component family of the requested Renderer instance

rendererType:String

Renderer type of the requested Renderer instance

Returns:Renderer<T extends UIComponent>

the Renderer instance

Exceptions
NullPointerException:
if family or rendererType is null
getRendererTypesback to summary
public Iterator<String> getRendererTypes(String componentFamily)

Return an Iterator over the renderer-type entries for the given component-family.

If the specified componentFamily is not known to this RenderKit implementation, return an empty Iterator

The default implementation of this method returns an empty Iterator

Parameters
componentFamily:String

one of the members of the Iterator returned by getComponentFamilies.

Returns:Iterator<String>

an Iterator over the renderer-type

Since
2.0
getResponseStateManagerback to summary
public abstract ResponseStateManager getResponseStateManager()

Return an instance of ResponseStateManager to handle rendering technology specific state management decisions.

Returns:ResponseStateManager

the ResponseStateManager