com.ibm.xsp.page
Interface FacesComponentBuilder


public interface FacesComponentBuilder

The FacesComponentBuilder. A FacesComponentBuilder is specific to one component. It doesn't create the component itself but can be used to create its children and facets. It is also specific to the type of FacesPage that is loading the components.

It will often be used by a FacesComponent to build it's contents, as FacesComponents are responsible for building their own contents, instead of allowing the FacesPage to load them automatically.

When a FacesPage is loading and it encounters a FacesComponent, it will create the component, and a FacesComponentBuilder specific to that component, and will then delegate to the FacesComponent to build it's children and facets. The FacesComponent may delegate directly to the FacesComponentBuilder or may build it's contents programmatically.

The build methods may themselves create and use new child FacesComponentBuilders to create and build the children and facets. In that case the getParent() will return the closest ancestral FacesComponentBuilder.


Method Summary
 void buildAll(javax.faces.context.FacesContext context, javax.faces.component.UIComponent parent, boolean includeFacets)
          Calls buildChildren(FacesContext, UIComponent) and, if includeFacets is true all the facets, adding them to the parameter parent component.
 void buildChildren(javax.faces.context.FacesContext context, javax.faces.component.UIComponent parent)
          Builds all the children that were specified under the component getUIComponent() and adds them as children of the parameter parent component.
 boolean buildFacet(javax.faces.context.FacesContext context, javax.faces.component.UIComponent parent, java.lang.String facetName)
          Builds the facet with the given name that was specified under the component getUIComponent() and adds it as a facet of the parameter parent component.
 void buildFacets(javax.faces.context.FacesContext context, javax.faces.component.UIComponent parent)
          Builds the all the facets that were specified under the component getUIComponent() and adds them as facets of the parameter parent component.
 FacesComponentBuilder getParent()
          A FacesComponentBuilder that was used to build the component's parent or used to build the component that's including this component into it's page.
 javax.faces.component.UIComponent getUIComponent()
          The component whose children and possibly facets will be built.
 boolean isFacetAvailable(javax.faces.context.FacesContext context, javax.faces.component.UIComponent parent, java.lang.String facetName)
          Used to check whether the given facetName is available for the component corresponding to this builder.
 

Method Detail

getParent

FacesComponentBuilder getParent()
A FacesComponentBuilder that was used to build the component's parent or used to build the component that's including this component into it's page. Or null if the FacesPage build the component's parent.

Returns:

getUIComponent

javax.faces.component.UIComponent getUIComponent()
The component whose children and possibly facets will be built. Generally either this component will be a FacesComponent or else the parent FacesComponentBuilder will be non-null.

Returns:

buildAll

void buildAll(javax.faces.context.FacesContext context,
              javax.faces.component.UIComponent parent,
              boolean includeFacets)
              throws FacesPageException
Calls buildChildren(FacesContext, UIComponent) and, if includeFacets is true all the facets, adding them to the parameter parent component.

Parameters:
context -
parent -
includeFacets - whether to include building the facets or just build the children.
Throws:
FacesPageException

buildChildren

void buildChildren(javax.faces.context.FacesContext context,
                   javax.faces.component.UIComponent parent)
                   throws FacesPageException
Builds all the children that were specified under the component getUIComponent() and adds them as children of the parameter parent component.

Parameters:
context -
parent -
Throws:
FacesPageException

isFacetAvailable

boolean isFacetAvailable(javax.faces.context.FacesContext context,
                         javax.faces.component.UIComponent parent,
                         java.lang.String facetName)
Used to check whether the given facetName is available for the component corresponding to this builder. This will not be the same as the value returned from buildFacet(FacesContext, UIComponent, String) if loaded was false for the facet component or if some error occurred building the facet.

Parameters:
context -
parent -
facetName -
Returns:

buildFacet

boolean buildFacet(javax.faces.context.FacesContext context,
                   javax.faces.component.UIComponent parent,
                   java.lang.String facetName)
                   throws FacesPageException
Builds the facet with the given name that was specified under the component getUIComponent() and adds it as a facet of the parameter parent component.

Parameters:
context -
parent -
facetName -
Returns:
true if there was a facet with the given name that was successfully built.
Throws:
FacesPageException

buildFacets

void buildFacets(javax.faces.context.FacesContext context,
                 javax.faces.component.UIComponent parent)
                 throws FacesPageException
Builds the all the facets that were specified under the component getUIComponent() and adds them as facets of the parameter parent component.

Parameters:
context -
parent -
facetName -
Throws:
FacesPageException