public class DefaultResourceHandler extends ResourceHandlerWrapper
ResourceHandler
implementation, delegating both createResource(String)
and
createResource(String, String)
to createResource(String, String, String)
. Implementors should
only need to override createResource(String, String, String)
. Additionally, the constructor checks if the
wrapped resource handler has the createResource(String, String, String)
properly implemented, otherwise
fall back to either createResource(String, String)
or createResource(String)
on the wrapped
resource handler.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 and Description |
---|
DefaultResourceHandler(ResourceHandler wrapped)
Creates a new instance of this unmapped resource handler which wraps the given resource handler.
|
Modifier and Type | Method and Description |
---|---|
Resource |
createResource(String resourceName)
Delegate to
createResource(String, String, String) with null as library name and content
type. |
Resource |
createResource(String resourceName,
String libraryName)
Delegate to
createResource(String, String, String) with null as content type. |
Resource |
createResource(String resourceName,
String libraryName,
String contentType)
Delegate to the right
createResource() method of the wrapped resource handler. |
ResourceHandler |
getWrapped() |
createResourceFromId, createViewResource, getRendererTypeForResourceName, handleResourceRequest, isResourceRequest, isResourceURL, libraryExists
public DefaultResourceHandler(ResourceHandler wrapped)
createResource
method is being declared on the wrapped resource handler.wrapped
- The resource handler to be wrapped.public Resource createResource(String resourceName)
createResource(String, String, String)
with null
as library name and content
type.createResource
in class ResourceHandlerWrapper
public Resource createResource(String resourceName, String libraryName)
createResource(String, String, String)
with null
as content type.createResource
in class ResourceHandlerWrapper
public Resource createResource(String resourceName, String libraryName, String contentType)
createResource()
method of the wrapped resource handler. Some resource handler
implementations namely doesn't implement all the three createResource()
methods.createResource
in class ResourceHandlerWrapper
public ResourceHandler getWrapped()
getWrapped
in interface FacesWrapper<ResourceHandler>
getWrapped
in class ResourceHandlerWrapper
Copyright © 2012–2014 OmniFaces. All rights reserved.