- All Implemented Interfaces:
- FaceletHandler
- Direct Known Subclasses:
- ComponentRefHandler,- CompositeComponentTagHandler,- HtmlComponentHandler,- PassThroughElementComponentHandler,- RenderFacetHandler,- RepeatHandler,- ScriptResourceHandler,- StylesheetResourceHandler
 Public base class for markup element instances that map to
 UIComponent instances in the view.
 
 Instances of this class are created and passed to
 TagHandlerDelegateFactory.createComponentHandlerDelegate(jakarta.faces.view.facelets.ComponentHandler) when a tag corresponding to this particular
 component is encountered in a Facelet view. A custom tag handler for a component, converter, validator, or behavior
 must extend from this class. In this way, this instance acts as a delegate for the implementation private tag
 handler. Such a subclass may choose to override as many or as few methods from this base class as desired. If the
 subclass wants to completely override the action of the implementation specific tag for which this component is the
 delegate, it must override the apply() method and make it take the following actions, in this
 order. These actions must only happen the first time this facelet is applied for each user. Subsequent
 applications must take no action.
 
- 
 The UIComponentrepresented by this element is created with the appropriateApplication.createComponent()method.
- 
 Each attribute specified in the markup is correctly applied to the component instance, as specified in the VDLDocs for this element. 
- 
 If project stage is ProjectStage.Development, Put theLocationfor this element into the component attributeMapunder the key given by the value of the symbolic constantUIComponent.VIEW_LOCATION_KEY.
- 
 Set the id of the component. If the id is specified manually by the page author, that value must be set as the id. Otherwise, the closest ancestor component that is an instance of UniqueIdVendormust be located and itsUniqueIdVendor.createUniqueId(jakarta.faces.context.FacesContext, java.lang.String)method must be called to derive the id. If no such instance can be found, callUIViewRoot.createUniqueId()to derive the id.
- 
 The rendererType property of the component is set properly. 
- 
 UIComponent.pushComponentToEL(jakarta.faces.context.FacesContext, jakarta.faces.component.UIComponent)is called on the newly created component.
- 
 The next handler in the facelet chain is applied. This will cause the component to be populated with children. 
- 
 The component is added to its parent in the view. 
- 
 UIComponent.popComponentFromEL(jakarta.faces.context.FacesContext)is called on the newly created component.
A common use case for extending this class is to gain access to the process by which the Facelets runtime creates component instances corresponding to markup in a Facelets view. These three methods are useful in such cases.
- 
 To control the instantiation of the UIComponentinstance, subclasses may overridecreateComponent(jakarta.faces.view.facelets.FaceletContext). If this method is not overridden, the tag handler for which this instance is the delegate will take the necessary action to instantiate theUIComponent.
- 
 To be notified of creation of the UIComponentinstance, subclasses may overrideonComponentCreated(jakarta.faces.view.facelets.FaceletContext, jakarta.faces.component.UIComponent, jakarta.faces.component.UIComponent).
- 
 To be notified that the freshly created UIComponentinstance has been populated with children as a result of execution of child tag handlers, subclasses may overrideonComponentPopulated(jakarta.faces.view.facelets.FaceletContext, jakarta.faces.component.UIComponent, jakarta.faces.component.UIComponent).
- Since:
- 2.0
- 
Field SummaryFields inherited from class jakarta.faces.view.facelets.DelegatingMetaTagHandlerdelegateFactoryFields inherited from class jakarta.faces.view.facelets.TagHandlernextHandler, tag, tagId
- 
Constructor SummaryConstructorsConstructorDescriptionComponentHandler(ComponentConfig config) Leverage theTagHandlerDelegateFactoryprovided by the implementation to create an instance ofTagHandlerDelegatedesigned for use withComponentHandler.
- 
Method SummaryModifier and TypeMethodDescriptionSubclasses that wish to take over the task of instantiating theUIComponentinstance corresponding to this tag handler my override this method to do so.Returns the component configuration, a component-type/renderer-type pair.protected TagHandlerDelegateGet the tag handler delegate.static booleanisNew(UIComponent component) Determine if the passed component is not null and if it's new to the tree.voidonComponentCreated(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.voidonComponentPopulated(FaceletContext ctx, UIComponent c, UIComponent parent) This method is guaranteed to be called after the component has been populated with children.Methods inherited from class jakarta.faces.view.facelets.DelegatingMetaTagHandlerapply, applyNextHandler, createMetaRuleset, getBinding, getTag, getTagAttribute, getTagId, isDisabled, setAttributesMethods inherited from class jakarta.faces.view.facelets.TagHandlergetAttribute, getRequiredAttribute, toString
- 
Constructor Details- 
ComponentHandlerLeverage the TagHandlerDelegateFactoryprovided by the implementation to create an instance ofTagHandlerDelegatedesigned for use withComponentHandler.- Parameters:
- config- the configuration for this handler.
- Since:
- 2.0
 
 
- 
- 
Method Details- 
getTagHandlerDelegateDescription copied from class:DelegatingMetaTagHandlerGet 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:
- getTagHandlerDelegatein class- DelegatingMetaTagHandler
- Returns:
- the tag handler delegate.
 
- 
getComponentConfigReturns the component configuration, a component-type/renderer-type pair.- Returns:
- the component configuration
 
- 
createComponentSubclasses that wish to take over the task of instantiating the UIComponentinstance corresponding to this tag handler my override this method to do so. Anullreturn from this method will cause theTagHandlerDelegatefor instance to create the component instead.- Parameters:
- ctx- the- FaceletContextfor this view execution
- Returns:
- the newly created UIComponent
- Since:
- 2.2
 
- 
onComponentCreatedThis method is guaranteed to be called after the component has been created but before it has been populated with children. - Parameters:
- ctx- the- FaceletContextfor this view execution
- c- the- UIComponentthat has just been created.
- parent- the parent- UIComponentof the component represented by this element instance.
- Since:
- 2.0
 
- 
onComponentPopulatedThis method is guaranteed to be called after the component has been populated with children. - Parameters:
- ctx- the- FaceletContextfor this view execution
- c- the- UIComponentthat has just been populated with children.
- parent- the parent- UIComponentof the component represented by this element instance.
- Since:
- 2.0
 
- 
isNewDetermine 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 nulland the component is new during this run of the lifecycle.
- Since:
- 2.0
 
 
-