org.apache.myfaces.view.facelets.impl
Class FaceletCompositionContextImpl

java.lang.Object
  extended by org.apache.myfaces.view.facelets.FaceletCompositionContext
      extended by org.apache.myfaces.view.facelets.impl.FaceletCompositionContextImpl

public class FaceletCompositionContextImpl
extends FaceletCompositionContext

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
 
Fields inherited from class org.apache.myfaces.view.facelets.FaceletCompositionContext
FACELET_COMPOSITION_CONTEXT_KEY
 
Constructor Summary
FaceletCompositionContextImpl(FaceletFactory factory, javax.faces.context.FacesContext facesContext)
           
 
Method Summary
 void addAttachedObjectHandler(javax.faces.component.UIComponent compositeComponentParent, javax.faces.view.AttachedObjectHandler handler)
          Add to the composite component parent this handler, so it will be processed later when ViewDeclarationLanguage.retargetAttachedObjects is called.
 void addMethodExpressionTargeted(javax.faces.component.UIComponent targetedComponent, java.lang.String attributeName, java.lang.Object backingValue)
          Add a method expression as targeted for the provided composite component
 void clearMethodExpressionAttribute(javax.faces.component.UIComponent compositeComponentParent, java.lang.String attributeName)
          Clear the MethodExpression attribute to call vdl.retargetMethodExpression again
 void finalizeForDeletion(javax.faces.component.UIComponent component)
          Used in conjunction with markForDeletion where any UIComponent marked will be removed.
 java.util.List<javax.faces.view.AttachedObjectHandler> getAttachedObjectHandlers(javax.faces.component.UIComponent compositeComponentParent)
          Retrieve the list of object handlers attached to a composite component parent.
 javax.faces.component.UIComponent getCompositeComponentFromStack()
          Return the composite component being applied on the current facelet.
 java.util.Iterator<java.lang.String> getEnclosingValidatorIds()
          Gets all validationIds on the stack.
 java.util.Iterator<java.lang.String> getExcludedValidatorIds()
          Gets all validationIds on the stack.
 FaceletFactory getFaceletFactory()
           
 java.lang.String getFirstValidationGroupFromStack()
          Gets the top of the validationGroups stack.
 javax.faces.component.UniqueIdVendor getUniqueIdVendorFromStack()
          Return the latest UniqueIdVendor created from stack.
 boolean isMarkInitialState()
          Check if this build should be marked as initial state.
 boolean isMarkInitialStateAndIsRefreshTransientBuildOnPSS()
           
 boolean isMethodExpressionAttributeApplied(javax.faces.component.UIComponent compositeComponentParent, java.lang.String attributeName)
          Check if the MethodExpression attribute has been applied using vdl.retargetMethodExpression
 boolean isRefreshingTransientBuild()
          Check if this build is being refreshed, adding transient components and adding/removing components under c:if or c:forEach or not.
 boolean isRefreshTransientBuildOnPSS()
          Check if the current view will be refreshed with partial state saving.
 boolean isUsingPSSOnThisView()
          Check if we are using partial state saving on this view
 void markForDeletion(javax.faces.component.UIComponent component)
          Marks all direct children and Facets with an attribute for deletion.
 void markMethodExpressionAttribute(javax.faces.component.UIComponent compositeComponentParent, java.lang.String attributeName)
          Mark the MethodExpression attribute as applied using vdl.retargetMethodExpression
 void popCompositeComponentToStack()
           
 void popEnclosingValidatorIdToStack()
          Removes top of stack.
 void popExcludedValidatorIdToStack()
          Removes top of stack.
 void popUniqueIdVendorToStack()
           
 void popValidationGroupsToStack()
          Removes top of stack.
 void pushCompositeComponentToStack(javax.faces.component.UIComponent parent)
           
 void pushEnclosingValidatorIdToStack(java.lang.String validatorId)
          Pushes validatorId to the stack of all enclosing validatorIds.
 void pushExcludedValidatorIdToStack(java.lang.String validatorId)
          Pushes validatorId to the stack of excluded validatorIds.
 void pushUniqueIdVendorToStack(javax.faces.component.UniqueIdVendor parent)
           
 void pushValidationGroupsToStack(java.lang.String validationGroups)
          Pushes validationGroups to the stack.
 void release(javax.faces.context.FacesContext facesContext)
          Releases the MyFaceletContext object.
 void removeAttachedObjectHandlers(javax.faces.component.UIComponent compositeComponentParent)
          Remove from the composite component parent the list of attached handlers.
 java.lang.Object removeMethodExpressionTargeted(javax.faces.component.UIComponent targetedComponent, java.lang.String attributeName)
          Remove a method expression as targeted for the provided composite component
 
