Class ResourceHandlerWrapper
- java.lang.Object
-
- javax.faces.application.ResourceHandler
-
- javax.faces.application.ResourceHandlerWrapper
-
- All Implemented Interfaces:
FacesWrapper<ResourceHandler>
public abstract class ResourceHandlerWrapper extends ResourceHandler implements FacesWrapper<ResourceHandler>
Provides a simple implementation of
ResourceHandlerthat can be subclassed by developers wishing to provide specialized behavior to an existingResourceHandlerinstance. The default implementation of all methods is to call through to the wrappedResourceHandler.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
Constructors Constructor Description ResourceHandlerWrapper()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ResourcecreateResource(java.lang.String resourceName)The default behavior of this method is to callResourceHandler.createResource(String)on the wrappedResourceHandlerobject.ResourcecreateResource(java.lang.String resourceName, java.lang.String libraryName)The default behavior of this method is to callResourceHandler.createResource(String, String)on the wrappedResourceHandlerobject.ResourcecreateResource(java.lang.String resourceName, java.lang.String libraryName, java.lang.String contentType)The default behavior of this method is to callResourceHandler.createResource(String, String, String)on the wrappedResourceHandlerobject.ResourcecreateResourceFromId(java.lang.String resourceId)The default behavior of this method is to callResourceHandler.createResourceFromId(String)on the wrappedResourceHandlerobject.ViewResourcecreateViewResource(FacesContext context, java.lang.String resourceName)The default behavior of this method is to callResourceHandler.createViewResource(javax.faces.context.FacesContext, java.lang.String)on the wrappedResourceHandlerobject.java.lang.StringgetRendererTypeForResourceName(java.lang.String resourceName)The default behavior of this method is to callResourceHandler.getRendererTypeForResourceName(String)on the wrappedResourceHandlerobject.abstract ResourceHandlergetWrapped()A class that implements this interface uses this method to return an instance of the class being wrapped.voidhandleResourceRequest(FacesContext context)The default behavior of this method is to callResourceHandler.handleResourceRequest(javax.faces.context.FacesContext)on the wrappedResourceHandlerobject.booleanisResourceRequest(FacesContext context)The default behavior of this method is to callResourceHandler.isResourceRequest(javax.faces.context.FacesContext)on the wrappedResourceHandlerobject.booleanisResourceURL(java.lang.String url)The default behavior of this method is to callResourceHandler.isResourceURL(java.lang.String)on the wrappedResourceHandlerobject.booleanlibraryExists(java.lang.String libraryName)The default behavior of this method is to callResourceHandler.libraryExists(String)on the wrappedResourceHandlerobject.
-
-
-
Method Detail
-
getWrapped
public abstract ResourceHandler getWrapped()
Description copied from interface:FacesWrapperA class that implements this interface uses this method to return an instance of the class being wrapped.
- Specified by:
getWrappedin interfaceFacesWrapper<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 wrappedResourceHandlerobject.- Specified by:
createResourcein classResourceHandler- Parameters:
resourceName- the name of the resource.- Returns:
- a newly created
Resourceinstance, suitable for use in encoding or decoding the named resource.
-
createResourceFromId
public Resource createResourceFromId(java.lang.String resourceId)
The default behavior of this method is to call
ResourceHandler.createResourceFromId(String)on the wrappedResourceHandlerobject.- Overrides:
createResourceFromIdin classResourceHandler- Parameters:
resourceId- the resource identifier of the resource.- Returns:
- a newly created
Resourceinstance, suitable for use in encoding or decoding the named resource. - Since:
- 2.2
-
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 wrappedResourceHandlerobject.- Specified by:
createResourcein classResourceHandler- Parameters:
resourceName- the name of the resource.libraryName- the name of the library (or contract) in which this resource resides, may benull. 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
Resourceinstance, suitable for use in encoding or decoding the named resource.
-
createViewResource
public ViewResource createViewResource(FacesContext context, java.lang.String resourceName)
The default behavior of this method is to call
ResourceHandler.createViewResource(javax.faces.context.FacesContext, java.lang.String)on the wrappedResourceHandlerobject.- Overrides:
createViewResourcein classResourceHandler- Parameters:
context- theFacesContextfor this request.resourceName- the name of the resource to be interpreted as a view by theViewDeclarationLanguage.- Returns:
- a newly created
ViewResourceinstance, suitable for use by theViewDeclarationLanguage.
-
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 wrappedResourceHandlerobject.- Specified by:
createResourcein classResourceHandler- Parameters:
resourceName- the name of the resource.libraryName- the name of the library in which this resource resides, may benull. May not include relative paths, such as "../".contentType- the mime content that thisResourceinstance will return fromResource.getContentType(). If the value isnull, The content-type of the resource is derived by passing the resourceName toExternalContext.getMimeType(java.lang.String)- Returns:
- a newly created
Resourceinstance, 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 wrappedResourceHandlerobject.- Specified by:
handleResourceRequestin classResourceHandler- Parameters:
context- theFacesContextfor 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 wrappedResourceHandlerobject.- Specified by:
isResourceRequestin classResourceHandler- Parameters:
context- theFacesContextfor this request- Returns:
trueif the current request is a resource request,falseotherwise.
-
isResourceURL
public boolean isResourceURL(java.lang.String url)
The default behavior of this method is to call
ResourceHandler.isResourceURL(java.lang.String)on the wrappedResourceHandlerobject.- Overrides:
isResourceURLin classResourceHandler- Parameters:
url- the url to inspect for the presence ofResourceHandler.RESOURCE_IDENTIFIER.
-
libraryExists
public boolean libraryExists(java.lang.String libraryName)
The default behavior of this method is to call
ResourceHandler.libraryExists(String)on the wrappedResourceHandlerobject.- Specified by:
libraryExistsin classResourceHandler
-
getRendererTypeForResourceName
public java.lang.String getRendererTypeForResourceName(java.lang.String resourceName)
The default behavior of this method is to call
ResourceHandler.getRendererTypeForResourceName(String)on the wrappedResourceHandlerobject.- Specified by:
getRendererTypeForResourceNamein classResourceHandler
-
-