javax.faces.view.facelets

Class MetaRule


  • 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 JSF API object instance associated with that element. The single method on this interface, applyRule(java.lang.String, javax.faces.view.facelets.TagAttribute, javax.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, javax.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(javax.faces.event.ValueChangeListener).

    Since:
    2.0
    • Constructor Detail

      • MetaRule

        public MetaRule()
    • Method Detail

      • applyRule

        public abstract Metadata applyRule(String name,
                                           TagAttribute attribute,
                                           MetadataTarget meta)

        Return an abstraction that takes appropriate action given the kind of rule represented by the argument name, in the context of this particular concrete subclass of MetaRule. The abstraction must encapsulate the value from the argument attribute.

        Parameters:
        name - the name for this rule. This will generally be the name of a tag attribute in the VDL.
        attribute - the name/value pair for this attribute on this particular instance of an element in the page.
        meta - the MetadataTarged that can be used to discern what kind of action to encapsulate within the abstraction to be returned.
        Since:
        2.0

Traduction non disponible

Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.

Version en cache

22/08/2025 04:43:35 Cette version de la page est en cache (à la date du 22/08/2025 04:43:35) afin d'accélérer le traitement.
Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la version plus récente de la page.

Document créé le 11/06/2005, dernière modification le 18/08/2025
Source du document imprimé : https://www.gaudry.be/java-api-javaee-rf-javax/faces/view/facelets/metarule.html

L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.

Références

  1. Consulter le document html Langue du document :fr Manuel PHP : https://docs.oracle.com

Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.