Methods inherited from class org.apache.myfaces.view.facelets.FaceletCompositionContext
getCurrentInstance, getCurrentInstance, getCurrentInstance, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FaceletCompositionContextImpl

public FaceletCompositionContextImpl(FaceletFactory factory,
                                     javax.faces.context.FacesContext facesContext)
Method Detail

getFaceletFactory

public FaceletFactory getFaceletFactory()
Specified by:
getFaceletFactory in class FaceletCompositionContext

release

public void release(javax.faces.context.FacesContext facesContext)
Description copied from class: FaceletCompositionContext
Releases the MyFaceletContext object. This method must only be called by the code that created the MyFaceletContext.

Overrides:
release in class FaceletCompositionContext

getCompositeComponentFromStack

public javax.faces.component.UIComponent getCompositeComponentFromStack()
Description copied from class: FaceletCompositionContext
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.

Specified by:
getCompositeComponentFromStack in class FaceletCompositionContext
Returns:

pushCompositeComponentToStack

public void pushCompositeComponentToStack(javax.faces.component.UIComponent parent)
Specified by:
pushCompositeComponentToStack in class FaceletCompositionContext

popCompositeComponentToStack

public void popCompositeComponentToStack()
Specified by:
popCompositeComponentToStack in class FaceletCompositionContext

getUniqueIdVendorFromStack

public javax.faces.component.UniqueIdVendor getUniqueIdVendorFromStack()
Description copied from class: FaceletCompositionContext
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.

Specified by:
getUniqueIdVendorFromStack in class FaceletCompositionContext
Returns:

popUniqueIdVendorToStack

public void popUniqueIdVendorToStack()
Specified by:
popUniqueIdVendorToStack in class FaceletCompositionContext

pushUniqueIdVendorToStack

public void pushUniqueIdVendorToStack(javax.faces.component.UniqueIdVendor parent)
Specified by:
pushUniqueIdVendorToStack in class FaceletCompositionContext

getFirstValidationGroupFromStack

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

Specified by:
getFirstValidationGroupFromStack in class FaceletCompositionContext
Returns:
Since:
2.0

popValidationGroupsToStack

public void popValidationGroupsToStack()
Removes top of stack.

Specified by:
popValidationGroupsToStack in class FaceletCompositionContext
Since:
2.0

pushValidationGroupsToStack

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

Specified by:
pushValidationGroupsToStack in class FaceletCompositionContext
Parameters:
validationGroups -
Since:
2.0

getExcludedValidatorIds

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

Specified by:
getExcludedValidatorIds in class FaceletCompositionContext
Returns:
Since:
2.0

popExcludedValidatorIdToStack

public void popExcludedValidatorIdToStack()
Removes top of stack.

Specified by:
popExcludedValidatorIdToStack in class FaceletCompositionContext
Since:
2.0

pushExcludedValidatorIdToStack

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

Specified by:
pushExcludedValidatorIdToStack in class FaceletCompositionContext
Parameters:
validatorId -
Since:
2.0

getEnclosingValidatorIds

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

Specified by:
getEnclosingValidatorIds in class FaceletCompositionContext
Returns:
Since:
2.0

popEnclosingValidatorIdToStack

public void popEnclosingValidatorIdToStack()
Removes top of stack.

Specified by:
popEnclosingValidatorIdToStack in class FaceletCompositionContext
Since:
2.0

pushEnclosingValidatorIdToStack

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

Specified by:
pushEnclosingValidatorIdToStack in class FaceletCompositionContext
Parameters:
validatorId -
Since:
2.0

isRefreshingTransientBuild

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

Specified by:
isRefreshingTransientBuild in class FaceletCompositionContext
Returns:

isMarkInitialState

public boolean isMarkInitialState()
Description copied from class: FaceletCompositionContext
Check if this build should be marked as initial state. In other words, all components must call UIComponent.markInitialState.

Specified by:
isMarkInitialState in class FaceletCompositionContext
Returns:

isRefreshTransientBuildOnPSS

public boolean isRefreshTransientBuildOnPSS()
Description copied from class: FaceletCompositionContext
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...)

