javax.faces.application
Class ResourceHandlerWrapper

java.lang.Object
  extended by javax.faces.application.ResourceHandler
      extended by javax.faces.application.ResourceHandlerWrapper
All Implemented Interfaces:
FacesWrapper<ResourceHandler>

public abstract class ResourceHandlerWrapper
extends ResourceHandler
implements FacesWrapper<ResourceHandler>

Provides a simple implementation of ResourceHandler that can be subclassed by developers wishing to provide specialized behavior to an existing ResourceHandler instance. The default implementation of all methods is to call through to the wrapped ResourceHandler.

Usage: extend this class and override getWrapped() to return the instance we are wrapping.

Since:
2.0

Field Summary
 
Fields inherited from class javax.faces.application.ResourceHandler
LOCALE_PREFIX, RESOURCE_EXCLUDES_DEFAULT_VALUE, RESOURCE_EXCLUDES_PARAM_NAME, RESOURCE_IDENTIFIER
 
Constructor Summary
ResourceHandlerWrapper()
           
 
Method Summary
 Resource createResource(java.lang.String resourceName)
          

The default behavior of this method is to call ResourceHandler#createResource(String) on the wrapped ResourceHandler object.

 Resource createResource(java.lang.String resourceName, java.lang.String libraryName)
          

The default behavior of this method is to call ResourceHandler#createResource(String, String) on the wrapped ResourceHandler object.

 Resource createResource(java.lang.String resourceName, java.lang.String libraryName, java.lang.String contentType)
          

The default behavior of this method is to call ResourceHandler#createResource(String, String, String) on the wrapped ResourceHandler object.

 java.lang.String getRendererTypeForResourceName(java.lang.String resourceName)
          

The default behavior of this method is to call ResourceHandler#getRendererTypeForResourceName(String) on the wrapped ResourceHandler object.

abstract  ResourceHandler getWrapped()
          

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

 void handleResourceRequest(FacesContext context)
          

The default behavior of this method is to call ResourceHandler#handleResourceRequest(javax.faces.context.FacesContext) on the wrapped ResourceHandler object.

 boolean isResourceRequest(FacesContext context)
          

The default behavior of this method is to call ResourceHandler#isResourceRequest(javax.faces.context.FacesContext) on the wrapped ResourceHandler object.

 boolean libraryExists(java.lang.String libraryName)
          

The default behavior of this method is to call ResourceHandler#libraryExists(String) on the wrapped ResourceHandler object.

 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceHandlerWrapper

public ResourceHandlerWrapper()
Method Detail

getWrapped

public abstract ResourceHandler 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<ResourceHandler>
Returns:
the instance that we are wrapping.

createResource

public Resource createResource(java.lang.String resourceName)

The default behavior of this method is to call ResourceHandler#createResource(String) on the wrapped ResourceHandler object.

Specified by:
createResource in class ResourceHandler
Parameters:
resourceName - the name of the resource.
Returns:
a newly created Resource instance, suitable for use in encoding or decoding the named resource.

createResource

public Resource createResource(java.lang.String resourceName,
                               java.lang.String libraryName)

The default behavior of this method is to call ResourceHandler#createResource(String, String) on the wrapped ResourceHandler object.

Specified by:
createResource in class ResourceHandler
Parameters:
resourceName - the name of the resource.
libraryName - the name of the library in which this resource resides, may be null. May not include relative paths, such as "../".
Returns:
a newly created Resource instance, suitable for use in encoding or decoding the named resource.

createResource

public Resource createResource(java.lang.String resourceName,
                               java.lang.String libraryName,
                               java.lang.String contentType)

The default behavior of this method is to call ResourceHandler#createResource(String, String, String) on the wrapped ResourceHandler object.

Specified by:
createResource in class ResourceHandler
Parameters:
resourceName - the name of the resource.
libraryName - the name of the library in which this resource resides, may be null. May not include relative paths, such as "../".
contentType - the mime content that this Resource instance will return from Resource#getContentType. If the value is null, The content-type of the resource is derived by passing the resourceName to ExternalContext.getMimeType(java.lang.String)

Returns:
a newly created Resource instance, suitable for use in encoding or decoding the named resource.

handleResourceRequest

public void handleResourceRequest(FacesContext context)
                           throws java.io.IOException

The default behavior of this method is to call ResourceHandler#handleResourceRequest(javax.faces.context.FacesContext) on the wrapped ResourceHandler object.

Specified by:
handleResourceRequest in class ResourceHandler
Parameters:
context - the FacesContext for this request
Throws:
java.io.IOException

isResourceRequest

public boolean isResourceRequest(FacesContext context)

The default behavior of this method is to call ResourceHandler#isResourceRequest(javax.faces.context.FacesContext) on the wrapped ResourceHandler object.

Specified by:
isResourceRequest in class ResourceHandler
Parameters:
context - the FacesContext for this request
Returns:
true if the current request is a resource request, false otherwise.

libraryExists

public boolean libraryExists(java.lang.String libraryName)

The default behavior of this method is to call ResourceHandler#libraryExists(String) on the wrapped ResourceHandler object.

Specified by:
libraryExists in class ResourceHandler

getRendererTypeForResourceName

public java.lang.String getRendererTypeForResourceName(java.lang.String resourceName)

The default behavior of this method is to call ResourceHandler#getRendererTypeForResourceName(String) on the wrapped ResourceHandler object.

Specified by:
getRendererTypeForResourceName in class ResourceHandler


Submit a bug or feature

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

Generated on 10-February-2011 12:41

Scripting on this page tracks web page traffic, but does not change the content in any way.