Class DefaultFaceletFactory
- java.lang.Object
- 
- org.apache.myfaces.view.facelets.FaceletFactory
- 
- org.apache.myfaces.view.facelets.impl.DefaultFaceletFactory
 
 
- 
 public final class DefaultFaceletFactory extends FaceletFactory Default FaceletFactory implementation.- Version:
- $Id$
- Author:
- Jacob Hookom
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected Loggerlog- 
Fields inherited from class org.apache.myfaces.view.facelets.FaceletFactoryLAST_RESOURCE_RESOLVED
 
- 
 - 
Constructor SummaryConstructors Constructor Description DefaultFaceletFactory(Compiler compiler)DefaultFaceletFactory(Compiler compiler, long refreshPeriod)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description FaceletcompileComponentFacelet(String taglibURI, String tagName, Map<String,Object> attributes)Compile a component tag on the fly.CompilergetCompiler()Compiler this factory usesFaceletgetCompositeComponentMetadataFacelet(FacesContext facesContext, String uri)Works in the same way as getFacelet(String uri), but redirect to getViewMetadataFacelet(URL url)FaceletgetCompositeComponentMetadataFacelet(URL url)Create a Facelet used to create composite component metadata from the passed URL.FaceletgetFacelet(FacesContext facesContext, String uri)Return a Facelet instance as specified by the file at the passed URI.FaceletgetFacelet(FaceletContext ctx, URL url)Create a Facelet from the passed URL, but take into account the context.FaceletgetFacelet(URL url)Create a Facelet from the passed URL.longgetRefreshPeriod()FaceletgetViewMetadataFacelet(FacesContext facesContext, String uri)Works in the same way as getFacelet(String uri), but redirect to getViewMetadataFacelet(URL url)FaceletgetViewMetadataFacelet(URL url)Create a Facelet used to create view metadata from the passed URL.protected booleanneedsToBeRefreshed(org.apache.myfaces.view.facelets.impl.DefaultFacelet facelet)Template method for determining if the Facelet needs to be refreshed.URLresolveURL(FacesContext context, URL source, String path)Resolves a path based on the passed URL.- 
Methods inherited from class org.apache.myfaces.view.facelets.FaceletFactorygetInstance, setInstance
 
- 
 
- 
- 
- 
Field Detail- 
logprotected final Logger log 
 
- 
 - 
Constructor Detail- 
DefaultFaceletFactorypublic DefaultFaceletFactory(Compiler compiler) throws IOException - Throws:
- IOException
 
 - 
DefaultFaceletFactorypublic DefaultFaceletFactory(Compiler compiler, long refreshPeriod) 
 
- 
 - 
Method Detail- 
getCompilerpublic Compiler getCompiler() Compiler this factory uses- Returns:
- final Compiler instance
 
 - 
getFaceletpublic Facelet getFacelet(FacesContext facesContext, String uri) throws IOException, FaceletException, FacesException, jakarta.el.ELException Description copied from class:FaceletFactoryReturn a Facelet instance as specified by the file at the passed URI.- Specified by:
- getFaceletin class- FaceletFactory
- Returns:
- Throws:
- IOException
- FaceletException
- FacesException
- jakarta.el.ELException
 
 - 
getFaceletpublic Facelet getFacelet(URL url) throws IOException, FaceletException, FacesException, jakarta.el.ELException Create a Facelet from the passed URL. This method checks if the cached Facelet needs to be refreshed before returning. If so, uses the passed URL to build a new instance;- Specified by:
- getFaceletin class- FaceletFactory
- Parameters:
- url- source url
- Returns:
- Facelet instance
- Throws:
- IOException
- FaceletException
- FacesException
- jakarta.el.ELException
 
 - 
getFaceletpublic Facelet getFacelet(FaceletContext ctx, URL url) throws IOException, FaceletException, FacesException, jakarta.el.ELException Description copied from class:FaceletFactoryCreate a Facelet from the passed URL, but take into account the context. This method is useful in cases where the facelet instance must replace the one in the cache based on the context, instead take the one from the cache, like for example when the EL expression cache is used.- Specified by:
- getFaceletin class- FaceletFactory
- url- source url
- Returns:
- Facelet instance
- Throws:
- IOException
- FaceletException
- FacesException
- jakarta.el.ELException
 
 - 
getRefreshPeriodpublic long getRefreshPeriod() 
 - 
resolveURLpublic URL resolveURL(FacesContext context, URL source, String path) throws IOException Resolves a path based on the passed URL. If the path starts with '/', then resolve the path againstjakarta.faces.context.ExternalContext#getResource(java.lang.String). Otherwise create a new URL viaURL(URL, String).- Parameters:
- source- base to resolve from
- path- relative path to the source
- Returns:
- resolved URL
- Throws:
- IOException
 
 - 
needsToBeRefreshedprotected boolean needsToBeRefreshed(org.apache.myfaces.view.facelets.impl.DefaultFacelet facelet) Template method for determining if the Facelet needs to be refreshed.- Parameters:
- facelet- Facelet that could have expired
- Returns:
- true if it needs to be refreshed
 
 - 
getViewMetadataFaceletpublic Facelet getViewMetadataFacelet(FacesContext facesContext, String uri) throws IOException Works in the same way as getFacelet(String uri), but redirect to getViewMetadataFacelet(URL url)- Specified by:
- getViewMetadataFaceletin class- FaceletFactory
- Returns:
- Throws:
- IOException
- Since:
- 2.0
 
 - 
getViewMetadataFaceletpublic Facelet getViewMetadataFacelet(URL url) throws IOException, FaceletException, FacesException, jakarta.el.ELException Description copied from class:FaceletFactoryCreate a Facelet used to create view metadata from the passed URL. This method checks if the cached Facelet needs to be refreshed before returning. If so, uses the passed URL to build a new instance;- Specified by:
- getViewMetadataFaceletin class- FaceletFactory
- Parameters:
- url- source url
- Returns:
- Facelet instance
- Throws:
- IOException
- FaceletException
- FacesException
- jakarta.el.ELException
- Since:
- 2.0
 
 - 
getCompositeComponentMetadataFaceletpublic Facelet getCompositeComponentMetadataFacelet(FacesContext facesContext, String uri) throws IOException Works in the same way as getFacelet(String uri), but redirect to getViewMetadataFacelet(URL url)- Specified by:
- getCompositeComponentMetadataFaceletin class- FaceletFactory
- Returns:
- Throws:
- IOException
- Since:
- 2.0.1
 
 - 
getCompositeComponentMetadataFaceletpublic Facelet getCompositeComponentMetadataFacelet(URL url) throws IOException, FaceletException, FacesException, jakarta.el.ELException Description copied from class:FaceletFactoryCreate a Facelet used to create composite component metadata from the passed URL. This method checks if the cached Facelet needs to be refreshed before returning. If so, uses the passed URL to build a new instance.- Specified by:
- getCompositeComponentMetadataFaceletin class- FaceletFactory
- Parameters:
- url- source url
- Returns:
- Facelet instance
- Throws:
- IOException
- FaceletException
- FacesException
- jakarta.el.ELException
- Since:
- 2.0.1
 
 - 
compileComponentFaceletpublic Facelet compileComponentFacelet(String taglibURI, String tagName, Map<String,Object> attributes) Description copied from class:FaceletFactoryCompile a component tag on the fly.- Specified by:
- compileComponentFaceletin class- FaceletFactory
- Returns:
 
 
- 
 
-