- java.lang.Object
-
- javax.faces.application.ViewResource
-
- javax.faces.application.Resource
-
- javax.faces.application.ResourceWrapper
-
- All Implemented Interfaces:
- FacesWrapper<Resource>
public abstract class ResourceWrapper extends Resource implements FacesWrapper<Resource>
Provides a simple implementation of
Resource
that can be subclassed by developers wishing to provide specialized behavior to an existingResource
instance. The default implementation of all methods is to call through to the wrappedResource
.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.Resource
COMPONENT_RESOURCE_KEY
-
-
Constructor Summary
Constructors Constructor and Description ResourceWrapper()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description String
getContentType()
The default behavior of this method is to call
Resource.getContentType()
on the wrappedResourceHandler
object.InputStream
getInputStream()
The default behavior of this method is to call
Resource.getInputStream()
on the wrappedResourceHandler
object.String
getLibraryName()
The default behavior of this method is to call
Resource.getLibraryName()
on the wrappedResourceHandler
object.String
getRequestPath()
The default behavior of this method is to call
Resource.getRequestPath()
on the wrappedResourceHandler
object.String
getResourceName()
The default behavior of this method is to call
Resource.getResourceName()
on the wrappedResourceHandler
object.Map<String,String>
getResponseHeaders()
The default behavior of this method is to call
Resource.getResponseHeaders()
on the wrappedResourceHandler
object.URL
getURL()
The default behavior of this method is to call
Resource.getURL()
on the wrappedResourceHandler
object.abstract Resource
getWrapped()
A class that implements this interface uses this method to return an instance of the class being wrapped.
void
setContentType(String contentType)
The default behavior of this method is to call
Resource.setContentType(String)
on the wrappedResourceHandler
object.void
setLibraryName(String libraryName)
The default behavior of this method is to call
Resource.setLibraryName(String)
on the wrappedResourceHandler
object.void
setResourceName(String resourceName)
The default behavior of this method is to call
Resource.setResourceName(String)
on the wrappedResourceHandler
object.boolean
userAgentNeedsUpdate(FacesContext context)
The default behavior of this method is to call
Resource.userAgentNeedsUpdate(javax.faces.context.FacesContext)
on the wrappedResourceHandler
object.-
Methods inherited from class javax.faces.application.Resource
toString
-
-
-
-
Method Detail
-
getWrapped
public abstract Resource 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<Resource>
- Returns:
- the instance that we are wrapping.
-
getInputStream
public InputStream getInputStream() throws IOException
The default behavior of this method is to call
Resource.getInputStream()
on the wrappedResourceHandler
object.- Specified by:
getInputStream
in classResource
- Returns:
- an
InputStream
containing the bytes of the resource.Any EL expressions present in the resource must be evaluated before serving the bytes of the resource. Note that due to browser and server caching, EL expressions in a resource file will generally only be evaluated once, when the resource is first served up. Therefore, using EL expressions that refer to per-request data is not advisable since this data can become stale.
- Throws:
IOException
- if the current request is not a resource request.
-
getURL
public URL getURL()
The default behavior of this method is to call
Resource.getURL()
on the wrappedResourceHandler
object.
-
getResponseHeaders
public Map<String,String> getResponseHeaders()
The default behavior of this method is to call
Resource.getResponseHeaders()
on the wrappedResourceHandler
object.- Specified by:
getResponseHeaders
in classResource
- Returns:
- a mutable
Map<String, String>
of headers that will be included with the response.
-
getRequestPath
public String getRequestPath()
The default behavior of this method is to call
Resource.getRequestPath()
on the wrappedResourceHandler
object.- Specified by:
getRequestPath
in classResource
- Returns:
- the path to this resource, intended to be included in the encoded view that is sent to the browser when sending a faces response.
-
userAgentNeedsUpdate
public boolean userAgentNeedsUpdate(FacesContext context)
The default behavior of this method is to call
Resource.userAgentNeedsUpdate(javax.faces.context.FacesContext)
on the wrappedResourceHandler
object.- Specified by:
userAgentNeedsUpdate
in classResource
- Returns:
true
orfalse
depending on whether or not the user-agent needs an update of this resource.
-
getContentType
public String getContentType()
The default behavior of this method is to call
Resource.getContentType()
on the wrappedResourceHandler
object.- Overrides:
getContentType
in classResource
- Returns:
- the MIME content-type for this resource.
-
setContentType
public void setContentType(String contentType)
The default behavior of this method is to call
Resource.setContentType(String)
on the wrappedResourceHandler
object.- Overrides:
setContentType
in classResource
- Parameters:
contentType
- the MIME content-type for this resource. The default implementation must acceptnull
as a parameter.
-
getLibraryName
public String getLibraryName()
The default behavior of this method is to call
Resource.getLibraryName()
on the wrappedResourceHandler
object.- Overrides:
getLibraryName
in classResource
- Returns:
- Return the libraryName for this resource. May be
null
.
-
setLibraryName
public void setLibraryName(String libraryName)
The default behavior of this method is to call
Resource.setLibraryName(String)
on the wrappedResourceHandler
object.- Overrides:
setLibraryName
in classResource
- Parameters:
libraryName
- the libraryName for this resource. The default implementation must acceptnull
for the libraryName.
-
getResourceName
public String getResourceName()
The default behavior of this method is to call
Resource.getResourceName()
on the wrappedResourceHandler
object.- Overrides:
getResourceName
in classResource
- Returns:
- Return the resourceName for this resource. Will never be null.
-
setResourceName
public void setResourceName(String resourceName)
The default behavior of this method is to call
Resource.setResourceName(String)
on the wrappedResourceHandler
object.- Overrides:
setResourceName
in classResource
- Parameters:
resourceName
- a non-null String.
-
-
Deutsche Übersetzung
Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.
Vielen Dank im Voraus.
Dokument erstellt 11/06/2005, zuletzt geändert 18/08/2025
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/java-api-javaee-rf-javax/faces/application/ResourceWrapper.html
Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.
Referenzen
Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor dieser Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.