Top Description Inners Fields Constructors Methods
com.sun.faces.facelets.impl

public Class DefaultFaceletFactory

extends Object
Class Inheritance
Static Imports
com.sun.faces.RIConstants.CHAR_ENCODING, com.sun.faces.cdi.CdiUtils.getBeanReference, com.sun.faces.config.WebConfiguration.BooleanWebContextInitParameter.UseFaceletsID, com.sun.faces.util.Util.isEmpty, .Util.notNull, .Util.saveDOCTYPEToFacesContextAttributes, .Util.saveXMLDECLToFacesContextAttributes, java.util.logging.Level.FINEST, java.util.regex.Pattern.quote

Default FaceletFactory implementation.
Author
Jacob Hookom
Version
$Id: DefaultFaceletFactory.java,v 1.10 2007/04/09 01:13:17 youngm Exp $

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private URL
private String
private FaceletCache<DefaultFacelet>
private ConcurrentMap<String, FaceletCache<DefaultFacelet>>
private Compiler
pack-priv Cache<String, IdMapper>
protected static final Logger
private ResourceManager
private long
private DefaultResourceResolver

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public UIComponent
_createComponent(FacesContext context, String taglibURI, String tagName, Map<String, Object> attributes)

private DefaultFacelet

Returns:

a Facelet instance
createFacelet
(URL
source
url
)

Uses the internal Compiler reference to build a Facelet given the passed URL.

private DefaultFacelet
createFacelet(URL url, String alias)

private DefaultFacelet
private FaceletCache<DefaultFacelet>
public Facelet
getFacelet(FacesContext context, String viewId)

public Facelet

Returns:

Facelet instance
getFacelet
(FacesContext
the involved faces context
context
,
URL
source url
url
)

Create a Facelet from the passed URL.

public Facelet
public Facelet
public long
public DefaultResourceResolver
public final void
init(FacesContext facesContext, Compiler compiler, DefaultResourceResolver resolver, long refreshPeriod, FaceletCache<V> cache)

private FaceletCache<DefaultFacelet>
public boolean

Returns:

true if given url is a contracts resource.
isContractsResource
(URL
source url
url
)

Returns true if given url is a contracts resource.

public boolean
public URL

Returns:

resolved URL
resolveURL
(URL
base to resolve from
source
,
String
relative path to the source
path
)

Resolves a path based on the passed URL.

private URL
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

baseUrlback to summary
private URL baseUrl
baseUrlAsStringback to summary
private String baseUrlAsString
cacheback to summary
private FaceletCache<DefaultFacelet> cache
cachePerContractback to summary
private ConcurrentMap<String, FaceletCache<DefaultFacelet>> cachePerContract
compilerback to summary
private Compiler compiler
idMappersback to summary
pack-priv Cache<String, IdMapper> idMappers
logback to summary
protected static final Logger log
managerback to summary
private ResourceManager manager
refreshPeriodback to summary
private long refreshPeriod
resolverback to summary
private DefaultResourceResolver resolver

Constructor Detail

DefaultFaceletFactoryback to summary
public DefaultFaceletFactory()

Method Detail

_createComponentback to summary
public UIComponent _createComponent(FacesContext context, String taglibURI, String tagName, Map<String, Object> attributes)
createFaceletback to summary
private DefaultFacelet createFacelet(URL url) throws IOException

Uses the internal Compiler reference to build a Facelet given the passed URL.

Parameters
url:URL

source

Returns:DefaultFacelet

a Facelet instance

createFaceletback to summary
private DefaultFacelet createFacelet(URL url, String alias) throws IOException
createMetadataFaceletback to summary
private DefaultFacelet createMetadataFacelet(URL url) throws IOException
getCacheback to summary
private FaceletCache<DefaultFacelet> getCache(FacesContext context)
getFaceletback to summary
public Facelet getFacelet(FacesContext context, String viewId) throws IOException
getFaceletback to summary
public Facelet getFacelet(FacesContext context, URL url) throws IOException

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;

Parameters
context:FacesContext

the involved faces context

url:URL

source url

Returns:Facelet

Facelet instance

Exceptions
IOException:
when an I/O exception occurs
FaceletException:
when a Facelet exception occurs
FacesException:
when a Faces exception occurs
ELException:
when an EL exception occurs
getMetadataFaceletback to summary
public Facelet getMetadataFacelet(FacesContext context, String viewId) throws IOException
getMetadataFaceletback to summary
public Facelet getMetadataFacelet(FacesContext context, URL url) throws IOException
getRefreshPeriodback to summary
public long getRefreshPeriod()
getResourceResolverback to summary
public DefaultResourceResolver getResourceResolver()
initback to summary
public final void init(FacesContext facesContext, Compiler compiler, DefaultResourceResolver resolver, long refreshPeriod, FaceletCache<V> cache)
initCacheback to summary
private FaceletCache<DefaultFacelet> initCache(FaceletCache<DefaultFacelet> cache)
isContractsResourceback to summary
public boolean isContractsResource(URL url)

Returns true if given url is a contracts resource.

Parameters
url:URL

source url

Returns:boolean

true if given url is a contracts resource.

needsToBeRefreshedback to summary
public boolean needsToBeRefreshed(URL url)
resolveURLback to summary
public URL resolveURL(URL source, String path) throws IOException

Resolves a path based on the passed URL. If the path starts with '/', then resolve the path against jakarta.faces.context.ExternalContext#getResource(java.lang.String). Otherwise create a new URL via URL(URL, String).

Parameters
source:URL

base to resolve from

path:String

relative path to the source

Returns:URL

resolved URL

Exceptions
IOException:
when an I/O exception occurs
resolveURLback to summary
private URL resolveURL(String uri) throws IOException
com.sun.faces.facelets.impl back to summary

private final Class DefaultFaceletFactory.IdMapperFactory

extends Object
implements Cache.Factory<String, IdMapper>
Class Inheritance
  • java.lang.Object
  • com.sun.faces.facelets.impl.DefaultFaceletFactory.IdMapperFactory
All Implemented Interfaces
com.sun.faces.util.Cache.Factory, java.util.function.Function

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public IdMapper
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

IdMapperFactoryback to summary
private IdMapperFactory()

Method Detail

newInstanceback to summary
public IdMapper newInstance(String arg) throws InterruptedException

Implements com.sun.faces.util.Cache.Factory.newInstance.

Annotations
@Override