本文整理汇总了Java中javax.faces.render.Renderer.encodeChildren方法的典型用法代码示例。如果您正苦于以下问题:Java Renderer.encodeChildren方法的具体用法?Java Renderer.encodeChildren怎么用?Java Renderer.encodeChildren使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.faces.render.Renderer
的用法示例。
在下文中一共展示了Renderer.encodeChildren方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: encodeChildren
import javax.faces.render.Renderer; //导入方法依赖的package包/类
@Override
public void encodeChildren(FacesContext context) throws IOException
{
if (context == null)
throw new NullPointerException();
if (!isRendered())
return;
Renderer renderer = getRenderer(context);
// if there is a Renderer for this component
if (renderer != null)
{
renderer.encodeChildren(context, this);
}
}
示例2: encodeChildren
import javax.faces.render.Renderer; //导入方法依赖的package包/类
@Override
public void encodeChildren(FacesContext context, UIComponent component) throws IOException {
String newRendererType = (String)HtmlUtil.readEncodeParameter(context, component, "newRendererType", /*remove*/false); //$NON-NLS-1$
Renderer delegate = findDelegate(context, component, newRendererType);
if( delegate.getRendersChildren() ){
delegate.encodeChildren(context, component);
}else{
// else implement here using the default implementation.
FacesUtil.renderChildren(context, component);
}
}
示例3: encodeChildren
import javax.faces.render.Renderer; //导入方法依赖的package包/类
/**
* Repeatedly render the children as many times as needed.
*/
@Override
public void encodeChildren(final FacesContext context)
throws IOException
{
if (!isRendered())
return;
// if this is the table there will be a rendererType:
if (getRendererType() != null)
{
Renderer renderer = getRenderer(context);
if (renderer != null)
{
renderer.encodeChildren(context, this);
}
}
else // this is not the table. it must be the iterator
{
Runner runner = new IndexedRunner(context)
{
@Override
protected void process(
UIComponent kid,
ComponentProcessingContext cpContext
) throws IOException
{
kid.encodeAll(context);
}
};
runner.run();
Exception exp = runner.getException();
if (exp != null)
{
if (exp instanceof RuntimeException)
throw (RuntimeException) exp;
if (exp instanceof IOException)
throw (IOException) exp;
throw new IllegalStateException(exp);
}
}
}
示例4: encodeBegin
import javax.faces.render.Renderer; //导入方法依赖的package包/类
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
Renderer inputRenderer = getDefaultRenderer(context);
inputRenderer.encodeBegin(context, component);
inputRenderer.encodeChildren(context, component);
inputRenderer.encodeEnd(context, component);
}
示例5: encodeBegin
import javax.faces.render.Renderer; //导入方法依赖的package包/类
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
Renderer inputRenderer = getDefaultInputRenderer(context);
inputRenderer.encodeBegin(context, component);
inputRenderer.encodeChildren(context, component);
inputRenderer.encodeEnd(context, component);
}
示例6: generateAndTest
import javax.faces.render.Renderer; //导入方法依赖的package包/类
public void generateAndTest(UIComponent component, String expected, Renderer renderer) throws IOException {
provideMockClientId(component);
renderer.encodeBegin(mockFacesContext, component);
renderer.encodeChildren(mockFacesContext, component);
renderer.encodeEnd(mockFacesContext, component);
String response = ((MyResponseWriter) mockResponseWriter).getResponse();
Assert.assertEquals(response, expected);
}