public final void pushComponentToEL(FacesContext context, UIComponent component) {

        if (context == null) {
            throw new NullPointerException();
        }

        if (null == component) {
            component = this;
        }

        Map<Object, Object> contextAttributes = context.getAttributes();
        ArrayDeque<UIComponent> componentELStack = _getComponentELStack(_CURRENT_COMPONENT_STACK_KEY,
                                                               contextAttributes);
        componentELStack.push(component);
        component._isPushedAsCurrentRefCount++;
        
        // we only do this because of the spec
        boolean setCurrentComponent = isSetCurrentComponent(context);
        if (setCurrentComponent) {
            contextAttributes.put(UIComponent.CURRENT_COMPONENT, component);
        }
        
        // if the pushed component is a composite component, we need to update that
        // stack as well
        if (UIComponent.isCompositeComponent(component))
        {
          _getComponentELStack(_CURRENT_COMPOSITE_COMPONENT_STACK_KEY,
                               contextAttributes).push(component);

          // we only do this because of the spec
          if (setCurrentComponent) {
              contextAttributes.put(UIComponent.CURRENT_COMPOSITE_COMPONENT, component);
          }
        }
    }
public final void pushComponentToEL ( FacesContext context , UIComponent component ) { if ( context == null ) { throw new NullPointerException ( ) ; } if ( null == component ) { component = this ; } Map < Object , Object > contextAttributes = context . getAttributes ( ) ; ArrayDeque < UIComponent > componentELStack = _getComponentELStack ( _CURRENT_COMPONENT_STACK_KEY , contextAttributes ) ; componentELStack . push ( component ) ; component . _isPushedAsCurrentRefCount ++ ; boolean setCurrentComponent = isSetCurrentComponent ( context ) ; if ( setCurrentComponent ) { contextAttributes . put ( UIComponent . CURRENT_COMPONENT , component ) ; } if ( UIComponent . isCompositeComponent ( component ) ) { _getComponentELStack ( _CURRENT_COMPOSITE_COMPONENT_STACK_KEY , contextAttributes ) . push ( component ) ; if ( setCurrentComponent ) { contextAttributes . put ( UIComponent . CURRENT_COMPOSITE_COMPONENT , component ) ; } } }
<p class="changed_added_2_0">Push the current
<code>UIComponent</code> <code>this</code> to the {@link FacesContext}
attribute map using the key {@link #CURRENT_COMPONENT} saving the previous
<code>UIComponent</code> associated with {@link #CURRENT_COMPONENT} for a
subsequent call to {@link #popComponentFromEL}.</p>

<pclass="changed_added_2_0">This method and <code>popComponentFromEL()</code> form the basis for
the contract that enables the EL Expression "<code>#{component}</code>" to
resolve to the "current" component that is being processed in the
lifecycle.  The requirements for when <code>pushComponentToEL()</code> and
<code>popComponentFromEL()</code> must be called are specified as
needed in the javadoc for this class.</p>

<p class="changed_added_2_0">After
<code>pushComponentToEL()</code> returns, a call to {@link
#getCurrentComponent} must return <code>this</code>
<code>UIComponent</code> instance until
<code>popComponentFromEL()</code> is called, after which point
the previous <code>UIComponent</code> instance will be returned
from <code>getCurrentComponent()</code></p>

@param context the {@link FacesContext} for the current request
@param component the <code>component</code> to push to the EL.  If
<code>component</code> is <code>null</code> the <code>UIComponent</code>
instance that this call was invoked upon will be pushed to the EL.

@throws NullPointerException if <code>context</code> is <code>null</code>

@see javax.faces.context.FacesContext#getAttributes()

@since 2.0