|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectno.sesat.search.view.velocity.VelocityEngineFactory
public final class VelocityEngineFactory
Custom Factory around Velocity Engines and Templates.
Each instance maps to an VelocityEngine instance.
All template operations (getting and merging) are done through this class
rather than directly against Velocity's API.
Developer Aid
Ola-marius extended the engine so to run in debug mode that outlines (& titles) each rendered template.
See
Debugging Velocity Templates
| Nested Class Summary | |
|---|---|
static interface |
VelocityEngineFactory.Context
The context the AnalysisRules must work against. |
| Method Summary | |
|---|---|
org.apache.velocity.app.VelocityEngine |
getEngine()
|
static org.apache.velocity.Template |
getTemplate(org.apache.velocity.app.VelocityEngine engine,
Site site,
String templateName)
Find the appropriate velocity Template by its name against a given engine and site. |
static VelocityEngineFactory |
instanceOf(VelocityEngineFactory.Context cxt)
Main method to retrieve the correct VelocityEngine to further obtain AnalysisRule. |
static org.apache.velocity.VelocityContext |
newContextInstance()
|
boolean |
remove(Site site)
Remove the factory the maps to the given site. |
static VelocityEngineFactory |
valueOf(Site site)
Utility wrapper to the instanceOf(Context). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static org.apache.velocity.Template getTemplate(org.apache.velocity.app.VelocityEngine engine,
Site site,
String templateName)
throws org.apache.velocity.exception.ResourceNotFoundException
engine - the VelocityEngine appropriate for the current site.site - the current site.templateName - the name of the template. must not contain ".vm" suffix.
org.apache.velocity.exception.ResourceNotFoundException - if the template was not found.public static org.apache.velocity.VelocityContext newContextInstance()
public static VelocityEngineFactory instanceOf(VelocityEngineFactory.Context cxt)
cxt - the contextual needs the VelocityEngine must use to operate.
public static VelocityEngineFactory valueOf(Site site)
site - the site the VelocityEngine will work for.
public org.apache.velocity.app.VelocityEngine getEngine()
public boolean remove(Site site)
SiteKeyedFactory
remove in interface SiteKeyedFactorysite - remove factory corresponding to this site.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||