RenderKitFactory (Java EE 5)

Java EE API


javax.faces.render Class RenderKitFactory

java.lang.Object
  extended by javax.faces.render.RenderKitFactory

public abstract class RenderKitFactory
extends Object


RenderKitFactory 是注册并返回 RenderKit 实例的工厂对象。JavaServer Faces 实现必须至少提供一个默认的 RenderKit 实现。高级实现(或外部第三方库)可能提供附加的 RenderKit 实现(以呈现工具包标识符作为键),用来对相同的组件执行不同类型的呈现。

每个利用 JavaServer Faces 的 Web 应用程序都必须有一个 RenderKitFactory 实例。可以通过可移植的方式获取此实例,即调用:

RenderKitFactory factory = (RenderKitFactory)
FactoryFinder.getFactory(FactoryFinder.RENDER_KIT_FACTORY);
 
英文文档:

RenderKitFactory is a factory object that registers and returns RenderKit instances. Implementations of JavaServer 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 JavaServer Faces. This instance can be acquired, in a portable manner, by calling:

   RenderKitFactory factory = (RenderKitFactory)
    FactoryFinder.getFactory(FactoryFinder.RENDER_KIT_FACTORY);
 


Field Summary
static String
 
Constructor Summary
 
Method Summary
abstract  void
abstract  RenderKit
abstract  Iterator<String>
 
Methods inherited from class java.lang.Object
 

Field Detail

英文文档:

HTML_BASIC_RENDER_KIT

public static final String HTML_BASIC_RENDER_KIT

The render kit identifier of the default RenderKit instance for this JavaServer Faces implementation.

See Also:
Constant Field Values

Constructor Detail

public RenderKitFactory()
英文文档:

RenderKitFactory

public RenderKitFactory()
Method Detail

abstract public void addRenderKit(String renderKitId, RenderKit renderKit)

注册此 RenderKitFactory 要支持的与指定 renderKitId 关联的指定 RenderKit 实例,同时替换之前为此标识符注册的任何 RenderKit

renderKitId 要注册的 RenderKit 的标识符
renderKit 要注册的 RenderKit 实例
ThrowsNullPointerException: 如果 renderKitIdrenderKitnull
英文文档:

addRenderKit

public abstract void addRenderKit(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.

Parameters:
renderKitId - Identifier of the RenderKit to register
renderKit - RenderKit instance that we are registering
Throws:
NullPointerException - if renderKitId or renderKit is null

abstract public RenderKit getRenderKit(FacesContext context, String renderKitId)

为指定的呈现工具包标识符返回 RenderKit 实例,如果非 null,则可能根据指定的 FacesContext 的动态特征进行了自定义。如果指定的标识符没有任何已注册 RenderKit,则返回 null。通过 getRenderKitIds() 方法可以获得一组可用的呈现工具包标识符。

context 当前正在处理的请求的 FacesContext;如果不可用,则为 null
renderKitId 请求的 RenderKit 实例的呈现工具包标识符
ThrowsIllegalArgumentException: 如果对于指定的标识符没有任何可以返回的 RenderKit 实例
ThrowsNullPointerException: 如果 renderKitIdnull
英文文档:

getRenderKit

public abstract RenderKit getRenderKit(FacesContext context,
                                       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.

Parameters:
context - FacesContext for the request currently being processed, or null if none is available.
renderKitId - Render kit identifier of the requested RenderKit instance
Throws:
IllegalArgumentException - if no RenderKit instance can be returned for the specified identifier
NullPointerException - if renderKitId is null

abstract public java.util.Iterator<E> getRenderKitIds()

返回一个对向此工厂注册的呈现工具包标识符集进行迭代的 Iterator。此集合必须包括 RenderKitFactory.HTML_BASIC_RENDER_KIT 指定的值。

英文文档:

getRenderKitIds

public abstract Iterator<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.



Submit a bug or feature

Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

一看就知道只有菜鸟才干这么无知的事啦。

PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!