public abstract class ContextSwitchingComponent
extends org.apache.myfaces.trinidad.component.UIXComponentBase
implements org.apache.myfaces.trinidad.component.FlattenedComponent
The setupVisitingContext(javax.faces.context.FacesContext) method is called before a child component is being decoded, validated or updated. It is also called before an event is delivered to a child component. Implementations should provide an implmentation of this method that puts the EL variables into scope.
The tearDownVisitingContext(javax.faces.context.FacesContext) method is called after the child components have been processed. Implementations should restore any EL variables that were modified by setupVisitingContext(javax.faces.context.FacesContext).
| Constructor and Description |
|---|
ContextSwitchingComponent() |
ContextSwitchingComponent(String rendererType) |
| Modifier and Type | Method and Description |
|---|---|
void |
broadcast(javax.faces.event.FacesEvent event) |
protected void |
finishComponentEncoding(javax.faces.context.FacesContext context) |
boolean |
invokeOnComponent(javax.faces.context.FacesContext context, String clientId, javax.faces.component.ContextCallback callback)
Override to always setup the visiting context before invoking the callback, or our children
|
boolean |
isFlatteningChildren(javax.faces.context.FacesContext context)
Returns
true if this FlattenedComponent is currently flattening its children |
void |
processDecodes(javax.faces.context.FacesContext context) |
<S> boolean |
processFlattenedChildren(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.component.ComponentProcessingContext cpContext, org.apache.myfaces.trinidad.component.ComponentProcessor<S> childProcessor, S callbackContext)
Set up the component context, process all of the renderable children of this component, and the restore the previous context, returning true if any of the children were processed.
|
void |
processUpdates(javax.faces.context.FacesContext context) |
void |
processValidators(javax.faces.context.FacesContext context) |
void |
queueEvent(javax.faces.event.FacesEvent event) |
void |
restoreContext(javax.faces.context.FacesContext context) |
protected void |
setupChildrenVisitingContext(javax.faces.context.FacesContext context) |
void |
setupContext(javax.faces.context.FacesContext context)
Sets up the context of the component.
|
protected void |
setupVisitingContext(javax.faces.context.FacesContext context) |
protected void |
tearDownChildrenVisitingContext(javax.faces.context.FacesContext context) |
protected void |
tearDownVisitingContext(javax.faces.context.FacesContext context) |
adaptMethodBinding, addAttributeChange, addAttributeChangeListener, addClientBehavior, addComponentChange, addComponentChange, addComponentChangeFilter, addFacesListener, broadcastToMethodBinding, broadcastToMethodExpression, clearCachedClientIds, clearInitialState, createFacesBean, decode, decodeChildren, decodeChildrenImpl, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributeChangeListener, getAttributeChangeListeners, getAttributes, getBeanType, getBooleanProperty, getChildCount, getChildren, getClientBehaviors, getClientId, getComponentChangeFilters, getContainerClientId, getDefaultEventName, getFacesBean, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacetNames, getFacets, getFacetsAndChildren, getFamily, getId, getIntProperty, getLifecycleRenderer, getListenersForEventClass, getParent, getProperty, getPropertyKey, getRenderedFacetsAndChildren, getRenderer, getRendererType, getRendersChildren, getValueBinding, getValueExpression, initialStateMarked, invokeOnChildrenComponents, invokeOnNamingContainerComponent, isRendered, isTransient, markInitialState, processRestoreState, processSaveState, removeAttributeChangeListener, removeComponentChangeFilter, removeFacesListener, restoreState, satisfiesPartialTrigger, saveState, setAttributeChangeListener, setAttributeChangeListener, setBooleanProperty, setId, setIntProperty, setParent, setProperty, setRendered, setRendererType, setTransient, setupFlattenedChildrenContext, setupFlattenedContext, setValueBinding, setValueExpression, subscribeToEvent, tearDownFlattenedChildrenContext, tearDownFlattenedContext, toString, unsubscribeFromEvent, updateChildren, updateChildrenImpl, validateChildren, validateChildrenImpladdPartialTarget, broadcastInContext, clearCachedClientIds, defaultGetRenderedFacetsAndChildren, encodeFlattenedChild, encodeFlattenedChildren, getLogicalParent, getLogicalParent, getStateHelper, getStateHelper, isVisitable, partialEncodeVisit, processFlattenedChildren, processFlattenedChildren, processFlattenedChildren, processFlattenedChildren, setPartialTarget, setupChildrenEncodingContext, setupEncodingContext, setUpEncodingContext, tearDownChildrenEncodingContext, tearDownEncodingContext, visitAllChildren, visitChildren, visitChildren, visitTree, visitTreeencodeAll, getClientId, getCompositeComponentParent, getContainerClientId, getCurrentComponent, getCurrentCompositeComponent, getNamingContainer, getResourceBundleMap, getTransientStateHelper, getTransientStateHelper, isCompositeComponent, isInView, popComponentFromEL, processEvent, pushComponentToEL, restoreTransientState, saveTransientState, setInViewpublic ContextSwitchingComponent()
public ContextSwitchingComponent(String rendererType)
public final void setupContext(javax.faces.context.FacesContext context)
This method is meant to be called from the tag or tag handler as is not meant to be for non-tag consumption.
Note that this will set up both the visiting context as well as the children visiting context.
public final void restoreContext(javax.faces.context.FacesContext context)
public void queueEvent(javax.faces.event.FacesEvent event)
queueEvent in class org.apache.myfaces.trinidad.component.UIXComponentBaseprotected void setupVisitingContext(javax.faces.context.FacesContext context)
setupVisitingContext in class org.apache.myfaces.trinidad.component.UIXComponentprotected void tearDownVisitingContext(javax.faces.context.FacesContext context)
tearDownVisitingContext in class org.apache.myfaces.trinidad.component.UIXComponentprotected void setupChildrenVisitingContext(javax.faces.context.FacesContext context)
setupChildrenVisitingContext in class org.apache.myfaces.trinidad.component.UIXComponentprotected void tearDownChildrenVisitingContext(javax.faces.context.FacesContext context)
tearDownChildrenVisitingContext in class org.apache.myfaces.trinidad.component.UIXComponent
public void broadcast(javax.faces.event.FacesEvent event)
throws javax.faces.event.AbortProcessingException
broadcast in class org.apache.myfaces.trinidad.component.UIXComponentBasejavax.faces.event.AbortProcessingExceptionpublic void processDecodes(javax.faces.context.FacesContext context)
processDecodes in class org.apache.myfaces.trinidad.component.UIXComponentBasepublic void processValidators(javax.faces.context.FacesContext context)
processValidators in class org.apache.myfaces.trinidad.component.UIXComponentBasepublic void processUpdates(javax.faces.context.FacesContext context)
processUpdates in class org.apache.myfaces.trinidad.component.UIXComponentBase
public boolean invokeOnComponent(javax.faces.context.FacesContext context,
String clientId,
javax.faces.component.ContextCallback callback)
throws javax.faces.FacesException
invokeOnComponent in class org.apache.myfaces.trinidad.component.UIXComponentBasejavax.faces.FacesExceptionsetupVisitingContext(javax.faces.context.FacesContext), tearDownVisitingContext(javax.faces.context.FacesContext)
protected final void finishComponentEncoding(javax.faces.context.FacesContext context)
throws IOException
IOException
public <S> boolean processFlattenedChildren(javax.faces.context.FacesContext context,
org.apache.myfaces.trinidad.component.ComponentProcessingContext cpContext,
org.apache.myfaces.trinidad.component.ComponentProcessor<S> childProcessor,
S callbackContext)
throws IOException
processFlattenedChildren in interface org.apache.myfaces.trinidad.component.FlattenedComponentcontext - Current FacesContextcpContext - ComponentProcesingContext representing the current child iteration statechildProcessor - ComponentProcessor to call for each flattened childcallbackContext - childProcessor-specific context to be passed on each call to the childProcessorIOException - if an error occurs while processing childrenpublic boolean isFlatteningChildren(javax.faces.context.FacesContext context)
true if this FlattenedComponent is currently flattening its childrenisFlatteningChildren in interface org.apache.myfaces.trinidad.component.FlattenedComponentcontext - FacesContexttrue if this FlattenedComponent is currently flattening its children