Class DelegatingMetaTagHandler
- java.lang.Object
-
- jakarta.faces.view.facelets.TagHandler
-
- jakarta.faces.view.facelets.MetaTagHandler
-
- jakarta.faces.view.facelets.DelegatingMetaTagHandler
-
- All Implemented Interfaces:
FaceletHandler
- Direct Known Subclasses:
ComponentHandler
,FaceletsAttachedObjectHandler
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 ofgetTagHandlerDelegate()
for the appropriate subclass.
-
-
Field Summary
Fields Modifier and Type Field Description protected TagHandlerDelegateFactory
delegateFactory
Class that defines methods relating to helping tag handler instances.-
Fields inherited from class jakarta.faces.view.facelets.TagHandler
nextHandler, tag, tagId
-
-
Constructor Summary
Constructors Constructor Description DelegatingMetaTagHandler(TagConfig config)
Instantiates this handler with the given config.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
apply(FaceletContext ctx, UIComponent parent)
The default implementation simply calls through toTagHandlerDelegate.apply(jakarta.faces.view.facelets.FaceletContext, jakarta.faces.component.UIComponent)
.void
applyNextHandler(FaceletContext ctx, UIComponent c)
Invoke theapply()
method on this instance'sTagHandler.nextHandler
.protected MetaRuleset
createMetaRuleset(Class type)
The default implementation simply calls through toTagHandlerDelegate.createMetaRuleset(java.lang.Class)
and returns the result.TagAttribute
getBinding()
Return the "binding" attribute.Tag
getTag()
Return a reference to theTag
instance corresponding to thisTagHandler
instance.TagAttribute
getTagAttribute(String localName)
Return the named attribute from the tag attributes.protected abstract TagHandlerDelegate
getTagHandlerDelegate()
Get the tag handler delegate.String
getTagId()
Return the tag id from theTagConfig
used to instantiate this handler.boolean
isDisabled(FaceletContext ctx)
Returns the value of the "disabled" attribute.void
setAttributes(FaceletContext ctx, Object instance)
Invoking/extending this method will cause the results of the created MetaRuleset to auto-wire state to the passed instance.-
Methods inherited from class jakarta.faces.view.facelets.TagHandler
getAttribute, getRequiredAttribute, toString
-
-
-
-
Field Detail
-
delegateFactory
protected TagHandlerDelegateFactory delegateFactory
Class that defines methods relating to helping tag handler instances.
-
-
Constructor Detail
-
DelegatingMetaTagHandler
public DelegatingMetaTagHandler(TagConfig config)
Instantiates this handler with the given config.- Parameters:
config
- the config used to instantiate this handler.
-
-
Method Detail
-
getTagHandlerDelegate
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.
- Returns:
- the tag handler delegate.
-
isDisabled
public boolean isDisabled(FaceletContext ctx)
Returns the value of the "disabled" attribute.- Parameters:
ctx
- the context used for resolving the underlying attribute.- Returns:
- true if the "disabled" attribute has been set to true, false otherwise.
-
getBinding
public TagAttribute getBinding()
Return the "binding" attribute.- Returns:
- the "binding" attribute.
-
getTag
public Tag getTag()
Return a reference to theTag
instance corresponding to thisTagHandler
instance.- Returns:
- a reference to the
Tag
instance.
-
getTagId
public String getTagId()
Return the tag id from theTagConfig
used to instantiate this handler.- Returns:
- the tag id from the
TagConfig
.
-
getTagAttribute
public TagAttribute getTagAttribute(String localName)
Return the named attribute from the tag attributes.- Parameters:
localName
- the name of the attribute.- Returns:
- the named attribute from the tag attributes.
-
setAttributes
public void setAttributes(FaceletContext ctx, Object instance)
Description copied from class:MetaTagHandler
Invoking/extending this method will cause the results of the created MetaRuleset to auto-wire state to the passed instance.- Overrides:
setAttributes
in classMetaTagHandler
- Parameters:
ctx
- the Facelet context.instance
- the instance.
-
apply
public void apply(FaceletContext ctx, UIComponent parent) throws IOException
The default implementation simply calls through to
TagHandlerDelegate.apply(jakarta.faces.view.facelets.FaceletContext, jakarta.faces.component.UIComponent)
.- Parameters:
ctx
- theFaceletContext
for this view executionparent
- the parentUIComponent
of the component represented by this element instance.- Throws:
IOException
- if unable to loadrelativePath
- Since:
- 2.0
-
applyNextHandler
public void applyNextHandler(FaceletContext ctx, UIComponent c) throws IOException, FacesException, ELException
Invoke the
apply()
method on this instance'sTagHandler.nextHandler
.- Parameters:
ctx
- theFaceletContext
for this view executionc
- theUIComponent
of the component represented by this element instance.- Throws:
IOException
- if thrown by the nextFaceletHandler
FaceletException
- if thrown by the nextFaceletHandler
FacesException
- if thrown by the nextFaceletHandler
ELException
- if thrown by the nextFaceletHandler
- Since:
- 2.0
-
createMetaRuleset
protected MetaRuleset createMetaRuleset(Class type)
The default implementation simply calls through to
TagHandlerDelegate.createMetaRuleset(java.lang.Class)
and returns the result.- Specified by:
createMetaRuleset
in classMetaTagHandler
- Parameters:
type
- theClass
for which theMetaRuleset
must be created.- Returns:
- the
MetaRuleset
. - Since:
- 2.0
-
-