javax.faces.application

## Class ViewHandlerWrapper

- java.lang.Object
- - javax.faces.application.ViewHandler
  - - javax.faces.application.ViewHandlerWrapper

- All Implemented Interfaces:
    FacesWrapper<ViewHandler>

      public abstract class ViewHandlerWrapper
      extends ViewHandler
      implements 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 override `getWrapped()` to return the instance we are wrapping.

  Since:
    1.2

- - ### Field Summary

    - ### Fields inherited from class javax.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

    Constructors
    Constructor and Description
    `ViewHandlerWrapper()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addProtectedView(String urlPattern)` The default behavior of this method is to call `ViewHandler.addProtectedView(java.lang.String)` on the wrapped `ViewHandler` object.
    `String` | `calculateCharacterEncoding(FacesContext context)` The default behavior of this method is to call `ViewHandler.calculateCharacterEncoding(javax.faces.context.FacesContext)` on the wrapped `ViewHandler` object.
    `Locale` | `calculateLocale(FacesContext context)` The default behavior of this method is to call `ViewHandler.calculateLocale(javax.faces.context.FacesContext)` on the wrapped `ViewHandler` object.
    `String` | `calculateRenderKitId(FacesContext context)` The default behavior of this method is to call `ViewHandler.calculateRenderKitId(javax.faces.context.FacesContext)` on the wrapped `ViewHandler` object.
    `UIViewRoot` | `createView(FacesContext context, String viewId)` The default behavior of this method is to call `ViewHandler.createView(javax.faces.context.FacesContext, String)` on the wrapped `ViewHandler` object.
    `String` | `deriveLogicalViewId(FacesContext context, String input)` The default behavior of this method is to call `ViewHandler.deriveLogicalViewId(javax.faces.context.FacesContext, String)` on the wrapped `ViewHandler` object.
    `String` | `deriveViewId(FacesContext context, String input)` The default behavior of this method is to call `ViewHandler.deriveViewId(javax.faces.context.FacesContext, String)` on the wrapped `ViewHandler` object.
    `String` | `getActionURL(FacesContext context, String viewId)` The default behavior of this method is to call `ViewHandler.getActionURL(javax.faces.context.FacesContext, String)` on the wrapped `ViewHandler` object.
    `String` | `getBookmarkableURL(FacesContext context, String viewId, Map<String,List<String>> parameters, boolean includeViewParams)` The default behavior of this method is to call `ViewHandler.getBookmarkableURL(javax.faces.context.FacesContext, String, java.util.Map, boolean)` on the wrapped `ViewHandler` object.
    `Set<String>` | `getProtectedViewsUnmodifiable()` The default behavior of this method is to call `ViewHandler.getProtectedViewsUnmodifiable()` on the wrapped `ViewHandler` object.
    `String` | `getRedirectURL(FacesContext context, String viewId, Map<String,List<String>> parameters, boolean includeViewParams)` The default behavior of this method is to call `ViewHandler.getRedirectURL(javax.faces.context.FacesContext, String, java.util.Map, boolean)` on the wrapped `ViewHandler` object.
    `String` | `getResourceURL(FacesContext context, String path)` The default behavior of this method is to call `ViewHandler.getResourceURL(javax.faces.context.FacesContext, String)` on the wrapped `ViewHandler` object.
    `ViewDeclarationLanguage` | `getViewDeclarationLanguage(FacesContext context, String viewId)` The default behavior of this method is to call `ViewHandler.getViewDeclarationLanguage(javax.faces.context.FacesContext, java.lang.String)` on the wrapped `ViewHandler` object.
    `abstract ViewHandler` | `getWrapped()` A class that implements this interface uses this method to return an instance of the class being wrapped.
    `void` | `initView(FacesContext context)` The default behavior of this method is to call `ViewHandler.initView(javax.faces.context.FacesContext)` on the wrapped `ViewHandler` object.
    `boolean` | `removeProtectedView(String urlPattern)` The default behavior of this method is to call `ViewHandler.removeProtectedView(java.lang.String)` on the wrapped `ViewHandler` object.
    `void` | `renderView(FacesContext context, UIViewRoot viewToRender)` The default behavior of this method is to call `ViewHandler.renderView(javax.faces.context.FacesContext, javax.faces.component.UIViewRoot)` on the wrapped `ViewHandler` object.
    `UIViewRoot` | `restoreView(FacesContext context, String viewId)` The default behavior of this method is to call `ViewHandler.restoreView(javax.faces.context.FacesContext, String)` on the wrapped `ViewHandler` object.
    `void` | `writeState(FacesContext context)` The default behavior of this method is to call `ViewHandler.writeState(javax.faces.context.FacesContext)` on the wrapped `ViewHandler` object.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ViewHandlerWrapper

          public ViewHandlerWrapper()

  - ### Method Detail

    - #### getWrapped

          public abstract ViewHandler getWrapped()

      Description copied from interface: `FacesWrapper`

      A class that implements this interface uses this method to return an instance of the class being wrapped.

      Specified by:
        `getWrapped` in interface `FacesWrapper<ViewHandler>`
      Returns:
        the instance that we are wrapping.

    - #### calculateCharacterEncoding

          public String calculateCharacterEncoding(FacesContext context)

      The default behavior of this method is to call `ViewHandler.calculateCharacterEncoding(javax.faces.context.FacesContext)` on the wrapped `ViewHandler` object.

      Overrides:
        `calculateCharacterEncoding` in class `ViewHandler`
      Since:
        1.2
      See Also:
        `ViewHandler.calculateCharacterEncoding(javax.faces.context.FacesContext)`

    - #### calculateLocale

          public Locale calculateLocale(FacesContext context)

      The default behavior of this method is to call `ViewHandler.calculateLocale(javax.faces.context.FacesContext)` on the wrapped `ViewHandler` object.

      Specified by:
        `calculateLocale` in class `ViewHandler`
      Parameters:
        `context` - `FacesContext` for the current request
      Since:
        1.2
      See Also:
        `ViewHandler.calculateLocale(javax.faces.context.FacesContext)`

    - #### deriveViewId

          public String deriveViewId(FacesContext context,
                            String input)

      The default behavior of this method is to call `ViewHandler.deriveViewId(javax.faces.context.FacesContext, String)` on the wrapped `ViewHandler` object.

      Overrides:
        `deriveViewId` in class `ViewHandler`
      Parameters:
        `context` - the `FacesContext` for this request
        `input` - the `viewId` to derive,
      Since:
        2.0
      See Also:
        `ViewHandler.deriveViewId(javax.faces.context.FacesContext, String)`

    - #### deriveLogicalViewId

          public String deriveLogicalViewId(FacesContext context,
                                   String input)

      The default behavior of this method is to call `ViewHandler.deriveLogicalViewId(javax.faces.context.FacesContext, String)` on the wrapped `ViewHandler` object.

      Overrides:
        `deriveLogicalViewId` in class `ViewHandler`
      Parameters:
        `context` - the `FacesContext` for this request
        `input` - the `viewId` to derive,
      Since:
        2.1
      See Also:
        `ViewHandler.deriveLogicalViewId(javax.faces.context.FacesContext, String)`

    - #### calculateRenderKitId

          public String calculateRenderKitId(FacesContext context)

      The default behavior of this method is to call `ViewHandler.calculateRenderKitId(javax.faces.context.FacesContext)` on the wrapped `ViewHandler` object.

      Specified by:
        `calculateRenderKitId` in class `ViewHandler`
      Parameters:
        `context` - `FacesContext` for the current request
      Since:
        1.2
      See Also:
        `ViewHandler.calculateRenderKitId(javax.faces.context.FacesContext)`

    - #### createView

          public UIViewRoot createView(FacesContext context,
                              String viewId)

      The default behavior of this method is to call `ViewHandler.createView(javax.faces.context.FacesContext, String)` on the wrapped `ViewHandler` object.

      Specified by:
        `createView` in class `ViewHandler`
      Since:
        1.2
      See Also:
        `ViewHandler.createView(javax.faces.context.FacesContext, String)`

    - #### getActionURL

          public String getActionURL(FacesContext context,
                            String viewId)

      The default behavior of this method is to call `ViewHandler.getActionURL(javax.faces.context.FacesContext, String)` on the wrapped `ViewHandler` object.

      Specified by:
        `getActionURL` in class `ViewHandler`
      Parameters:
        `context` - `FacesContext` for this request
        `viewId` - View identifier of the desired view
      Since:
        1.2
      See Also:
        `ViewHandler.getActionURL(javax.faces.context.FacesContext, String)`

    - #### getProtectedViewsUnmodifiable

          public Set<String> getProtectedViewsUnmodifiable()

      The default behavior of this method is to call `ViewHandler.getProtectedViewsUnmodifiable()` on the wrapped `ViewHandler` object.

      Overrides:
        `getProtectedViewsUnmodifiable` in class `ViewHandler`
      Since:
        2.2
      See Also:
        `ViewHandler.getProtectedViewsUnmodifiable()`

    - #### addProtectedView

          public void addProtectedView(String urlPattern)

      The default behavior of this method is to call `ViewHandler.addProtectedView(java.lang.String)` on the wrapped `ViewHandler` object.

      Overrides:
        `addProtectedView` in class `ViewHandler`
      Parameters:
        `urlPattern` - the url-pattern to add.
      Since:
        2.2
      See Also:
        `ViewHandler.addProtectedView(java.lang.String)`

    - #### removeProtectedView

          public boolean removeProtectedView(String urlPattern)

      The default behavior of this method is to call `ViewHandler.removeProtectedView(java.lang.String)` on the wrapped `ViewHandler` object.

      Overrides:
        `removeProtectedView` in class `ViewHandler`
      Parameters:
        `urlPattern` - the url-pattern to remove.
      Since:
        2.2
      See Also:
        `ViewHandler.removeProtectedView(java.lang.String)`

    - #### 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(javax.faces.context.FacesContext, String, java.util.Map, boolean)` on the wrapped `ViewHandler` object.

      Overrides:
        `getRedirectURL` in class `ViewHandler`
      Parameters:
        `context` - The FacesContext processing this request
        `viewId` - The view identifier of the target page
        `parameters` - A mapping of parameter names to one or more values
        `includeViewParams` - A flag indicating whether view parameters should be encoded into this URL
      Since:
        2.0
      See Also:
        `ViewHandler.getRedirectURL(javax.faces.context.FacesContext, String, java.util.Map, boolean)`

    - #### 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(javax.faces.context.FacesContext, String, java.util.Map, boolean)` on the wrapped `ViewHandler` object.

      Overrides:
        `getBookmarkableURL` in class `ViewHandler`
      Parameters:
        `context` - The FacesContext processing this request
        `viewId` - The view identifier of the target page
        `parameters` - A mapping of parameter names to one or more values
        `includeViewParams` - A flag indicating whether view parameters should be encoded into this URL
      Since:
        2.0
      See Also:
        `ViewHandler.getBookmarkableURL(javax.faces.context.FacesContext, String, java.util.Map, boolean)`

    - #### getResourceURL

          public String getResourceURL(FacesContext context,
                              String path)

      The default behavior of this method is to call `ViewHandler.getResourceURL(javax.faces.context.FacesContext, String)` on the wrapped `ViewHandler` object.

      Specified by:
        `getResourceURL` in class `ViewHandler`
      Parameters:
        `context` - `FacesContext` for the current request
        `path` - Resource path to convert to a URL
      Since:
        1.2
      See Also:
        `ViewHandler.getResourceURL(javax.faces.context.FacesContext, String)`

    - #### getViewDeclarationLanguage

          public ViewDeclarationLanguage getViewDeclarationLanguage(FacesContext context,
                                                           String viewId)

      The default behavior of this method is to call `ViewHandler.getViewDeclarationLanguage(javax.faces.context.FacesContext, java.lang.String)` on the wrapped `ViewHandler` object.

      Overrides:
        `getViewDeclarationLanguage` in class `ViewHandler`
      Parameters:
        `context` - the `FacesContext` for this request.
        `viewId` - the logical view id, as returned from `ViewHandler.deriveLogicalViewId(javax.faces.context.FacesContext, java.lang.String)` for which the `ViewDeclarationLanguage` should be returned.
      Since:
        2.0

    - #### initView

          public void initView(FacesContext context)
                        throws FacesException

      The default behavior of this method is to call `ViewHandler.initView(javax.faces.context.FacesContext)` on the wrapped `ViewHandler` object.

      Overrides:
        `initView` in class `ViewHandler`
      Throws:
        `FacesException` - if a problem occurs setting the encoding, such as the `UnsupportedEncodingException` thrown by the underlying Servlet or Portlet technology when the encoding is not supported.
      Since:
        1.2
      See Also:
        `ViewHandler.initView(javax.faces.context.FacesContext)`

    - #### renderView

          public void renderView(FacesContext context,
                        UIViewRoot viewToRender)
                          throws IOException,
                                 FacesException

      The default behavior of this method is to call `ViewHandler.renderView(javax.faces.context.FacesContext, javax.faces.component.UIViewRoot)` on the wrapped `ViewHandler` object.

      Specified by:
        `renderView` in class `ViewHandler`
      Parameters:
        `context` - `FacesContext` for the current request
        `viewToRender` - the view to render
      Throws:
        `IOException` - if an input/output error occurs
        `FacesException` - if a servlet error occurs
      Since:
        1.2
      See Also:
        `ViewHandler.renderView(javax.faces.context.FacesContext, javax.faces.component.UIViewRoot)`

    - #### restoreView

          public UIViewRoot restoreView(FacesContext context,
                               String viewId)

      The default behavior of this method is to call `ViewHandler.restoreView(javax.faces.context.FacesContext, String)` on the wrapped `ViewHandler` object.

      Specified by:
        `restoreView` in class `ViewHandler`
      Parameters:
        `context` - `FacesContext` for the current request
        `viewId` - the view identifier for the current request
      Since:
        1.2
      See Also:
        `ViewHandler.restoreView(javax.faces.context.FacesContext, String)`

    - #### writeState

          public void writeState(FacesContext context)
                          throws IOException

      The default behavior of this method is to call `ViewHandler.writeState(javax.faces.context.FacesContext)` on the wrapped `ViewHandler` object.

      Specified by:
        `writeState` in class `ViewHandler`
      Parameters:
        `context` - `FacesContext` for the current request
      Throws:
        `IOException` - if an input/output error occurs
      Since:
        1.2
      See Also:
        `ViewHandler.writeState(javax.faces.context.FacesContext)`

Copyright © 1996-2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.