Specified by:
isRefreshTransientBuildOnPSS in class FaceletCompositionContext
Returns:

isUsingPSSOnThisView

public boolean isUsingPSSOnThisView()
Description copied from class: FaceletCompositionContext
Check if we are using partial state saving on this view

Specified by:
isUsingPSSOnThisView in class FaceletCompositionContext
Returns:

isMarkInitialStateAndIsRefreshTransientBuildOnPSS

public boolean isMarkInitialStateAndIsRefreshTransientBuildOnPSS()
Specified by:
isMarkInitialStateAndIsRefreshTransientBuildOnPSS in class FaceletCompositionContext
Returns:

addAttachedObjectHandler

public void addAttachedObjectHandler(javax.faces.component.UIComponent compositeComponentParent,
                                     javax.faces.view.AttachedObjectHandler handler)
Description copied from class: FaceletCompositionContext
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.

Specified by:
addAttachedObjectHandler in class FaceletCompositionContext

removeAttachedObjectHandlers

public void removeAttachedObjectHandlers(javax.faces.component.UIComponent compositeComponentParent)
Description copied from class: FaceletCompositionContext
Remove from the composite component parent the list of attached handlers.

Specified by:
removeAttachedObjectHandlers in class FaceletCompositionContext

getAttachedObjectHandlers

public java.util.List<javax.faces.view.AttachedObjectHandler> getAttachedObjectHandlers(javax.faces.component.UIComponent compositeComponentParent)
Description copied from class: FaceletCompositionContext
Retrieve the list of object handlers attached to a composite component parent.

Specified by:
getAttachedObjectHandlers in class FaceletCompositionContext

addMethodExpressionTargeted

public void addMethodExpressionTargeted(javax.faces.component.UIComponent targetedComponent,
                                        java.lang.String attributeName,
                                        java.lang.Object backingValue)
Description copied from class: FaceletCompositionContext
Add a method expression as targeted for the provided composite component

Specified by:
addMethodExpressionTargeted in class FaceletCompositionContext
backingValue - A value that could be useful to revert its effects.

isMethodExpressionAttributeApplied

public boolean isMethodExpressionAttributeApplied(javax.faces.component.UIComponent compositeComponentParent,
                                                  java.lang.String attributeName)
Description copied from class: FaceletCompositionContext
Check if the MethodExpression attribute has been applied using vdl.retargetMethodExpression

Specified by:
isMethodExpressionAttributeApplied in class FaceletCompositionContext
Returns:

markMethodExpressionAttribute

public void markMethodExpressionAttribute(javax.faces.component.UIComponent compositeComponentParent,
                                          java.lang.String attributeName)
Description copied from class: FaceletCompositionContext
Mark the MethodExpression attribute as applied using vdl.retargetMethodExpression

Specified by:
markMethodExpressionAttribute in class FaceletCompositionContext

clearMethodExpressionAttribute

public void clearMethodExpressionAttribute(javax.faces.component.UIComponent compositeComponentParent,
                                           java.lang.String attributeName)
Description copied from class: FaceletCompositionContext
Clear the MethodExpression attribute to call vdl.retargetMethodExpression again

Specified by:
clearMethodExpressionAttribute in class FaceletCompositionContext

removeMethodExpressionTargeted

public java.lang.Object removeMethodExpressionTargeted(javax.faces.component.UIComponent targetedComponent,
                                                       java.lang.String attributeName)
Description copied from class: FaceletCompositionContext
Remove a method expression as targeted for the provided composite component

Specified by:
removeMethodExpressionTargeted in class FaceletCompositionContext
Returns:
A value that could be useful to revert its effects.

markForDeletion

public void markForDeletion(javax.faces.component.UIComponent component)
Description copied from class: FaceletCompositionContext
Marks all direct children and Facets with an attribute for deletion.

Specified by:
markForDeletion in class FaceletCompositionContext
Parameters:
component - UIComponent to mark
See Also:
#finalizeForDeletion(FaceletCompositionContext, UIComponent)

finalizeForDeletion

public void finalizeForDeletion(javax.faces.component.UIComponent component)
Description copied from class: FaceletCompositionContext
Used in conjunction with markForDeletion where any UIComponent marked will be removed.

Specified by:
finalizeForDeletion in class FaceletCompositionContext
Parameters:
component - UIComponent to finalize


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