Top Description Fields Constructors Methods
javax.faces.application

public abstract Class ResourceHandlerWrapper

extends ResourceHandler
implements FacesWrapper<ResourceHandler>
Class Inheritance
All Implemented Interfaces
javax.faces.FacesWrapper
Imports
java.io.IOException, java.util.stream.Stream, javax.faces.FacesWrapper, javax.faces.context.FacesContext

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 push the implementation being wrapped to the constructor and use getWrapped to access the instance being wrapped.

Since
2.0

Field Summary

Modifier and TypeField and Description
private ResourceHandler
Inherited from javax.faces.application.ResourceHandler:
JSF_SCRIPT_LIBRARY_NAMEJSF_SCRIPT_RESOURCE_NAMELOCALE_PREFIXRESOURCE_CONTRACT_XMLRESOURCE_EXCLUDES_DEFAULT_VALUERESOURCE_EXCLUDES_PARAM_NAMERESOURCE_IDENTIFIERWEBAPP_CONTRACTS_DIRECTORY_PARAM_NAMEWEBAPP_RESOURCES_DIRECTORY_PARAM_NAME

Constructor Summary

AccessConstructor and Description
public
ResourceHandlerWrapper()

Deprecated Use the other constructor taking the implementation being wrapped.
public
ResourceHandlerWrapper(ResourceHandler
The implementation being wrapped.
wrapped
)

If this resource handler has been decorated, the implementation doing the decorating should push the implementation being wrapped to this constructor.

Method Summary

Modifier and TypeMethod and Description
public Resource
createResource(String
the name of the resource.
resourceName
)

Implements abstract javax.faces.application.ResourceHandler.createResource.

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

public Resource
createResource(String
the name of the resource.
resourceName
,
String
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 "../".
libraryName
)

Implements abstract javax.faces.application.ResourceHandler.createResource.

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

public Resource
createResource(String
the name of the resource.
resourceName
,
String
the name of the library in which this resource resides, may be null. May not include relative paths, such as "../".
libraryName
,
String
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#getMimeType
contentType
)

Implements abstract javax.faces.application.ResourceHandler.createResource.

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

public Resource
createResourceFromId(String
the resource identifier of the resource.
resourceId
)

Overrides javax.faces.application.ResourceHandler.createResourceFromId.

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

public ViewResource
createViewResource(FacesContext
the FacesContext for this request.
context
,
String
the name of the resource to be interpreted as a view by the javax.faces.view.ViewDeclarationLanguage.
resourceName
)

Overrides javax.faces.application.ResourceHandler.createViewResource.

The default behavior of this method is to call ResourceHandler#createViewResource on the wrapped ResourceHandler object.

public String
getRendererTypeForResourceName(String
the resource name.
resourceName
)

Implements abstract javax.faces.application.ResourceHandler.getRendererTypeForResourceName.

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

public Stream<String>
getViewResources(FacesContext
The FacesContext for this request.
facesContext
,
String
The initial path from which to start looking for view resources
path
,
int
The absolute maximum depth of nested directories to visit counted from the root (/).
maxDepth
,
ResourceVisitOption...
The options to influence the traversal. See ResourceVisitOption for details on those.
options
)

Overrides javax.faces.application.ResourceHandler.getViewResources.

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

public Stream<String>
getViewResources(FacesContext
The FacesContext for this request.
facesContext
,
String
The initial path from which to start looking for view resources
path
,
ResourceVisitOption...
The options to influence the traversal. See ResourceVisitOption for details on those.
options
)

Overrides javax.faces.application.ResourceHandler.getViewResources.

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

public ResourceHandler
getWrapped()

Implements javax.faces.FacesWrapper.getWrapped.

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

public void
public boolean
isResourceRendered(FacesContext
The FacesContext for this request.
context
,
String
The name of the resource.
resourceName
,
String
The name of the library in which this resource resides, may be null.
libraryName
)

Overrides javax.faces.application.ResourceHandler.isResourceRendered.

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

public boolean
public boolean
isResourceURL(String
the url to inspect for the presence of ResourceHandler#RESOURCE_IDENTIFIER.
url
)

Overrides javax.faces.application.ResourceHandler.isResourceURL.

The default behavior of this method is to call ResourceHandler#isResourceURL on the wrapped ResourceHandler object.

public boolean
libraryExists(String
the library name.
libraryName
)

Implements abstract javax.faces.application.ResourceHandler.libraryExists.

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

public void
markResourceRendered(FacesContext
The FacesContext for this request.
context
,
String
The name of the resource.
resourceName
,
String
The name of the library in which the resource resides, may be null.
libraryName
)

