public abstract class DelegatingMetaTagHandler extends MetaTagHandler
Enable the Jakarta Faces implementation to provide the
appropriate behavior for the kind of MetaTagHandler
subclass for each kind of element in the view, while
providing a base-class from which those wanting to make a Java language custom tag handler can inherit. The Jakarta
Server Faces runtime provides the implementation of getTagHandlerDelegate()
for the appropriate subclass.
Modifier and Type | Field and Description |
---|---|
protected TagHandlerDelegateFactory |
delegateFactory
Class that defines methods relating to helping tag handler instances.
|
nextHandler, tag, tagId
Constructor and Description |
---|
DelegatingMetaTagHandler(TagConfig config)
Instantiates this handler with the given config.
|
Modifier and Type | Method and Description |
---|---|
void |
apply(FaceletContext ctx,
UIComponent parent)
The default implementation simply calls through to |
void |
applyNextHandler(FaceletContext ctx,
UIComponent c)
Invoke the |
protected MetaRuleset |
createMetaRuleset(java.lang.Class type)
The default implementation simply calls through to |
TagAttribute |
getBinding()
Return the "binding" attribute.
|
Tag |
getTag()
Return a reference to the
Tag instance corresponding to this TagHandler instance. |
TagAttribute |
getTagAttribute(java.lang.String localName)
Return the named attribute from the tag attributes.
|
protected abstract TagHandlerDelegate |
getTagHandlerDelegate()
Get the tag handler delegate. |
java.lang.String |
getTagId()
Return the tag id from the
TagConfig used to instantiate this handler. |
boolean |
isDisabled(FaceletContext ctx)
Returns the value of the "disabled" attribute.
|
void |
setAttributes(FaceletContext ctx,
java.lang.Object instance)
Invoking/extending this method will cause the results of the created MetaRuleset to auto-wire state to the passed
instance.
|
getAttribute, getRequiredAttribute, toString
protected TagHandlerDelegateFactory delegateFactory
public DelegatingMetaTagHandler(TagConfig config)
config
- the config used to instantiate this handler.protected abstract TagHandlerDelegate getTagHandlerDelegate()
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.
public boolean isDisabled(FaceletContext ctx)
ctx
- the context used for resolving the underlying attribute.public TagAttribute getBinding()
public Tag getTag()
Tag
instance corresponding to this TagHandler
instance.Tag
instance.public java.lang.String getTagId()
TagConfig
used to instantiate this handler.TagConfig
.public TagAttribute getTagAttribute(java.lang.String localName)
localName
- the name of the attribute.public void setAttributes(FaceletContext ctx, java.lang.Object instance)
MetaTagHandler
setAttributes
in class MetaTagHandler
ctx
- the Facelet context.instance
- the instance.public void apply(FaceletContext ctx, UIComponent parent) throws java.io.IOException
The default implementation simply calls through to TagHandlerDelegate.apply(jakarta.faces.view.facelets.FaceletContext, jakarta.faces.component.UIComponent)
.
ctx
- the FaceletContext
for this view executionparent
- the parent UIComponent
of the component represented by this element instance.java.io.IOException
- if unable to load relativePath
public void applyNextHandler(FaceletContext ctx, UIComponent c) throws java.io.IOException, FacesException, ELException
Invoke the apply()
method on this instance's TagHandler.nextHandler
.
ctx
- the FaceletContext
for this view executionc
- the UIComponent
of the component represented by this element instance.java.io.IOException
- if thrown by the next FaceletHandler
FaceletException
- if thrown by the next FaceletHandler
FacesException
- if thrown by the next FaceletHandler
ELException
- if thrown by the next FaceletHandler
protected MetaRuleset createMetaRuleset(java.lang.Class type)
The default implementation simply calls through to TagHandlerDelegate.createMetaRuleset(java.lang.Class)
and returns the
result.
createMetaRuleset
in class MetaTagHandler
type
- the Class
for which the MetaRuleset
must be created.MetaRuleset
.