javax.faces.application
Class ViewHandlerWrapper

java.lang.Object
  extended by javax.faces.application.ViewHandler
      extended by javax.faces.application.ViewHandlerWrapper

public abstract class ViewHandlerWrapper
extends 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_SUFFIX, DEFAULT_SUFFIX_PARAM_NAME
 
Constructor Summary
ViewHandlerWrapper()
           
 
Method Summary
 java.lang.String calculateCharacterEncoding(FacesContext context)
          The default behavior of this method is to call ViewHandler.calculateCharacterEncoding(javax.faces.context.FacesContext) on the wrapped ViewHandler object.
 java.util.Locale calculateLocale(FacesContext context)
          The default behavior of this method is to call ViewHandler.calculateLocale(javax.faces.context.FacesContext) on the wrapped ViewHandler object.
 java.lang.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, java.lang.String viewId)
          The default behavior of this method is to call ViewHandler.createView(javax.faces.context.FacesContext, String) on the wrapped ViewHandler object.
 java.lang.String getActionURL(FacesContext context, java.lang.String viewId)
          The default behavior of this method is to call ViewHandler.getActionURL(javax.faces.context.FacesContext, String) on the wrapped ViewHandler object.
 java.lang.String getResourceURL(FacesContext context, java.lang.String path)
          The default behavior of this method is to call ViewHandler.getResourceURL(javax.faces.context.FacesContext, String) on the wrapped ViewHandler object.
protected abstract  ViewHandler getWrapped()
           
 void initView(FacesContext context)
          The default behavior of this method is to call ViewHandler.initView(javax.faces.context.FacesContext) 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, java.lang.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

protected abstract ViewHandler getWrapped()
Returns:
the instance that we are wrapping.

calculateCharacterEncoding

public java.lang.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 java.util.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)

calculateRenderKitId

public java.lang.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,
                             java.lang.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 java.lang.String getActionURL(FacesContext context,
                                     java.lang.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)

getResourceURL

public java.lang.String getResourceURL(FacesContext context,
                                       java.lang.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)

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 java.io.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:
java.io.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,
                              java.lang.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 java.io.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:
java.io.IOException - if an input/output error occurs
Since:
1.2
See Also:
ViewHandler.writeState(javax.faces.context.FacesContext)


Copyright 2002-2006 Sun Microsystems, Inc. All Rights Reserved.