本文整理匯總了Java中javax.faces.component.UIComponent.getRendersChildren方法的典型用法代碼示例。如果您正苦於以下問題:Java UIComponent.getRendersChildren方法的具體用法?Java UIComponent.getRendersChildren怎麽用?Java UIComponent.getRendersChildren使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.faces.component.UIComponent
的用法示例。
在下文中一共展示了UIComponent.getRendersChildren方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: _renderComponent
import javax.faces.component.UIComponent; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
private void _renderComponent(FacesContext context, UIComponent component)
throws IOException
{
component.encodeBegin(context);
if (component.getRendersChildren())
{
component.encodeChildren(context);
}
else
{
int count = component.getChildCount();
if (count > 0)
{
List<UIComponent> children = component.getChildren();
for (int i = 0; i < count; i++)
{
UIComponent child = children.get(i);
if (child.isRendered())
_renderComponent(context, child);
}
}
}
component.encodeEnd(context);
}
示例2: doRenderResponse
import javax.faces.component.UIComponent; //導入方法依賴的package包/類
/**
* Renders the component tree.
*
* @param context the faces context
* @param component the component tree to render
*
* @throws IOException when the render fails
*/
@SuppressWarnings("unchecked")
protected void doRenderResponse(
FacesContext context,
UIComponent component) throws IOException
{
component.encodeBegin(context);
if (component.getRendersChildren())
{
component.encodeChildren(context);
}
else
{
for(UIComponent child : (List<UIComponent>)component.getChildren())
{
doRenderResponse(context, child);
}
}
component.encodeEnd(context);
}
示例3: encodeRecursive
import javax.faces.component.UIComponent; //導入方法依賴的package包/類
/**
* Encodes a component and all of its children.
*/
@SuppressWarnings("unchecked")
static public void encodeRecursive(FacesContext context,
UIComponent component)
throws IOException
{
if (component.isRendered())
{
component.encodeBegin(context);
if (component.getRendersChildren())
{
component.encodeChildren(context);
}
else
{
if (component.getChildCount() > 0)
{
for(UIComponent child : (List<UIComponent>)component.getChildren())
{
encodeRecursive(context, child);
}
}
}
component.encodeEnd(context);
}
}