|
Carrot2 v3.5.2
API Documentation |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.carrot2.util.xslt.TemplatesPool
public final class TemplatesPool
A pool of precompiled XSLT stylesheets (Templates). Caching can be disabled
via constructor parameter or via setting a system property:
template.cachingto
false.
| Field Summary | |
|---|---|
static String |
TEMPLATE_CACHING_PROPERTY
Global system property disabling template caching. |
SAXTransformerFactory |
tFactory
SAXTransformerFactory capable of producing SAX-based transformers. |
| Constructor Summary | |
|---|---|
TemplatesPool()
Creates a TemplatesPool with caching enabled. |
|
TemplatesPool(boolean templateCaching)
Check for required facilities. |
|
| Method Summary | |
|---|---|
void |
addTemplate(String key,
Templates template)
Add a new template to the pool. |
Templates |
compileTemplate(InputStream stream)
Compile a Templates from a given stream. |
Templates |
compileTemplate(String systemId)
Compile a Templates from a given system identifier. |
TransformerHandler |
getIdentityTransformerHandler()
|
Templates |
getTemplate(String key)
Retrieves a previously stored template, if available. |
Transformer |
newTransformer(Templates t)
Return a new Transformer. |
TransformerHandler |
newTransformerHandler(Templates template)
Return a new TransformerHandler based on a given precompiled
Templates. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String TEMPLATE_CACHING_PROPERTY
public final SAXTransformerFactory tFactory
SAXTransformerFactory capable of producing SAX-based transformers.
| Constructor Detail |
|---|
public TemplatesPool()
throws Exception
TemplatesPool with caching enabled.
Exception
public TemplatesPool(boolean templateCaching)
throws Exception
Exception| Method Detail |
|---|
public TransformerHandler getIdentityTransformerHandler()
throws TransformerConfigurationException
TransformerConfigurationExceptionpublic Templates getTemplate(String key)
public void addTemplate(String key,
Templates template)
stylesheets HashMap.
public Templates compileTemplate(String systemId)
throws SAXException
Templates from a given system identifier. The template is not
added to the pool, a manual call to addTemplate(String, Templates) is
required.
SAXException
public Templates compileTemplate(InputStream stream)
throws SAXException
Templates from a given stream. The template is not added to the
pool automatically.
SAXException
public TransformerHandler newTransformerHandler(Templates template)
throws TransformerConfigurationException
TransformerHandler based on a given precompiled
Templates. The handler Transformer's ErrorListener is set
to TransformerErrorListener to raise exceptions and give proper warnings.
TransformerConfigurationException
public Transformer newTransformer(Templates t)
throws TransformerConfigurationException
Transformer.
TransformerConfigurationExceptionnewTransformerHandler(Templates)
|
Please refer to project documentation at
http://project.carrot2.org |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||