org.apache.myfaces.view.facelets
Class FaceletCompositionContext

java.lang.Object
  extended by org.apache.myfaces.view.facelets.FaceletCompositionContext
Direct Known Subclasses:
FaceletCompositionContextImpl

public abstract class FaceletCompositionContext
extends java.lang.Object

Since:
2.0.1
Version:
$Revision: 899026 $ $Date: 2010-01-13 20:47:14 -0500 (MiƩ, 13 Ene 2010) $
Author:
Leonardo Uribe (latest modification by $Author: lu4242 $)

Field Summary
protected static java.lang.String FACELET_COMPOSITION_CONTEXT_KEY
           
 
Constructor Summary
protected FaceletCompositionContext()
           
 
Method Summary
abstract  void addAttachedObjectHandler(UIComponent compositeComponentParent, AttachedObjectHandler handler)
          Add to the composite component parent this handler, so it will be processed later when ViewDeclarationLanguage.retargetAttachedObjects is called.
abstract  java.util.List<AttachedObjectHandler> getAttachedObjectHandlers(UIComponent compositeComponentParent)
          Retrieve the list of object handlers attached to a composite component parent.
abstract  UIComponent getCompositeComponentFromStack()
          Return the composite component being applied on the current facelet.
static FaceletCompositionContext getCurrentInstance()
           
static FaceletCompositionContext getCurrentInstance(FaceletContext ctx)
           
static FaceletCompositionContext getCurrentInstance(FacesContext ctx)
           
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  FaceletFactory getFaceletFactory()
           
abstract  java.lang.String getFirstValidationGroupFromStack()
          Gets the top of the validationGroups stack.
abstract  UniqueIdVendor getUniqueIdVendorFromStack()
          Return the latest UniqueIdVendor created from stack.
 void init(FacesContext facesContext)
           
abstract  boolean isMarkInitialState()
          Check if this build should be marked as initial state.
abstract  boolean isMarkInitialStateAndIsRefreshTransientBuildOnPSS()
           
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 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 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.
 void release(FacesContext facesContext)
          Releases the MyFaceletContext object.
abstract  void removeAttachedObjectHandlers(UIComponent compositeComponentParent)
          Remove from the composite component parent the list of attached handlers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FACELET_COMPOSITION_CONTEXT_KEY

protected static final java.lang.String FACELET_COMPOSITION_CONTEXT_KEY
See Also:
Constant Field Values
Constructor Detail

FaceletCompositionContext

protected FaceletCompositionContext()
Method Detail

getCurrentInstance

public static FaceletCompositionContext getCurrentInstance()

getCurrentInstance

public static FaceletCompositionContext getCurrentInstance(FaceletContext ctx)

getCurrentInstance

public static FaceletCompositionContext getCurrentInstance(FacesContext ctx)

init

public void init(FacesContext facesContext)

release

public void release(FacesContext facesContext)
Releases the MyFaceletContext object. This method must only be called by the code that created the MyFaceletContext.


getFaceletFactory

public abstract FaceletFactory getFaceletFactory()

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

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

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

isMarkInitialStateAndIsRefreshTransientBuildOnPSS

public abstract boolean isMarkInitialStateAndIsRefreshTransientBuildOnPSS()

addAttachedObjectHandler

public abstract void addAttachedObjectHandler(UIComponent compositeComponentParent,
                                              AttachedObjectHandler handler)
Add to the composite component parent this handler, so it will be processed later when ViewDeclarationLanguage.retargetAttachedObjects is called. Tag Handlers exposing attached objects should call this method to expose them when the parent to be applied is a composite components.

Parameters:
compositeComponentParent -
handler -

removeAttachedObjectHandlers

public abstract void removeAttachedObjectHandlers(UIComponent compositeComponentParent)
Remove from the composite component parent the list of attached handlers.

Parameters:
compositeComponentParent -

getAttachedObjectHandlers

public abstract java.util.List<AttachedObjectHandler> getAttachedObjectHandlers(UIComponent compositeComponentParent)
Retrieve the list of object handlers attached to a composite component parent.

Parameters:
compositeComponentParent -


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