- java.lang.Object
-
- javax.faces.view.facelets.FaceletCache<V>
-
public abstract class FaceletCache<V> extends Object
This API defines the facility by which the Facelets
ViewDeclarationLanguage
creates and caches instances of Facelets.The cache handles two different kinds of Facelets: View Facelets and View Metadata Facelets. The former is the usual Facelet that provides for the construction of a
UIComponent
tree. This kind of Facelet is accessed via thegetFacelet(java.net.URL)
andisFaceletCached(java.net.URL)
methods. The latter is a special kind of Facelet that corresponds toViewDeclarationLanguage.getViewMetadata(javax.faces.context.FacesContext, java.lang.String)
. This kind of Facelet is accessed via thegetViewMetadataFacelet(java.net.URL)
andisViewMetadataFaceletCached(java.net.URL)
methods.- Since:
- 2.1
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static interface
FaceletCache.MemberFactory<V>
Factory interface for creating Facelet or View Metadata Facelet instances.
-
Constructor Summary
Constructors Constructor and Description FaceletCache()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description abstract V
getFacelet(URL url)
Returns a cached Facelet instance.
protected FaceletCache.MemberFactory<V>
getMemberFactory()
Returns the
FaceletCache.MemberFactory
passed tosetMemberFactories(javax.faces.view.facelets.FaceletCache.MemberFactory<V>, javax.faces.view.facelets.FaceletCache.MemberFactory<V>)
for the purpose of creating Facelet instance.protected FaceletCache.MemberFactory<V>
getMetadataMemberFactory()
Returns the
FaceletCache.MemberFactory
passed tosetMemberFactories(javax.faces.view.facelets.FaceletCache.MemberFactory<V>, javax.faces.view.facelets.FaceletCache.MemberFactory<V>)
for the purpose of creating View Metadata Facelet instance.abstract V
getViewMetadataFacelet(URL url)
Returns a cached View Metadata Facelet instance.
abstract boolean
isFaceletCached(URL url)
Determines whether a cached Facelet instance exists for this URL.
abstract boolean
isViewMetadataFaceletCached(URL url)
Determines whether a cached View Metadata Facelet instance exists for this URL.
protected void
setMemberFactories(FaceletCache.MemberFactory<V> faceletFactory, FaceletCache.MemberFactory<V> viewMetadataFaceletFactory)
This must be called by the runtime at startup time, before any requests are serviced, and allows for the
FaceletCache
implementation to provide theFaceletCache.MemberFactory
instances that will be used to create instances of Facelets and View Metadata Facelets.
-
-
-
Method Detail
-
getFacelet
public abstract V getFacelet(URL url) throws IOException
Returns a cached Facelet instance. If no instance is available, it will be created using the Facelet
FaceletCache.MemberFactory
and stored in the cache.- Parameters:
url
-URL
for the Facelet being retrieved- Throws:
NullPointerException
- if argumenturl
isnull
.IOException
-
isFaceletCached
public abstract boolean isFaceletCached(URL url)
Determines whether a cached Facelet instance exists for this URL. Returns true if a cached instance exists, false otherwise
- Parameters:
url
-URL
for the Facelet- Throws:
NullPointerException
- if argumenturl
isnull
.
-
getViewMetadataFacelet
public abstract V getViewMetadataFacelet(URL url) throws IOException
Returns a cached View Metadata Facelet instance. If no instance is available, it will be created using the View Metadata Facelet
FaceletCache.MemberFactory
and stored in the cache.- Parameters:
url
-URL
for the View Metadata Facelet being retrieved- Throws:
NullPointerException
- if argumenturl
isnull
.IOException
-
isViewMetadataFaceletCached
public abstract boolean isViewMetadataFaceletCached(URL url)
Determines whether a cached View Metadata Facelet instance exists for this URL. Returns true if a cached instance exists, false otherwise
- Parameters:
url
-URL
for the View Metadata Facelet- Throws:
NullPointerException
- if argumenturl
isnull
.
-
setMemberFactories
protected void setMemberFactories(FaceletCache.MemberFactory<V> faceletFactory, FaceletCache.MemberFactory<V> viewMetadataFaceletFactory)
This must be called by the runtime at startup time, before any requests are serviced, and allows for the
FaceletCache
implementation to provide theFaceletCache.MemberFactory
instances that will be used to create instances of Facelets and View Metadata Facelets.- Parameters:
faceletFactory
- theFaceletCache.MemberFactory
instance that will be used to create instances of Facelets.viewMetadataFaceletFactory
- theFaceletCache.MemberFactory
instance that will be used to create instances of metadata Facelets.- Throws:
NullPointerException
- if either argument isnull
-
getMemberFactory
protected FaceletCache.MemberFactory<V> getMemberFactory()
Returns the
FaceletCache.MemberFactory
passed tosetMemberFactories(javax.faces.view.facelets.FaceletCache.MemberFactory<V>, javax.faces.view.facelets.FaceletCache.MemberFactory<V>)
for the purpose of creating Facelet instance.
-
getMetadataMemberFactory
protected FaceletCache.MemberFactory<V> getMetadataMemberFactory()
Returns the
FaceletCache.MemberFactory
passed tosetMemberFactories(javax.faces.view.facelets.FaceletCache.MemberFactory<V>, javax.faces.view.facelets.FaceletCache.MemberFactory<V>)
for the purpose of creating View Metadata Facelet instance.
-
-
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/view/facelets/faceletcache.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.