Class ComponentHandler

    • Constructor Detail

      • ComponentHandler

        public ComponentHandler​(ComponentConfig config)

        Leverage the TagHandlerDelegateFactory provided by the implementation to create an instance of TagHandlerDelegate designed for use with ComponentHandler.

        Parameters:
        config - the configuration for this handler.
        Since:
        2.0
    • Method Detail

      • getTagHandlerDelegate

        protected TagHandlerDelegate getTagHandlerDelegate()
        Description copied from class: DelegatingMetaTagHandler

        Get the tag handler delegate.

        Code that extends from DelegatingMetaTagHandler (directly or indirectly, as through extending ComponentHandler) must take care to decorate, not replace, the TagHandlerDelegate instance returned by this method. Failure to do so may produce unexpected results.

        Specified by:
        getTagHandlerDelegate in class DelegatingMetaTagHandler
        Returns:
        the tag handler delegate.
      • getComponentConfig

        public ComponentConfig getComponentConfig()
        Returns the component configuration, a component-type/renderer-type pair.
        Returns:
        the component configuration
      • createComponent

        public UIComponent createComponent​(FaceletContext ctx)

        Subclasses that wish to take over the task of instantiating the UIComponent instance corresponding to this tag handler my override this method to do so. A null return from this method will cause the TagHandlerDelegate for instance to create the component instead.

        Parameters:
        ctx - the FaceletContext for this view execution
        Returns:
        the newly created UIComponent
        Since:
        2.2
      • onComponentCreated

        public void onComponentCreated​(FaceletContext ctx,
                                       UIComponent c,
                                       UIComponent parent)

        This method is guaranteed to be called after the component has been created but before it has been populated with children.

        Parameters:
        ctx - the FaceletContext for this view execution
        c - the UIComponent that has just been created.
        parent - the parent UIComponent of the component represented by this element instance.
        Since:
        2.0
      • onComponentPopulated

        public void onComponentPopulated​(FaceletContext ctx,
                                         UIComponent c,
                                         UIComponent parent)

        This method is guaranteed to be called after the component has been populated with children.

        Parameters:
        ctx - the FaceletContext for this view execution
        c - the UIComponent that has just been populated with children.
        parent - the parent UIComponent of the component represented by this element instance.
        Since:
        2.0
      • isNew

        public static boolean isNew​(UIComponent component)

        Determine if the passed component is not null and if it's new to the tree. This operation can be used for determining if attributes should be wired to the component.

        Parameters:
        component - the component you wish to modify
        Returns:
        true if and only if the argument is not null and the component is new during this run of the lifecycle.
        Since:
        2.0