- 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
ResourceHandler
that can be subclassed by developers wishing to provide specialized behavior to an existingResourceHandler
instance. 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 and Description ResourceHandlerWrapper()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description Resource
createResource(String resourceName)
The default behavior of this method is to call
ResourceHandler.createResource(String)
on the wrappedResourceHandler
object.Resource
createResource(String resourceName, String libraryName)
The default behavior of this method is to call
ResourceHandler.createResource(String, String)
on the wrappedResourceHandler
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 wrappedResourceHandler
object.Resource
createResourceFromId(String resourceId)
The default behavior of this method is to call
ResourceHandler.createResourceFromId(String)
on the wrappedResourceHandler
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 wrappedResourceHandler
object.String
getRendererTypeForResourceName(String resourceName)
The default behavior of this method is to call
ResourceHandler.getRendererTypeForResourceName(String)
on the wrappedResourceHandler
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 wrappedResourceHandler
object.boolean
isResourceRequest(FacesContext context)
The default behavior of this method is to call
ResourceHandler.isResourceRequest(javax.faces.context.FacesContext)
on the wrappedResourceHandler
object.boolean
isResourceURL(String url)
The default behavior of this method is to call
ResourceHandler.isResourceURL(java.lang.String)
on the wrappedResourceHandler
object.boolean
libraryExists(String libraryName)
The default behavior of this method is to call
ResourceHandler.libraryExists(String)
on the wrappedResourceHandler
object.
-
-
-
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 interfaceFacesWrapper<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 wrappedResourceHandler
object.- Specified by:
createResource
in classResourceHandler
- 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 wrappedResourceHandler
object.- Overrides:
createResourceFromId
in classResourceHandler
- 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 wrappedResourceHandler
object.- Specified by:
createResource
in 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
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 wrappedResourceHandler
object.- Overrides:
createViewResource
in classResourceHandler
- Parameters:
context
- theFacesContext
for this request.resourceName
- the name of the resource to be interpreted as a view by theViewDeclarationLanguage
.- Returns:
- a newly created
ViewResource
instance, suitable for use by theViewDeclarationLanguage
.
-
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 wrappedResourceHandler
object.- Specified by:
createResource
in 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 thisResource
instance 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
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 wrappedResourceHandler
object.- Specified by:
handleResourceRequest
in classResourceHandler
- Parameters:
context
- theFacesContext
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 wrappedResourceHandler
object.- Specified by:
isResourceRequest
in classResourceHandler
- Parameters:
context
- theFacesContext
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 wrappedResourceHandler
object.- Overrides:
isResourceURL
in classResourceHandler
- Parameters:
url
- the url to inspect for the presence ofResourceHandler.RESOURCE_IDENTIFIER
.
-
libraryExists
public boolean libraryExists(String libraryName)
The default behavior of this method is to call
ResourceHandler.libraryExists(String)
on the wrappedResourceHandler
object.- Specified by:
libraryExists
in classResourceHandler
-
getRendererTypeForResourceName
public String getRendererTypeForResourceName(String resourceName)
The default behavior of this method is to call
ResourceHandler.getRendererTypeForResourceName(String)
on the wrappedResourceHandler
object.- Specified by:
getRendererTypeForResourceName
in classResourceHandler
-
-
Nederlandse vertaling
U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.
Bij voorbaat dank.
Document heeft de 11/06/2005 gemaakt, de laatste keer de 18/08/2025 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/java-api-javaee-rf-javax/faces/application/ResourceHandlerWrapper.html
De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.
Referenties
Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur van deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.