public abstract class ViewMetadata extends Object
ViewMetadata is
reponsible for extracting and providing view parameter metadata from
VDL views. Because ViewDeclarationLanguage.getViewMetadata(javax.faces.context.FacesContext, java.lang.String)
is required to return null for Jakarta Server Pages views and
non-null for views authored in Facelets for Jakarta Server Faces 2, this
specification only applies to Facelets for Jakarta Server Faces 2.
| Constructor and Description |
|---|
ViewMetadata() |
| Modifier and Type | Method and Description |
|---|---|
abstract UIViewRoot |
createMetadataView(FacesContext context)
Creates a new |
static Collection<UIImportConstants> |
getImportConstants(UIViewRoot root)
Utility method to extract view metadata from the provided |
static Collection<UIViewAction> |
getViewActions(UIViewRoot root)
Utility method to extract view
metadata from the provided |
abstract String |
getViewId()
Get the view id |
static Collection<UIViewParameter> |
getViewParameters(UIViewRoot root)
Utility method to extract view
metadata from the provided |
static boolean |
hasMetadata(UIViewRoot root)
Utility method to determine if the
the provided |
public abstract String getViewId()
Get the view id
ViewMetadata instance
was createdpublic abstract UIViewRoot createMetadataView(FacesContext context)
Creates a new UIViewRoot
containing only view parameter metadata. The processing of
building this UIViewRoot with metadata should not
cause any events to be published to the application. The
implementation must call FacesContext.setProcessingEvents(boolean)
passing false as the argument, at the beginning of
the method, and pass true to the same method at the
end. The implementation must ensure that this happens regardless
of ant exceptions that may be thrown.
Take note a compliant implementation has to ensure that:
UIImportConstants must be processed after applying the tag handlers.
context - the FacesContext for the current requestUIViewRoot containing only view parameter metadata
(if any)public static Collection<UIViewParameter> getViewParameters(UIViewRoot root)
Utility method to extract view
metadata from the provided UIViewRoot.
root - the UIViewRoot from which the metadata will
be extracted.Collection of UIViewParameter
instances. If the view has no metadata, the collection will be
empty.public static Collection<UIViewAction> getViewActions(UIViewRoot root)
Utility method to extract view
metadata from the provided UIViewRoot.
root - the UIViewRoot from which the metadata will
be extracted.Collection of UIViewAction
instances. If the view has no metadata, the collection will be
empty.public static Collection<UIImportConstants> getImportConstants(UIViewRoot root)
Utility method to extract view metadata from the provided UIViewRoot.
root - The UIViewRoot from which the metadata will be extracted.Collection of UIImportConstants instances.
If the view has no metadata, the collection will be empty.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 provided UIViewRoot has a facet
named UIViewRoot.METADATA_FACET_NAME and that facet has children.
It will return false otherwise.
root - the UIViewRoot from which the metadata will
be extracted fromCopyright © 2019 Eclipse Foundation.
Use is subject to license terms.