| Modifier and Type | Field and Description |
|---|---|
static String |
TEMPLATE_CACHING_PROPERTY
Global system property disabling template caching.
|
SAXTransformerFactory |
tFactory
SAXTransformerFactory capable of producing SAX-based transformers. |
| Constructor and Description |
|---|
TemplatesPool()
Creates a
TemplatesPool with caching enabled. |
TemplatesPool(boolean templateCaching)
Check for required facilities.
|
| Modifier and Type | Method and Description |
|---|---|
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. |
public static final String TEMPLATE_CACHING_PROPERTY
public final SAXTransformerFactory tFactory
SAXTransformerFactory capable of producing SAX-based transformers.public TemplatesPool()
throws Exception
TemplatesPool with caching enabled.Exceptionpublic 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.SAXExceptionpublic Templates compileTemplate(InputStream stream) throws SAXException
Templates from a given stream. The template is not added to the
pool automatically.SAXExceptionpublic 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.public Transformer newTransformer(Templates t) throws TransformerConfigurationException
Transformer.TransformerConfigurationExceptionnewTransformerHandler(Templates)