- 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.
-
-
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/view/facelets/faceletcache.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.