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.
LOCALE_PREFIX, RESOURCE_EXCLUDES_DEFAULT_VALUE, RESOURCE_EXCLUDES_PARAM_NAME, RESOURCE_IDENTIFIER| Constructor and Description |
|---|
ResourceHandlerWrapper() |
| Modifier and Type | Method and Description |
|---|---|
Resource |
createResource(String resourceName)
The default behavior of this method
is to call |
Resource |
createResource(String resourceName,
String libraryName)
The default behavior of this method
is to call |
Resource |
createResource(String resourceName,
String libraryName,
String contentType)
The default behavior of this method
is to call |
String |
getRendererTypeForResourceName(String resourceName)
The default behavior of this method
is to call |
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 |
boolean |
isResourceRequest(FacesContext context)
The default behavior of this method
is to call |
boolean |
libraryExists(String libraryName)
The default behavior of this method
is to call |
public abstract ResourceHandler getWrapped()
FacesWrapperA class that implements this interface uses this method to return an instance of the class being wrapped.
getWrapped in interface FacesWrapper<ResourceHandler>public Resource createResource(String resourceName)
The default behavior of this method
is to call ResourceHandler.createResource(String) on the
wrapped ResourceHandler object.
createResource in class ResourceHandlerresourceName - the name of the resource.Resource instance, suitable
for use in encoding or decoding the named resource.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.
createResource in class ResourceHandlerresourceName - 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 "../".Resource instance, suitable
for use in encoding or decoding the named resource.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.
createResource in class ResourceHandlerresourceName - 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 javax.faces.context.ExternalContext#getMimeTypeResource instance, suitable
for use in encoding or decoding the named resource.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.
handleResourceRequest in class ResourceHandlercontext - the FacesContext for this
requestIOExceptionpublic boolean isResourceRequest(FacesContext context)
The default behavior of this method
is to call ResourceHandler.isResourceRequest(javax.faces.context.FacesContext) on the
wrapped ResourceHandler object.
isResourceRequest in class ResourceHandlercontext - the FacesContext for this
requesttrue if the current request is a resource
request, false otherwise.public boolean libraryExists(String libraryName)
The default behavior of this method
is to call ResourceHandler.libraryExists(String) on the
wrapped ResourceHandler object.
libraryExists in class ResourceHandlerpublic String getRendererTypeForResourceName(String resourceName)
The default behavior of this method
is to call ResourceHandler.getRendererTypeForResourceName(String) on the
wrapped ResourceHandler object.
getRendererTypeForResourceName in class ResourceHandlerCopyright © 2012 JBoss by Red Hat. All Rights Reserved.