Overrides javax.faces.application.ResourceHandler.markResourceRendered.

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

Field Detail

wrappedback to summary
private ResourceHandler wrapped

Constructor Detail

ResourceHandlerWrapperback to summary
public ResourceHandlerWrapper()

Deprecated

Use the other constructor taking the implementation being wrapped.

Annotations
@Deprecated
ResourceHandlerWrapperback to summary
public ResourceHandlerWrapper(ResourceHandler wrapped)

If this resource handler has been decorated, the implementation doing the decorating should push the implementation being wrapped to this constructor. The getWrapped() will then return the implementation being wrapped.

Parameters
wrapped:ResourceHandler

The implementation being wrapped.

Since
2.3

Method Detail

createResourceback to summary
public Resource createResource(String resourceName)

Implements abstract javax.faces.application.ResourceHandler.createResource.

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

Parameters
resourceName:String

Doc from javax.faces.application.ResourceHandler.createResource.

the name of the resource.

Returns:Resource

Doc from javax.faces.application.ResourceHandler.createResource.

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

Annotations
@Override
createResourceback to summary
public Resource createResource(String resourceName, String libraryName)

Implements abstract javax.faces.application.ResourceHandler.createResource.

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

Parameters
resourceName:String

Doc from javax.faces.application.ResourceHandler.createResource.

the name of the resource.

libraryName:String

Doc from javax.faces.application.ResourceHandler.createResource.

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:Resource

Doc from javax.faces.application.ResourceHandler.createResource.

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

Annotations
@Override
createResourceback to summary
public Resource createResource(String resourceName, String libraryName, String contentType)

Implements abstract javax.faces.application.ResourceHandler.createResource.

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

Parameters
resourceName:String

Doc from javax.faces.application.ResourceHandler.createResource.

the name of the resource.

libraryName:String

Doc from javax.faces.application.ResourceHandler.createResource.

the name of the library in which this resource resides, may be null. May not include relative paths, such as "../".

contentType:String

Doc from javax.faces.application.ResourceHandler.createResource.

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#getMimeType

Returns:Resource

Doc from javax.faces.application.ResourceHandler.createResource.

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

Annotations
@Override
createResourceFromIdback to summary
public Resource createResourceFromId(String resourceId)

Overrides javax.faces.application.ResourceHandler.createResourceFromId.

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

Parameters
resourceId:String

Doc from javax.faces.application.ResourceHandler.createResourceFromId.

the resource identifier of the resource.

Returns:Resource

Doc from javax.faces.application.ResourceHandler.createResourceFromId.

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

Annotations
@Override
Since
2.2
createViewResourceback to summary
public ViewResource createViewResource(FacesContext context, String resourceName)

Overrides javax.faces.application.ResourceHandler.createViewResource.

The default behavior of this method is to call ResourceHandler#createViewResource on the wrapped ResourceHandler object.

Parameters
context:FacesContext

Doc from javax.faces.application.ResourceHandler.createViewResource.

the FacesContext for this request.

resourceName:String

Doc from javax.faces.application.ResourceHandler.createViewResource.

the name of the resource to be interpreted as a view by the javax.faces.view.ViewDeclarationLanguage.

Returns:ViewResource

Doc from javax.faces.application.ResourceHandler.createViewResource.

a newly created ViewResource instance, suitable for use by the javax.faces.view.ViewDeclarationLanguage.

Annotations
@Override
getRendererTypeForResourceNameback to summary
public String getRendererTypeForResourceName(String resourceName)

Implements abstract javax.faces.application.ResourceHandler.getRendererTypeForResourceName.

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

Parameters
resourceName:String

Doc from javax.faces.application.ResourceHandler.getRendererTypeForResourceName.

the resource name.

Returns:String

Doc from javax.faces.application.ResourceHandler.getRendererTypeForResourceName.

the renderer type.

Annotations
@Override
getViewResourcesback to summary
public Stream<String> getViewResources(FacesContext facesContext, String path, int maxDepth, ResourceVisitOption... options)

Overrides javax.faces.application.ResourceHandler.getViewResources.

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

Parameters
facesContext:FacesContext

Doc from javax.faces.application.ResourceHandler.getViewResources.

The FacesContext for this request.

path:String

Doc from javax.faces.application.ResourceHandler.getViewResources.

The initial path from which to start looking for view resources

maxDepth:int

Doc from javax.faces.application.ResourceHandler.getViewResources.

The absolute maximum depth of nested directories to visit counted from the root (/).

options:ResourceVisitOption[]

Doc from javax.faces.application.ResourceHandler.getViewResources.

