Top Description Fields Constructors Methods
javax.faces.view.facelets

public abstract Class MetaTagHandler

extends TagHandler
Class Inheritance
Known Direct Subclasses
javax.faces.view.facelets.DelegatingMetaTagHandler

Every kind of markup element in Facelets VDL that has attributes that need to take action on a JSF Java API artifact is associated with an instance of this class. This class is an abstraction to enable a rule based method for directing how different kinds of elements take different kinds of actions in the JSF Java API. For example, consider this markup:

<h:inputText value="#{user.userid}"
valueChangeListener="#{user.newUserId}" />

This markup element corresponds to an instance of javax.faces.component.html.HtmlInputText in the view. HtmlImputText has a number of attributes that are to be exposed to the page author. HtmlInputText also implements javax.faces.component.EditableValueHolder, which extends javax.faces.component.ValueHolder. Each of these interfaces also expose a number of attributes to the page author.

Facelets employes the strategy pattern to allow the manner in which all possible attributes are handled based on the nature of the JSF Java API artifact associated with the markup element.

Subclasses override the createMetaRuleset method to return a MetaRuleset instance encapsulating all the strategies for all the attributes that make sense for this particular markup element. The runtime calls the setAttributes(FaceletContext, Object) method to cause those rules to be executed and applied.

Since
2.0

Field Summary

Modifier and TypeField and Description
private Class<T>
lastType

Stores the last type.

private Metadata
mapper

Stores the mapper.

Inherited from javax.faces.view.facelets.TagHandler:
nextHandlertagtagId

Constructor Summary

AccessConstructor and Description
public
MetaTagHandler(TagConfig
the tag configuration.
config
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
protected abstract MetaRuleset

Returns:

the MetaRuleset.
createMetaRuleset
(Class<T>
the type.
type
)

Extend this method in order to add your own rules.

protected void
setAttributes(FaceletContext
the Facelet context.
ctx
,
Object
the instance.
instance
)

Invoking/extending this method will cause the results of the created MetaRuleset to auto-wire state to the passed instance.

Inherited from javax.faces.view.facelets.TagHandler:
getAttributegetRequiredAttributetoString

Field Detail

lastTypeback to summary
private Class<T> lastType

Stores the last type.

mapperback to summary
private Metadata mapper

Stores the mapper.

Constructor Detail

MetaTagHandlerback to summary
public MetaTagHandler(TagConfig config)

Constructor.

Parameters
config:TagConfig

the tag configuration.

Method Detail

createMetaRulesetback to summary
protected abstract MetaRuleset createMetaRuleset(Class<T> type)

Extend this method in order to add your own rules.

Parameters
type:Class<T>

the type.

Returns:MetaRuleset

the MetaRuleset.

setAttributesback to summary
protected 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.

Parameters
ctx:FaceletContext

the Facelet context.

instance:Object

the instance.