org.apache.myfaces.view.facelets
Class AbstractFaceletContext

java.lang.Object
  extended by javax.el.ELContext
      extended by javax.faces.view.facelets.FaceletContext
          extended by org.apache.myfaces.view.facelets.AbstractFaceletContext

public abstract class AbstractFaceletContext
extends FaceletContext

This class contains methods that belongs to original FaceletContext shipped in facelets code before 2.0, but does not take part from api, so are considered implementation details. This includes methods related to template handling feature of facelets (called by ui:composition, ui:define and ui:insert). The methods here are only used by the current implementation and the intention is not expose it as public api. Aditionally, it also contains methods used by the current implementation for implement new features, like composite components and UniqueIdVendor support.

Since:
2.0
Version:
$Revision: 905140 $ $Date: 2010-01-31 18:35:58 -0500 (Sun, 31 Jan 2010) $
Author:
Leonardo Uribe (latest modification by $Author: lu4242 $)

Field Summary
 
Fields inherited from class javax.faces.view.facelets.FaceletContext
FACELET_CONTEXT_KEY
 
Constructor Summary
AbstractFaceletContext()
           
 
Method Summary
abstract  void applyCompositeComponent(UIComponent parent, Resource resource)
          Apply the facelet referenced by a url containing a composite component definition to the current UIComponent.
abstract  void extendClient(TemplateClient client)
           
abstract  java.util.Iterator<AjaxHandler> getAjaxHandlers()
          Return a descending iterator containing the ajax handlers to be applied to an specific component that implements ClientBehaviorHolder interface, according to the conditions specified on jsf 2.0 spec section 10.4.1.1.
abstract  UIComponent getCompositeComponentFromStack()
          Return the composite component being applied on the current facelet.
abstract  java.util.Iterator<java.lang.String> getEnclosingValidatorIds()
          Gets all validationIds on the stack.
abstract  java.util.Iterator<java.lang.String> getExcludedValidatorIds()
          Gets all validationIds on the stack.
abstract  java.lang.String getFirstValidationGroupFromStack()
          Gets the top of the validationGroups stack.
abstract  UniqueIdVendor getUniqueIdVendorFromStack()
          Return the latest UniqueIdVendor created from stack.
abstract  boolean includeDefinition(UIComponent parent, java.lang.String name)
          This method will walk through the TemplateClient stack to resolve and apply the definition for the passed name.
abstract  boolean isBuildingCompositeComponentMetadata()
          Check if this build is for build composite component metadata
abstract  boolean isMarkInitialState()
          Check if this build should be marked as initial state.
abstract  boolean isRefreshingTransientBuild()
          Check if this build is being refreshed, adding transient components and adding/removing components under c:if or c:forEach or not.
abstract  boolean isRefreshTransientBuildOnPSS()
          Check if the current view will be refreshed with partial state saving.
abstract  boolean isUsingPSSOnThisView()
          Check if we are using partial state saving on this view
abstract  void popAjaxHandlerToStack()
           
abstract  void popClient(TemplateClient client)
          Pop the last added TemplateClient
abstract  void popCompositeComponentToStack()
           
abstract  void popEnclosingValidatorIdToStack()
          Removes top of stack.
abstract  void popExcludedValidatorIdToStack()
          Removes top of stack.
abstract  void popUniqueIdVendorToStack()
           
abstract  void popValidationGroupsToStack()
          Removes top of stack.
abstract  void pushAjaxHandlerToStack(AjaxHandler parent)
           
abstract  void pushClient(TemplateClient client)
          Push the passed TemplateClient onto the stack for Definition Resolution
abstract  void pushCompositeComponentToStack(UIComponent parent)
           
abstract  void pushEnclosingValidatorIdToStack(java.lang.String validatorId)
          Pushes validatorId to the stack of all enclosing validatorIds.
abstract  void pushExcludedValidatorIdToStack(java.lang.String validatorId)
          Pushes validatorId to the stack of excluded validatorIds.
abstract  void pushUniqueIdVendorToStack(UniqueIdVendor parent)
           
abstract  void pushValidationGroupsToStack(java.lang.String validationGroups)
          Pushes validationGroups to the stack.
 
Methods inherited from class javax.faces.view.facelets.FaceletContext
generateUniqueId, getAttribute, getExpressionFactory, getFacesContext, includeFacelet, includeFacelet, setAttribute, setFunctionMapper, setVariableMapper
 
Methods inherited from class javax.el.ELContext
getContext, getELResolver, getFunctionMapper, getLocale, getVariableMapper, isPropertyResolved, putContext, setLocale, setPropertyResolved
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractFaceletContext

public AbstractFaceletContext()
Method Detail

pushClient

public abstract void pushClient(TemplateClient client)
Push the passed TemplateClient onto the stack for Definition Resolution

Parameters:
client -
See Also:
TemplateClient

popClient

public abstract void popClient(TemplateClient client)
Pop the last added TemplateClient

See Also:
TemplateClient

extendClient

public abstract void extendClient(TemplateClient client)

includeDefinition

public abstract boolean includeDefinition(UIComponent parent,
                                          java.lang.String name)
                                   throws java.io.IOException,
                                          FaceletException,
                                          FacesException,
                                          javax.el.ELException
This method will walk through the TemplateClient stack to resolve and apply the definition for the passed name. If it's been resolved and applied, this method will return true.

