javax.faces.view

Class ViewDeclarationLanguageWrapper

    • Constructor Detail

      • ViewDeclarationLanguageWrapper

        public ViewDeclarationLanguageWrapper()
    • Method Detail

      • getId

        public String getId()
        Description copied from class: ViewDeclarationLanguage

        Returns a non-null String that can be used to identify this view declaration language.

        The default implementation returns the fully qualified class name of the view declaration language implementation. Subclasses may override to provide a more meaningful id.

        Overrides:
        getId in class ViewDeclarationLanguage
      • retargetMethodExpressions

        public void retargetMethodExpressions(FacesContext context,
                                              UIComponent topLevelComponent)
        Description copied from class: ViewDeclarationLanguage

        Assuming the component metadata for argument topLevelComponent has been made available by an earlier call to ViewDeclarationLanguage.getComponentMetadata(javax.faces.context.FacesContext, javax.faces.application.Resource), leverage the component metadata for the purpose of re-targeting any method expressions from the top level component to the appropriate inner component. For each attribute that is a MethodExpression (as indicated by the presence of a "method-signature" attribute and the absence of a "type" attribute), the following action must be taken:

        • Get the value of the targets attribute. If the value is a ValueExpression evaluate it. If there is no targets attribute, let the name of the metadata element be the evaluated value of the targets attribute.

        • Interpret targets as a space (not tab) separated list of ids. For each entry in the list:

          • Find the inner component of the topLevelComponent with the id equal to the current list entry. For discussion, this component is called target. If not found, log and error and continue to the next attribute.

          • For discussion the declared name of the attribute is called name.

          • In the attributes map of the topLevelComponent, look up the entry under the key name. Assume the result is a ValueExpression. For discussion, this is attributeValueExpression. If not found, log an error and continue to the next attribute.

          • If name is equal to the string "action", or "actionListener" without the quotes, assume target is an ActionSource2.

          • If name is equal to the string "validator", or "valueChangeListener" without the quotes, assume target is an EditableValueHolder.

          • Call getExpressionString() on the attributeValueExpression and use that string to create a MethodExpression of the appropriate signature for name.

          • If name is not equal to any of the previously listed strings, call getExpressionString() on the attributeValueExpression and use that string to create a MethodExpression where the signature is created based on the value of the "method-signature" attribute of the <composite:attribute /> tag.

          • Let the resultant MethodExpression be called attributeMethodExpression for discussion.

          • If name is equal to the string "action" without the quotes, call ActionSource2.setActionExpression(javax.el.MethodExpression) on target, passing attributeMethodExpression.

          • If name is equal to the string "actionListener" without the quotes, call ActionSource.addActionListener(javax.faces.event.ActionListener) on target, passing attributeMethodExpression wrapped in a MethodExpressionActionListener.

          • If name is equal to the string "validator" without the quotes, call EditableValueHolder.addValidator(javax.faces.validator.Validator) on target, passing attributeMethodExpression wrapped in a MethodExpressionValidator.

          • If name is equal to the string "valueChangeListener" without the quotes, call EditableValueHolder.addValueChangeListener(javax.faces.event.ValueChangeListener) on target, passing attributeMethodExpression wrapped in a MethodExpressionValueChangeListener.

          • Otherwise, assume that the MethodExpression should be placed in the components attribute set. The runtme must create the MethodExpression instance based on the value of the "method-signature" attribute.

        An implementation is provided that will throw UnsupportedOperationException. A Faces implementation compliant with version 2.0 and beyond of the specification must override this method.

        Overrides:
        retargetMethodExpressions in class ViewDeclarationLanguage
        Parameters:
        context - the FacesContext for this request.
        topLevelComponent - The UIComponent in the view to which the attached objects must be attached. This UIComponent must have its component metadata already associated and available from via the JavaBeans API.
      • calculateResourceLibraryContracts

        public List<String> calculateResourceLibraryContracts(FacesContext context,
                                                              String viewId)
        Description copied from class: ViewDeclarationLanguage

        Return the list of resource library contracts that will be made available for use in the view specified by the argument viewId. If no match is found, return an empty list. See section JSF.7.7.2 for the specification of the default implementation. For backward compatibility with prior implementations, an implementation is provided that returns null, but any implementation compliant with the version of the specification in which this method was introduced must implement it as specified in JSF.7.7.2.

        Overrides:
        calculateResourceLibraryContracts in class ViewDeclarationLanguage
        Parameters:
        context - the FacesContext for this request
        viewId - the view id for which the applicable resource library contracts should be calculated.
      • createView

        public UIViewRoot createView(FacesContext context,
                                     String viewId)
        Description copied from class: ViewDeclarationLanguage

        Create a UIViewRoot from the VDL contained in the artifact referenced by the argument viewId. See section JSF.7.7.2 for the specification of the default implementation.

        Specified by:
        createView in class ViewDeclarationLanguage
        Parameters:
        context - the FacesContext for this request.
        viewId - the identifier of an artifact that contains the VDL syntax that describes this view.
      • createComponent

        public UIComponent createComponent(FacesContext context,
                                           String taglibURI,
                                           String tagName,
                                           Map<String,Object> attributes)
        Description copied from class: ViewDeclarationLanguage

        Create a component given a ViewDeclarationLanguage specific tag library URI and tag name. The runtime must support this method operating for the Facelets VDL. Other kinds of ViewDeclarationLanguage may be supported but are not required to be supported. For backward compatibility with decorated ViewDeclrationLanguage implementations that do not override this method, a default implementation is provided that returns null. However, any implementation that is compliant with the version of the specification in which this method was introduced must implement this method.

        Overrides:
        createComponent in class ViewDeclarationLanguage
        Parameters:
        context - the FacesContext for this request
        taglibURI - the fully qualified tag library URI that contains the component
        tagName - the name of the tag within that library that exposes the component
        attributes - any name=value pairs that would otherwise have been given on the markup that would cause the creation of this component or null if no attributes need be given.
      • getComponentMetadata

        public BeanInfo getComponentMetadata(FacesContext context,
                                             Resource componentResource)
        Description copied from class: ViewDeclarationLanguage

        Return a reference to the component metadata for the composite component represented by the argument componentResource, or null if the metadata cannot be found. See section JSF.7.7.2 for the specification of the default implementation. JSP implementations must throw UnsupportedOperationException.

        Specified by:
        getComponentMetadata in class ViewDeclarationLanguage
        Parameters:
        context - The FacesContext for this request.
        componentResource - The Resource that represents the component.
      • getScriptComponentResource

        public Resource getScriptComponentResource(FacesContext context,
                                                   Resource componentResource)
        Description copied from class: ViewDeclarationLanguage

        Take implementation specific action to discover a Resource given the argument componentResource. See section JSF.7.7.2 for the specification of the default implementation. JSP implementations must throw UnsupportedOperationException.

        Specified by:
        getScriptComponentResource in class ViewDeclarationLanguage
        Parameters:
        context - The FacesContext for this request.
        componentResource - The Resource that represents the component.
      • getViewMetadata

        public ViewMetadata getViewMetadata(FacesContext context,
                                            String viewId)
        Description copied from class: ViewDeclarationLanguage

        Return a reference to the view metadata for the view represented by the argument viewId, or null if the metadata cannot be found. See section JSF.7.7.2 for the specification of the default implementation. Facelets for JSF 2 implementation must return non-null. JSP implementations must return null.

        Specified by:
        getViewMetadata in class ViewDeclarationLanguage
        Parameters:
        context - The FacesContext for this request.
        viewId - the view id from whith to extract the metadata
      • restoreView

        public UIViewRoot restoreView(FacesContext context,
                                      String viewId)
        Description copied from class: ViewDeclarationLanguage

        Restore a UIViewRoot from a previously created view. See section JSF.7.7.2 for the specification of the default implementation.

        Specified by:
        restoreView in class ViewDeclarationLanguage
        Parameters:
        context - the FacesContext for this request.
        viewId - the identifier for a previously rendered view.

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

21/08/2025 18:57:09 Cette version de la page est en cache (à la date du 21/08/2025 18:57:09) 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/viewdeclarationlanguagewrapper.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.