public abstract class RenderKitFactory extends java.lang.Object implements FacesWrapper<RenderKitFactory>
RenderKitFactory is a factory object that
registers and returns RenderKit
instances. Implementations of Jakarta Faces must provide at least a
default implementation of RenderKit
. Advanced implementations (or external third party libraries) may provide
additional RenderKit
implementations (keyed by render kit identifiers) for performing different types of
rendering for the same components.
There must be one RenderKitFactory
instance per web application that is utilizing Jakarta Faces. This
instance can be acquired, in a portable manner, by calling:
RenderKitFactory factory = (RenderKitFactory) FactoryFinder.getFactory(FactoryFinder.RENDER_KIT_FACTORY);
Usage: extend this class and push the implementation being wrapped to the constructor and use getWrapped()
to
access the instance being wrapped.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
HTML_BASIC_RENDER_KIT
The render kit identifier of the default
RenderKit instance for this Jakarta Faces implementation. |
Constructor and Description |
---|
RenderKitFactory()
Deprecated.
Use the other constructor taking the implementation being wrapped.
|
RenderKitFactory(RenderKitFactory wrapped)
If this factory has been decorated, the implementation doing the decorating should push the implementation being wrapped to this constructor. |
Modifier and Type | Method and Description |
---|---|
abstract void |
addRenderKit(java.lang.String renderKitId,
RenderKit renderKit)
Register the specified
RenderKit instance, associated with the specified renderKitId , to be
supported by this RenderKitFactory , replacing any previously registered RenderKit for this
identifier. |
abstract RenderKit |
getRenderKit(FacesContext context,
java.lang.String renderKitId)
Return a
RenderKit instance for the specified render kit identifier, possibly customized based on dynamic
characteristics of the specified FacesContext , if non-null . |
abstract java.util.Iterator<java.lang.String> |
getRenderKitIds()
Return an
Iterator over the set of render kit identifiers registered with this factory. |
RenderKitFactory |
getWrapped()
If this factory has been decorated, the implementation doing the decorating may override this method to provide access to the implementation being wrapped. |
public static final java.lang.String HTML_BASIC_RENDER_KIT
The render kit identifier of the default RenderKit
instance for this Jakarta Faces implementation.
@Deprecated public RenderKitFactory()
public RenderKitFactory(RenderKitFactory wrapped)
If this factory 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.
wrapped
- The implementation being wrapped.public RenderKitFactory getWrapped()
If this factory has been decorated, the implementation doing the decorating may override this method to provide access to the implementation being wrapped.
getWrapped
in interface FacesWrapper<RenderKitFactory>
public abstract void addRenderKit(java.lang.String renderKitId, RenderKit renderKit)
Register the specified RenderKit
instance, associated with the specified renderKitId
, to be
supported by this RenderKitFactory
, replacing any previously registered RenderKit
for this
identifier.
public abstract RenderKit getRenderKit(FacesContext context, java.lang.String renderKitId)
Return a RenderKit
instance for the specified render kit identifier, possibly customized based on dynamic
characteristics of the specified FacesContext
, if non-null
. If there is no registered
RenderKit
for the specified identifier, return null
. The set of available render kit identifiers
is available via the getRenderKitIds()
method.
context
- FacesContext for the request currently being processed, or null
if none is available.renderKitId
- Render kit identifier of the requested RenderKit
instanceRenderKit
instancejava.lang.IllegalArgumentException
- if no RenderKit
instance can be returned for the specified identifierjava.lang.NullPointerException
- if renderKitId
is null
public abstract java.util.Iterator<java.lang.String> getRenderKitIds()
Return an Iterator
over the set of render kit identifiers registered with this factory. This set must
include the value specified by RenderKitFactory.HTML_BASIC_RENDER_KIT
.
Iterator
over the set of render kit identifiers