The options to influence the traversal. See ResourceVisitOption for details on those.

Returns:Stream<String>

Doc from javax.faces.application.ResourceHandler.getViewResources.

the Stream of view resource names

Annotations
@Override
Since
2.3
getViewResourcesback to summary
public Stream<String> getViewResources(FacesContext facesContext, String path, ResourceVisitOption... options)

Overrides javax.faces.application.ResourceHandler.getViewResources.

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

Parameters
facesContext:FacesContext

Doc from javax.faces.application.ResourceHandler.getViewResources.

The FacesContext for this request.

path:String

Doc from javax.faces.application.ResourceHandler.getViewResources.

The initial path from which to start looking for view resources

options:ResourceVisitOption[]

Doc from javax.faces.application.ResourceHandler.getViewResources.

The options to influence the traversal. See ResourceVisitOption for details on those.

Returns:Stream<String>

Doc from javax.faces.application.ResourceHandler.getViewResources.

the Stream of view resource names

Since
2.3
getWrappedback to summary
public ResourceHandler getWrapped()

Implements javax.faces.FacesWrapper.getWrapped.

Doc from javax.faces.FacesWrapper.getWrapped.

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

Returns:ResourceHandler

the wrapped instance.

Annotations
@Override
handleResourceRequestback to summary
public void handleResourceRequest(FacesContext context) throws IOException

Implements abstract javax.faces.application.ResourceHandler.handleResourceRequest.

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

Parameters
context:FacesContext

Doc from javax.faces.application.ResourceHandler.handleResourceRequest.

the javax.faces.context.FacesContext for this request

Annotations
@Override
Exceptions
IOException:

Doc from javax.faces.application.ResourceHandler.handleResourceRequest.

when an I/O error occurs.

isResourceRenderedback to summary
public boolean isResourceRendered(FacesContext context, String resourceName, String libraryName)

Overrides javax.faces.application.ResourceHandler.isResourceRendered.

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

Parameters
context:FacesContext

Doc from javax.faces.application.ResourceHandler.isResourceRendered.

The FacesContext for this request.

resourceName:String

Doc from javax.faces.application.ResourceHandler.isResourceRendered.

The name of the resource.

libraryName:String

Doc from javax.faces.application.ResourceHandler.isResourceRendered.

The name of the library in which this resource resides, may be null.

Returns:boolean

Doc from javax.faces.application.ResourceHandler.isResourceRendered.

Whether the resource as identified by given resource and library name has been rendered.

Annotations
@Override
Since
2.3
isResourceRequestback to summary
public boolean isResourceRequest(FacesContext context)

Implements abstract javax.faces.application.ResourceHandler.isResourceRequest.

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

Parameters
context:FacesContext

Doc from javax.faces.application.ResourceHandler.isResourceRequest.

the javax.faces.context.FacesContext for this request

Returns:boolean

Doc from javax.faces.application.ResourceHandler.isResourceRequest.

true if the current request is a resource request, false otherwise.

Annotations
@Override
isResourceURLback to summary
public boolean isResourceURL(String url)

Overrides javax.faces.application.ResourceHandler.isResourceURL.

The default behavior of this method is to call ResourceHandler#isResourceURL on the wrapped ResourceHandler object.

Parameters
url:String

Doc from javax.faces.application.ResourceHandler.isResourceURL.

the url to inspect for the presence of ResourceHandler#RESOURCE_IDENTIFIER.

Returns:boolean

Doc from javax.faces.application.ResourceHandler.isResourceURL.

true if this is a resource URL, false otherwise.

Annotations
@Override
libraryExistsback to summary
public boolean libraryExists(String libraryName)

Implements abstract javax.faces.application.ResourceHandler.libraryExists.

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

Parameters
libraryName:String

Doc from javax.faces.application.ResourceHandler.libraryExists.

the library name.

Returns:boolean

Doc from javax.faces.application.ResourceHandler.libraryExists.

true if the library exists, false otherwise.

Annotations
@Override
markResourceRenderedback to summary
public void markResourceRendered(FacesContext context, String resourceName, String libraryName)

Overrides javax.faces.application.ResourceHandler.markResourceRendered.

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

Parameters
context:FacesContext

Doc from javax.faces.application.ResourceHandler.markResourceRendered.

The FacesContext for this request.

resourceName:String

Doc from javax.faces.application.ResourceHandler.markResourceRendered.

The name of the resource.

libraryName:String

Doc from javax.faces.application.ResourceHandler.markResourceRendered.

The name of the library in which the resource resides, may be null.

Annotations
@Override
Since
2.3