com.sun.facelets.impl
Class DefaultFaceletFactory

java.lang.Object
  extended by com.sun.facelets.FaceletFactory
      extended by com.sun.facelets.impl.DefaultFaceletFactory

public final class DefaultFaceletFactory
extends FaceletFactory

Default FaceletFactory implementation.

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

Field Summary
protected static Logger log
           
 
Constructor Summary
DefaultFaceletFactory(Compiler compiler, ResourceResolver resolver)
           
DefaultFaceletFactory(Compiler compiler, ResourceResolver resolver, long refreshPeriod)
           
 
Method Summary
 Compiler getCompiler()
          Compiler this factory uses
 Facelet getFacelet(String uri)
          Return a Facelet instance as specified by the file at the passed URI.
 Facelet getFacelet(URL url)
          Create a Facelet from the passed URL.
 long getRefreshPeriod()
           
protected  boolean needsToBeRefreshed(com.sun.facelets.impl.DefaultFacelet facelet)
          Template method for determining if the Facelet needs to be refreshed.
 URL resolveURL(URL source, String path)
          Resolves a path based on the passed URL.
 
Methods inherited from class com.sun.facelets.FaceletFactory
getInstance, setInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final Logger log
Constructor Detail

DefaultFaceletFactory

public DefaultFaceletFactory(Compiler compiler,
                             ResourceResolver resolver)
                      throws IOException
Throws:
IOException

DefaultFaceletFactory

public DefaultFaceletFactory(Compiler compiler,
                             ResourceResolver resolver,
                             long refreshPeriod)
Method Detail

getFacelet

public Facelet getFacelet(String uri)
                   throws IOException,
                          FaceletException,
                          FacesException,
                          javax.el.ELException
Description copied from class: FaceletFactory
Return a Facelet instance as specified by the file at the passed URI.

Specified by:
getFacelet in class FaceletFactory
Returns:
Throws:
IOException
FaceletException
FacesException
javax.el.ELException

resolveURL

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 javax.faces.context.ExternalContext#getResource(java.lang.String). Otherwise create a new URL via URL(URL, String).

Parameters:
source - base to resolve from
path - relative path to the source
Returns:
resolved URL
Throws:
IOException

getFacelet

public Facelet getFacelet(URL url)
                   throws IOException,
                          FaceletException,
                          FacesException,
                          javax.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;

Parameters:
url - source url
Returns:
Facelet instance
Throws:
IOException
FaceletException
FacesException
javax.el.ELException

needsToBeRefreshed

protected boolean needsToBeRefreshed(com.sun.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

getCompiler

public Compiler getCompiler()
Compiler this factory uses

Returns:
final Compiler instance

getRefreshPeriod

public long getRefreshPeriod()


Copyright © 2005 All Rights Reserved.