Class MetaRule

java.lang.Object
jakarta.faces.view.facelets.MetaRule
Direct Known Subclasses:
EditableValueHolderRule, MethodRule, RenderPropertyRule

public abstract class MetaRule extends Object

The root class of the abstraction that dictates how attributes on a markup element in a Facelets VDL page are wired to the Jakarta Faces API object instance associated with that element. The single method on this interface, applyRule(java.lang.String, jakarta.faces.view.facelets.TagAttribute, jakarta.faces.view.facelets.MetadataTarget), returns an encapsulation of the behavior that actually does the work of handling the attribute and its value. There are implementations of specific concrete subclasses of this class for all the basic kinds of elements that appear in Facelets VDL pages: components, non-components, and attached objects.

For example, consider this markup:

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

Two MetaRule instances are involved in this example.

  1. The first has an applyRule() method that returns a Metadata instance that, when its applyMetada() method is called, dictates how the "value" attribute is processed: calling UIComponent.setValueExpression(java.lang.String, jakarta.el.ValueExpression) on the UIComponent instance associated with the <h:inputText> element.

  2. The second has an applyRule() method that returns a Metadata instance that, when its applyMetadata() method is called, dictates how the "valueChangeListener" attribute is processed: calling EditableValueHolder.addValueChangeListener(jakarta.faces.event.ValueChangeListener).

Since:
2.0