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_CONTRACT_XML, RESOURCE_EXCLUDES_DEFAULT_VALUE, RESOURCE_EXCLUDES_PARAM_NAME, RESOURCE_IDENTIFIER, WEBAPP_CONTRACTS_DIRECTORY_PARAM_NAME, WEBAPP_RESOURCES_DIRECTORY_PARAM_NAME
 
Constructor Summary
ResourceHandlerWrapper()
           
 
Method Summary
 Resource createResource(String resourceName)
          

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

 Resource createResource(String resourceName, String libraryName)
          

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

 Resource createResource(String resourceName, String libraryName, String contentType)
          

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

 Resource createResourceFromId(String resourceId)
          

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

 ViewResource createViewResource(FacesContext context, String resourceName)
          

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

 String getRendererTypeForResourceName(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 isResourceURL(String url)
          

The default behavior of this method is to call ResourceHandler.isResourceURL(java.lang.String) on the wrapped ResourceHandler object.

 boolean libraryExists(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(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.

createResourceFromId

public Resource createResourceFromId(String resourceId)

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

Overrides:
createResourceFromId in class ResourceHandler
Parameters:
resourceId - the resource identifier of the resource.
Returns:
a newly created Resource instance, suitable for use in encoding or decoding the named resource.
Since:
2.2

createResource

public Resource createResource(String resourceName,
                               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 (or contract) in which this resource resides, may be null. If there is a conflict between the name of a resource library and a resource library contract, the resource library takes precedence. May not include relative paths, such as "../".
Returns:
a newly created Resource instance, suitable for use in encoding or decoding the named resource.

createViewResource

public ViewResource createViewResource(FacesContext context,
                                       String resourceName)

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

Overrides:
createViewResource in class ResourceHandler
Parameters:
context - the FacesContext for this request.
resourceName - the name of the resource to be interpreted as a view by the ViewDeclarationLanguage.
Returns:
a newly created ViewResource instance, suitable for use by the ViewDeclarationLanguage.

createResource

public Resource createResource(String resourceName,
                               String libraryName,
                               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 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:
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.

isResourceURL

public boolean isResourceURL(String url)

The default behavior of this method is to call ResourceHandler.isResourceURL(java.lang.String) on the wrapped ResourceHandler object.

Overrides:
isResourceURL in class ResourceHandler
Parameters:
url - the url to inspect for the presence of ResourceHandler.RESOURCE_IDENTIFIER.

libraryExists

public boolean libraryExists(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 String getRendererTypeForResourceName(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


Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms