Class ViewHandlerWrapper
- All Implemented Interfaces:
FacesWrapper<ViewHandler>
Provides a simple implementation of ViewHandler that can be
subclassed by developers wishing to provide specialized behavior to an existing ViewHandler instance. The
default implementation of all methods is to call through to the wrapped ViewHandler.
Usage: extend this class and push the implementation being wrapped to the constructor and use getWrapped() to
access the instance being wrapped.
- Since:
- 1.2
-
Field Summary
Fields inherited from class jakarta.faces.application.ViewHandler
CHARACTER_ENCODING_KEY, DEFAULT_FACELETS_SUFFIX, DEFAULT_SUFFIX, DEFAULT_SUFFIX_PARAM_NAME, DISABLE_FACELET_JSF_VIEWHANDLER_PARAM_NAME, FACELETS_BUFFER_SIZE_PARAM_NAME, FACELETS_DECORATORS_PARAM_NAME, FACELETS_LIBRARIES_PARAM_NAME, FACELETS_REFRESH_PERIOD_PARAM_NAME, FACELETS_SKIP_COMMENTS_PARAM_NAME, FACELETS_SUFFIX_PARAM_NAME, FACELETS_VIEW_MAPPINGS_PARAM_NAME -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Use the other constructor taking the implementation being wrapped.ViewHandlerWrapper(ViewHandler wrapped) If this view handler has been decorated, the implementation doing the decorating should push the implementation being wrapped to this constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddProtectedView(String urlPattern) The default behavior of this method is to callViewHandler.addProtectedView(java.lang.String)on the wrappedViewHandlerobject.calculateCharacterEncoding(FacesContext context) The default behavior of this method is to callViewHandler.calculateCharacterEncoding(jakarta.faces.context.FacesContext)on the wrappedViewHandlerobject.calculateLocale(FacesContext context) The default behavior of this method is to callViewHandler.calculateLocale(jakarta.faces.context.FacesContext)on the wrappedViewHandlerobject.calculateRenderKitId(FacesContext context) The default behavior of this method is to callViewHandler.calculateRenderKitId(jakarta.faces.context.FacesContext)on the wrappedViewHandlerobject.createView(FacesContext context, String viewId) The default behavior of this method is to callViewHandler.createView(jakarta.faces.context.FacesContext, String)on the wrappedViewHandlerobject.deriveLogicalViewId(FacesContext context, String requestViewId) The default behavior of this method is to callViewHandler.deriveLogicalViewId(jakarta.faces.context.FacesContext, String)on the wrappedViewHandlerobject.deriveViewId(FacesContext context, String requestViewId) The default behavior of this method is to callViewHandler.deriveViewId(jakarta.faces.context.FacesContext, String)on the wrappedViewHandlerobject.getActionURL(FacesContext context, String viewId) The default behavior of this method is to callViewHandler.getActionURL(jakarta.faces.context.FacesContext, String)on the wrappedViewHandlerobject.getBookmarkableURL(FacesContext context, String viewId, Map<String, List<String>> parameters, boolean includeViewParams) The default behavior of this method is to callViewHandler.getBookmarkableURL(jakarta.faces.context.FacesContext, String, java.util.Map, boolean)on the wrappedViewHandlerobject.The default behavior of this method is to callViewHandler.getProtectedViewsUnmodifiable()on the wrappedViewHandlerobject.getRedirectURL(FacesContext context, String viewId, Map<String, List<String>> parameters, boolean includeViewParams) The default behavior of this method is to callViewHandler.getRedirectURL(jakarta.faces.context.FacesContext, String, java.util.Map, boolean)on the wrappedViewHandlerobject.getResourceURL(FacesContext context, String path) The default behavior of this method is to callViewHandler.getResourceURL(jakarta.faces.context.FacesContext, String)on the wrappedViewHandlerobject.getViewDeclarationLanguage(FacesContext context, String viewId) The default behavior of this method is to callViewHandler.getViewDeclarationLanguage(jakarta.faces.context.FacesContext, java.lang.String)on the wrappedViewHandlerobject.getViews(FacesContext context, String path, int maxDepth, ViewVisitOption... options) The default behavior of this method is to callViewHandler.getViews(FacesContext, String, int, ViewVisitOption...)on the wrappedViewHandlerobject.getViews(FacesContext context, String path, ViewVisitOption... options) The default behavior of this method is to callViewHandler.getViews(FacesContext, String, ViewVisitOption...)on the wrappedViewHandlerobject.getWebsocketURL(FacesContext context, String channel) The default behavior of this method is to callViewHandler.getWebsocketURL(FacesContext, String)on the wrappedViewHandlerobject.A class that implements this interface uses this method to return an instance of the class being wrapped.voidinitView(FacesContext context) The default behavior of this method is to callViewHandler.initView(jakarta.faces.context.FacesContext)on the wrappedViewHandlerobject.booleanremoveProtectedView(String urlPattern) The default behavior of this method is to callViewHandler.removeProtectedView(java.lang.String)on the wrappedViewHandlerobject.voidrenderView(FacesContext context, UIViewRoot viewToRender) The default behavior of this method is to callViewHandler.renderView(jakarta.faces.context.FacesContext, jakarta.faces.component.UIViewRoot)on the wrappedViewHandlerobject.restoreView(FacesContext context, String viewId) The default behavior of this method is to callViewHandler.restoreView(jakarta.faces.context.FacesContext, String)on the wrappedViewHandlerobject.voidwriteState(FacesContext context) The default behavior of this method is to callViewHandler.writeState(jakarta.faces.context.FacesContext)on the wrappedViewHandlerobject.
-
Constructor Details
-
ViewHandlerWrapper
If this view handler has been decorated, the implementation doing the decorating should push the implementation being wrapped to this constructor. The
getWrapped()will then return the implementation being wrapped.- Parameters:
wrapped- The implementation being wrapped.- Since:
- 2.3
-
ViewHandlerWrapper
Deprecated.Use the other constructor taking the implementation being wrapped.
-
-
Method Details
-
getWrapped
Description copied from interface:FacesWrapperA class that implements this interface uses this method to return an instance of the class being wrapped.
- Specified by:
getWrappedin interfaceFacesWrapper<ViewHandler>- Returns:
- the wrapped instance.
-
initView
The default behavior of this method is to call
ViewHandler.initView(jakarta.faces.context.FacesContext)on the wrappedViewHandlerobject.- Overrides:
initViewin classViewHandler- Parameters:
context- the Faces context.- Throws:
FacesException- if a problem occurs setting the encoding, such as theUnsupportedEncodingExceptionthrown by the underlying Jakarta Servlet or Portlet technology when the encoding is not supported.- Since:
- 1.2
- See Also:
-
restoreView
The default behavior of this method is to call
ViewHandler.restoreView(jakarta.faces.context.FacesContext, String)on the wrappedViewHandlerobject.- Specified by:
restoreViewin classViewHandler- Parameters:
context-FacesContextfor the current requestviewId- the view identifier for the current request- Returns:
- the restored view root, or null.
- Since:
- 1.2
- See Also:
-
createView
The default behavior of this method is to call
ViewHandler.createView(jakarta.faces.context.FacesContext, String)on the wrappedViewHandlerobject.- Specified by:
createViewin classViewHandler- Parameters:
context- the Faces context.viewId- the view id.- Returns:
- the viewroot.
- Since:
- 1.2
- See Also:
-
renderView
public void renderView(FacesContext context, UIViewRoot viewToRender) throws IOException, FacesException The default behavior of this method is to call
ViewHandler.renderView(jakarta.faces.context.FacesContext, jakarta.faces.component.UIViewRoot)on the wrappedViewHandlerobject.- Specified by:
renderViewin classViewHandler- Parameters:
context-FacesContextfor the current requestviewToRender- the view to render- Throws:
IOException- if an input/output error occursFacesException- if a Jakarta Servlet error occurs- Since:
- 1.2
- See Also:
-
calculateCharacterEncoding
The default behavior of this method is to call
ViewHandler.calculateCharacterEncoding(jakarta.faces.context.FacesContext)on the wrappedViewHandlerobject.- Overrides:
calculateCharacterEncodingin classViewHandler- Parameters:
context- the Faces context.- Returns:
- the character encoding, or
null - Since:
- 1.2
- See Also:
-
calculateLocale
The default behavior of this method is to call
ViewHandler.calculateLocale(jakarta.faces.context.FacesContext)on the wrappedViewHandlerobject.- Specified by:
calculateLocalein classViewHandler- Parameters:
context-FacesContextfor the current request- Returns:
- the locale.
- Since:
- 1.2
- See Also:
-
deriveViewId
The default behavior of this method is to call
ViewHandler.deriveViewId(jakarta.faces.context.FacesContext, String)on the wrappedViewHandlerobject.- Overrides:
deriveViewIdin classViewHandler- Parameters:
context- theFacesContextfor this requestrequestViewId- theviewIdto derive,- Returns:
- the derived view id.
- Since:
- 2.0
- See Also:
-
deriveLogicalViewId
The default behavior of this method is to call
ViewHandler.deriveLogicalViewId(jakarta.faces.context.FacesContext, String)on the wrappedViewHandlerobject.- Overrides:
deriveLogicalViewIdin classViewHandler- Parameters:
context- theFacesContextfor this requestrequestViewId- theviewIdto derive,- Returns:
- the derived logical view id.
- Since:
- 2.1
- See Also:
-
calculateRenderKitId
The default behavior of this method is to call
ViewHandler.calculateRenderKitId(jakarta.faces.context.FacesContext)on the wrappedViewHandlerobject.- Specified by:
calculateRenderKitIdin classViewHandler- Parameters:
context-FacesContextfor the current request- Returns:
- the render kit id.
- Since:
- 1.2
- See Also:
-
getActionURL
The default behavior of this method is to call
ViewHandler.getActionURL(jakarta.faces.context.FacesContext, String)on the wrappedViewHandlerobject.- Specified by:
getActionURLin classViewHandler- Parameters:
context-FacesContextfor this requestviewId- View identifier of the desired view- Returns:
- the action url.
- Since:
- 1.2
- See Also:
-
getProtectedViewsUnmodifiable
The default behavior of this method is to call
ViewHandler.getProtectedViewsUnmodifiable()on the wrappedViewHandlerobject.- Overrides:
getProtectedViewsUnmodifiablein classViewHandler- Returns:
- the unmodifiable set of protected views.
- Since:
- 2.2
- See Also:
-
addProtectedView
The default behavior of this method is to call
ViewHandler.addProtectedView(java.lang.String)on the wrappedViewHandlerobject.- Overrides:
addProtectedViewin classViewHandler- Parameters:
urlPattern- the url-pattern to add.- Since:
- 2.2
- See Also:
-
removeProtectedView
The default behavior of this method is to call
ViewHandler.removeProtectedView(java.lang.String)on the wrappedViewHandlerobject.- Overrides:
removeProtectedViewin classViewHandler- Parameters:
urlPattern- the url-pattern to remove.- Returns:
trueif in theSet,falseotherwise.- Since:
- 2.2
- See Also:
-
getRedirectURL
public String getRedirectURL(FacesContext context, String viewId, Map<String, List<String>> parameters, boolean includeViewParams) The default behavior of this method is to call
ViewHandler.getRedirectURL(jakarta.faces.context.FacesContext, String, java.util.Map, boolean)on the wrappedViewHandlerobject.- Overrides:
getRedirectURLin classViewHandler- Parameters:
context- The FacesContext processing this requestviewId- The view identifier of the target pageparameters- A mapping of parameter names to one or more valuesincludeViewParams- A flag indicating whether view parameters should be encoded into this URL- Returns:
- the redirect URL.
- Since:
- 2.0
- See Also:
-
getBookmarkableURL
public String getBookmarkableURL(FacesContext context, String viewId, Map<String, List<String>> parameters, boolean includeViewParams) The default behavior of this method is to call
ViewHandler.getBookmarkableURL(jakarta.faces.context.FacesContext, String, java.util.Map, boolean)on the wrappedViewHandlerobject.- Overrides:
getBookmarkableURLin classViewHandler- Parameters:
context- The FacesContext processing this requestviewId- The view identifier of the target pageparameters- A mapping of parameter names to one or more valuesincludeViewParams- A flag indicating whether view parameters should be encoded into this URL- Returns:
- the bookmarkable URL.
- Since:
- 2.0
- See Also:
-
getResourceURL
The default behavior of this method is to call
ViewHandler.getResourceURL(jakarta.faces.context.FacesContext, String)on the wrappedViewHandlerobject.- Specified by:
getResourceURLin classViewHandler- Parameters:
context-FacesContextfor the current requestpath- Resource path to convert to a URL- Returns:
- the resource URL.
- Since:
- 1.2
- See Also:
-
getWebsocketURL
The default behavior of this method is to call
ViewHandler.getWebsocketURL(FacesContext, String)on the wrappedViewHandlerobject.- Specified by:
getWebsocketURLin classViewHandler- Parameters:
context-FacesContextfor the current request.channel- The channel name of the websocket.- Returns:
- the websocket URL.
- Since:
- 2.3
- See Also:
-
getViewDeclarationLanguage
The default behavior of this method is to call
ViewHandler.getViewDeclarationLanguage(jakarta.faces.context.FacesContext, java.lang.String)on the wrappedViewHandlerobject.- Overrides:
getViewDeclarationLanguagein classViewHandler- Parameters:
context- theFacesContextfor this request.viewId- the logical view id, as returned fromViewHandler.deriveLogicalViewId(jakarta.faces.context.FacesContext, java.lang.String)for which theViewDeclarationLanguageshould be returned.- Returns:
- the ViewDeclarationLanguage, or null.
- Since:
- 2.0
-
getViews
The default behavior of this method is to call
ViewHandler.getViews(FacesContext, String, ViewVisitOption...)on the wrappedViewHandlerobject.- Overrides:
getViewsin classViewHandler- Parameters:
context- TheFacesContextfor this request.path- The initial path from which to start looking for view ids.options- The options to influence the traversal. SeeViewVisitOptionfor details on those.- Returns:
- the
Streamof view ids - Since:
- 2.3
-
getViews
public Stream<String> getViews(FacesContext context, String path, int maxDepth, ViewVisitOption... options) The default behavior of this method is to call
ViewHandler.getViews(FacesContext, String, int, ViewVisitOption...)on the wrappedViewHandlerobject.- Overrides:
getViewsin classViewHandler- Parameters:
context- TheFacesContextfor this request.path- The initial path from which to start looking for view ids.maxDepth- The absolute maximum depth of nested directories to visit counted from the root (/).options- The options to influence the traversal. SeeViewVisitOptionfor details on those.- Returns:
- the
Streamof view ids - Since:
- 2.3
-
writeState
The default behavior of this method is to call
ViewHandler.writeState(jakarta.faces.context.FacesContext)on the wrappedViewHandlerobject.- Specified by:
writeStatein classViewHandler- Parameters:
context-FacesContextfor the current request- Throws:
IOException- if an input/output error occurs- Since:
- 1.2
- See Also:
-