Parameters:
parent - the UIComponent to apply to
name - name or null of the definition you want to apply
Returns:
true if successfully applied, otherwise false
Throws:
java.io.IOException
FaceletException
FacesException
javax.el.ELException

applyCompositeComponent

public abstract void applyCompositeComponent(UIComponent parent,
                                             Resource resource)
                                      throws java.io.IOException,
                                             FaceletException,
                                             FacesException,
                                             javax.el.ELException
Apply the facelet referenced by a url containing a composite component definition to the current UIComponent. In other words, apply the section composite:implementation in the facelet to the current component. We need to do this here because DefaultFacelet is the one who has and handle the current FaceletFactory instance.

Parameters:
parent -
url -
Throws:
java.io.IOException
FaceletException
FacesException
javax.el.ELException

getCompositeComponentFromStack

public abstract UIComponent getCompositeComponentFromStack()
Return the composite component being applied on the current facelet. Note this is different to UIComponent.getCurrentCompositeComponent, because a composite component is added to the stack each time a composite:implementation tag handler is applied. This could be used by InsertChildrenHandler and InsertFacetHandler to retrieve the current composite component to be applied.

Parameters:
facesContext -
Returns:
Since:
2.0

pushCompositeComponentToStack

public abstract void pushCompositeComponentToStack(UIComponent parent)
Parameters:
parent -
Since:
2.0

popCompositeComponentToStack

public abstract void popCompositeComponentToStack()
Since:
2.0

getUniqueIdVendorFromStack

public abstract UniqueIdVendor getUniqueIdVendorFromStack()
Return the latest UniqueIdVendor created from stack. The reason why we need to keep a UniqueIdVendor stack is because we need to look the closest one in ComponentTagHandlerDelegate. Note that facelets tree is built from leafs to root, that means use UIComponent.getParent() does not always return parent components.

Returns:
Since:
2.0

pushUniqueIdVendorToStack

public abstract void pushUniqueIdVendorToStack(UniqueIdVendor parent)
Parameters:
parent -
Since:
2.0

popUniqueIdVendorToStack

public abstract void popUniqueIdVendorToStack()
Since:
2.0

getAjaxHandlers

public abstract java.util.Iterator<AjaxHandler> getAjaxHandlers()
Return a descending iterator containing the ajax handlers to be applied to an specific component that implements ClientBehaviorHolder interface, according to the conditions specified on jsf 2.0 spec section 10.4.1.1.

Since:
2.0

popAjaxHandlerToStack

public abstract void popAjaxHandlerToStack()
Since:
2.0

pushAjaxHandlerToStack

public abstract void pushAjaxHandlerToStack(AjaxHandler parent)
Since:
2.0

getFirstValidationGroupFromStack

public abstract java.lang.String getFirstValidationGroupFromStack()
Gets the top of the validationGroups stack.

Returns:
Since:
2.0

popValidationGroupsToStack

public abstract void popValidationGroupsToStack()
Removes top of stack.

Since:
2.0

pushValidationGroupsToStack

public abstract void pushValidationGroupsToStack(java.lang.String validationGroups)
Pushes validationGroups to the stack.

Parameters:
validationGroups -
Since:
2.0

getExcludedValidatorIds

public abstract java.util.Iterator<java.lang.String> getExcludedValidatorIds()
Gets all validationIds on the stack.

Returns:
Since:
2.0

popExcludedValidatorIdToStack

public abstract void popExcludedValidatorIdToStack()
Removes top of stack.

Since:
2.0

pushExcludedValidatorIdToStack

public abstract void pushExcludedValidatorIdToStack(java.lang.String validatorId)
Pushes validatorId to the stack of excluded validatorIds.

Parameters:
validatorId -
Since:
2.0

getEnclosingValidatorIds

public abstract java.util.Iterator<java.lang.String> getEnclosingValidatorIds()
Gets all validationIds on the stack.

Returns:
Since:
2.0

popEnclosingValidatorIdToStack

public abstract void popEnclosingValidatorIdToStack()
Removes top of stack.

Since:
2.0

pushEnclosingValidatorIdToStack

public abstract void pushEnclosingValidatorIdToStack(java.lang.String validatorId)
Pushes validatorId to the stack of all enclosing validatorIds.

Parameters:
validatorId -
Since:
2.0

isRefreshingTransientBuild

public abstract boolean isRefreshingTransientBuild()
Check if this build is being refreshed, adding transient components and adding/removing components under c:if or c:forEach or not.

Returns:
Since:
2.0

isMarkInitialState

public abstract boolean isMarkInitialState()
Check if this build should be marked as initial state. In other words, all components must call UIComponent.markInitialState.

Returns:
Since:
2.0

isBuildingCompositeComponentMetadata

public abstract boolean isBuildingCompositeComponentMetadata()
Check if this build is for build composite component metadata

Returns:
Since:
2.0

isRefreshTransientBuildOnPSS

public abstract boolean isRefreshTransientBuildOnPSS()
Check if the current view will be refreshed with partial state saving. This param is used in two posible events: 1. To notify UIInstruction instances to look for instances moved by cc:insertChildren or cc:insertFacet. 2. To do proper actions when a tag that could change tree structure is applied (c:if, c:forEach...)

Returns:
Since:
2.0

isUsingPSSOnThisView

public abstract boolean isUsingPSSOnThisView()
Check if we are using partial state saving on this view

Returns:
Since:
2.0


Copyright © 2010 The Apache Software Foundation. All Rights Reserved.