Class ViewMetadata
- java.lang.Object
-
- javax.faces.view.ViewMetadata
-
public abstract class ViewMetadata extends java.lang.ObjectViewMetadatais reponsible for extracting and providing view parameter metadata from VDL views. BecauseViewDeclarationLanguage.getViewMetadata(javax.faces.context.FacesContext, java.lang.String)is required to returnnullfor JSP views and non-nullfor views authored in Facelets for JSF 2, this specification only applys to Facelets for JSF 2.- Since:
- 2.0
-
-
Constructor Summary
Constructors Constructor Description ViewMetadata()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract UIViewRootcreateMetadataView(FacesContext context)Creates a newUIViewRootcontaining only view parameter metadata.static java.util.Collection<UIViewAction>getViewActions(UIViewRoot root)Utility method to extract view metadata from the providedUIViewRoot.abstract java.lang.StringgetViewId()static java.util.Collection<UIViewParameter>getViewParameters(UIViewRoot root)Utility method to extract view metadata from the providedUIViewRoot.static booleanhasMetadata(UIViewRoot root)Utility method to determine if the the providedUIViewRoothas metadata.
-
-
-
Method Detail
-
getViewId
public abstract java.lang.String getViewId()
- Returns:
- the view ID for which this
ViewMetadatainstance was created
-
createMetadataView
public abstract UIViewRoot createMetadataView(FacesContext context)
Creates a new
UIViewRootcontaining only view parameter metadata. The processing of building thisUIViewRootwith metadata should not cause any events to be published to the application. The implementation must callFacesContext.setProcessingEvents(boolean)passingfalseas the argument, at the beginning of the method, and passtrueto the same method at the end. The implementation must ensure that this happens regardless of ant exceptions that may be thrown.- Parameters:
context- theFacesContextfor the current request- Returns:
- a
UIViewRootcontaining only view parameter metadata (if any)
-
getViewParameters
public static java.util.Collection<UIViewParameter> getViewParameters(UIViewRoot root)
Utility method to extract view metadata from the provided
UIViewRoot.- Parameters:
root- theUIViewRootfrom which the metadata will be extracted.- Returns:
- a
CollectionofUIViewParameterinstances. If the view has no metadata, the collection will be empty.
-
getViewActions
public static java.util.Collection<UIViewAction> getViewActions(UIViewRoot root)
Utility method to extract view metadata from the provided
UIViewRoot.- Parameters:
root- theUIViewRootfrom which the metadata will be extracted.- Returns:
- a
CollectionofUIViewActioninstances. 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
UIViewRoothas metadata. The default implementation will return true if the providedUIViewRoothas a facet namedUIViewRoot.METADATA_FACET_NAMEand that facet has children. It will return false otherwise.- Parameters:
root- theUIViewRootfrom which the metadata will be extracted from- Returns:
- true if the view has metadata, false otherwise.
-
-