public class ThreadSafeTraxProcessor extends AbstractLogEnabled implements XSLTProcessor, Serviceable, Initializable, Disposable, Parameterizable, URIResolver, Contextualizable
Templates
cache, for performance purpose.Modifier and Type | Class and Description |
---|---|
private class |
ThreadSafeTraxProcessor.CachedTemplates |
(package private) static class |
ThreadSafeTraxProcessor.MyTransformerHandlerAndValidity
Subclass to allow for instanciation, as for some unknown reason the constructor is protected....
|
private static class |
ThreadSafeTraxProcessor.ResolvedURI |
private static class |
ThreadSafeTraxProcessor.TemplatesCache |
private static class |
ThreadSafeTraxProcessor.UnresolvedURI |
XSLTProcessor.TransformerHandlerAndValidity
Modifier and Type | Field and Description |
---|---|
private static String |
__URI_CACHE_ATTR |
private Context |
_context |
private boolean |
_dontUseCache |
private SAXTransformerFactory |
_factory
The trax TransformerFactory this component uses
|
private boolean |
_incrementalProcessing
Is incremental processing turned on? (default for Xalan: no)
|
private ServiceManager |
_manager
The ServiceManager
|
private SourceResolver |
_resolver
Resolver used to resolve XSLT document() calls, imports and includes
|
private Map<String,ThreadSafeTraxProcessor.TemplatesCache> |
_templatesCache |
private String |
_transformerFactory
The configured transformer factory to use
|
private XMLizer |
_xmlizer |
ROLE
Constructor and Description |
---|
ThreadSafeTraxProcessor() |
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
private static final String __URI_CACHE_ATTR
private String _transformerFactory
private SAXTransformerFactory _factory
private boolean _incrementalProcessing
private SourceResolver _resolver
private ServiceManager _manager
private boolean _dontUseCache
private Map<String,ThreadSafeTraxProcessor.TemplatesCache> _templatesCache
public ThreadSafeTraxProcessor()
public void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
ContextException
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public void initialize() throws Exception
initialize
in interface Initializable
Exception
public void dispose()
dispose
in interface Disposable
public void parameterize(Parameters params) throws ParameterException
parameterize
in interface Parameterizable
ParameterException
public void setTransformerFactory(String classname)
setTransformerFactory
in interface XSLTProcessor
public TransformerHandler getTransformerHandler(Source stylesheet) throws XSLTProcessorException
getTransformerHandler
in interface XSLTProcessor
XSLTProcessorException
public TransformerHandler getTransformerHandler(Source stylesheet, XMLFilter filter) throws XSLTProcessorException
getTransformerHandler
in interface XSLTProcessor
XSLTProcessorException
public XSLTProcessor.TransformerHandlerAndValidity getTransformerHandlerAndValidity(Source stylesheet) throws XSLTProcessorException
getTransformerHandlerAndValidity
in interface XSLTProcessor
XSLTProcessorException
public XSLTProcessor.TransformerHandlerAndValidity getTransformerHandlerAndValidity(Source stylesheet, XMLFilter filter) throws XSLTProcessorException
getTransformerHandlerAndValidity
in interface XSLTProcessor
XSLTProcessorException
private Templates _getTemplates(Source stylesheet, XMLFilter filter) throws XSLTProcessorException, IOException
XSLTProcessorException
IOException
private ThreadSafeTraxProcessor.CachedTemplates _getCachedTemplates(Collection<ThreadSafeTraxProcessor.CachedTemplates> cachedTemplates) throws IOException
IOException
private int _isValid(ThreadSafeTraxProcessor.CachedTemplates templates, Map<ThreadSafeTraxProcessor.UnresolvedURI,ThreadSafeTraxProcessor.ResolvedURI> resolutionCache) throws IOException
IOException
private ThreadSafeTraxProcessor.CachedTemplates _createTemplates(Source stylesheet, XMLFilter filter) throws XSLTProcessorException
XSLTProcessorException
private void _sourceToSAX(Source source, ContentHandler handler) throws SAXException, IOException, SourceException
SAXException
IOException
SourceException
public void transform(Source source, Source stylesheet, Parameters params, Result result) throws XSLTProcessorException
transform
in interface XSLTProcessor
XSLTProcessorException
private SAXTransformerFactory _createTransformerFactory(String factoryName)
factoryName
- The name of the factory class to createpublic Source resolve(String href, String base) throws TransformerException
resolve
in interface URIResolver
href
- An href attribute, which may be relative or absolute.base
- The base URI in effect when the href attribute was encountered.TransformerException
- if an error occurs when trying to resolve the URI.private Source _resolve(String href, String base) throws IOException
IOException
Source _resolve(String href, String base, Collection<String> rawURIs, Collection<String> baseURIs, Collection<Long> timestamps, Collection<String> resolvedURIs)
private InputSource _getInputSource(Source source) throws IOException, SourceException
InputSource
object that uses the InputStream
and the system ID of the Source
object.source
- The source concernedIOException
- if I/O error occurred.SourceException
- if an error occurred.