- java.lang.Object
-
- javax.faces.view.ViewMetadata
-
public abstract class ViewMetadata extends Object
ViewMetadata
is reponsible for extracting and providing view parameter metadata from VDL views. BecauseViewDeclarationLanguage.getViewMetadata(javax.faces.context.FacesContext, java.lang.String)
is required to returnnull
for JSP views and non-null
for views authored in Facelets for JSF 2, this specification only applys to Facelets for JSF 2.- Since:
- 2.0
-
-
Constructor Summary
Constructors Constructor and Description ViewMetadata()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description abstract UIViewRoot
createMetadataView(FacesContext context)
Creates a new
UIViewRoot
containing only view parameter metadata.static Collection<UIViewAction>
getViewActions(UIViewRoot root)
Utility method to extract view metadata from the provided
UIViewRoot
.abstract String
getViewId()
static Collection<UIViewParameter>
getViewParameters(UIViewRoot root)
Utility method to extract view metadata from the provided
UIViewRoot
.static boolean
hasMetadata(UIViewRoot root)
Utility method to determine if the the provided
UIViewRoot
has metadata.
-
-
-
Method Detail
-
getViewId
public abstract String getViewId()
- Returns:
- the view ID for which this
ViewMetadata
instance was created
-
createMetadataView
public abstract UIViewRoot createMetadataView(FacesContext context)
Creates a new
UIViewRoot
containing only view parameter metadata. The processing of building thisUIViewRoot
with metadata should not cause any events to be published to the application. The implementation must callFacesContext.setProcessingEvents(boolean)
passingfalse
as the argument, at the beginning of the method, and passtrue
to the same method at the end. The implementation must ensure that this happens regardless of ant exceptions that may be thrown.- Parameters:
context
- theFacesContext
for the current request- Returns:
- a
UIViewRoot
containing only view parameter metadata (if any)
-
getViewParameters
public static Collection<UIViewParameter> getViewParameters(UIViewRoot root)
Utility method to extract view metadata from the provided
UIViewRoot
.- Parameters:
root
- theUIViewRoot
from which the metadata will be extracted.- Returns:
- a
Collection
ofUIViewParameter
instances. If the view has no metadata, the collection will be empty.
-
getViewActions
public static Collection<UIViewAction> getViewActions(UIViewRoot root)
Utility method to extract view metadata from the provided
UIViewRoot
.- Parameters:
root
- theUIViewRoot
from which the metadata will be extracted.- Returns:
- a
Collection
ofUIViewAction
instances. If the view has no metadata, the collection will be empty.
-
hasMetadata
public static boolean hasMetadata(UIViewRoot root)
Utility method to determine if the the provided
UIViewRoot
has metadata. The default implementation will return true if the providedUIViewRoot
has a facet namedUIViewRoot.METADATA_FACET_NAME
and that facet has children. It will return false otherwise.- Parameters:
root
- theUIViewRoot
from which the metadata will be extracted from- Returns:
- true if the view has metadata, false otherwise.
-
-
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 07:37:17 Cette version de la page est en cache (à la date du 22/08/2025 07:37:17) 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/viewmetadata.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
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.