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, setupLoggerprivate 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 ContextualizableContextExceptionpublic void service(ServiceManager manager) throws ServiceException
service in interface ServiceableServiceExceptionpublic void initialize() throws Exception
initialize in interface InitializableExceptionpublic void dispose()
dispose in interface Disposablepublic void parameterize(Parameters params) throws ParameterException
parameterize in interface ParameterizableParameterExceptionpublic void setTransformerFactory(String classname)
setTransformerFactory in interface XSLTProcessorpublic TransformerHandler getTransformerHandler(Source stylesheet) throws XSLTProcessorException
getTransformerHandler in interface XSLTProcessorXSLTProcessorExceptionpublic TransformerHandler getTransformerHandler(Source stylesheet, XMLFilter filter) throws XSLTProcessorException
getTransformerHandler in interface XSLTProcessorXSLTProcessorExceptionpublic XSLTProcessor.TransformerHandlerAndValidity getTransformerHandlerAndValidity(Source stylesheet) throws XSLTProcessorException
getTransformerHandlerAndValidity in interface XSLTProcessorXSLTProcessorExceptionpublic XSLTProcessor.TransformerHandlerAndValidity getTransformerHandlerAndValidity(Source stylesheet, XMLFilter filter) throws XSLTProcessorException
getTransformerHandlerAndValidity in interface XSLTProcessorXSLTProcessorExceptionprivate Templates _getTemplates(Source stylesheet, XMLFilter filter) throws XSLTProcessorException, IOException
XSLTProcessorExceptionIOExceptionprivate ThreadSafeTraxProcessor.CachedTemplates _getCachedTemplates(Collection<ThreadSafeTraxProcessor.CachedTemplates> cachedTemplates) throws IOException
IOExceptionprivate int _isValid(ThreadSafeTraxProcessor.CachedTemplates templates, Map<ThreadSafeTraxProcessor.UnresolvedURI,ThreadSafeTraxProcessor.ResolvedURI> resolutionCache) throws IOException
IOExceptionprivate ThreadSafeTraxProcessor.CachedTemplates _createTemplates(Source stylesheet, XMLFilter filter) throws XSLTProcessorException
XSLTProcessorExceptionprivate void _sourceToSAX(Source source, ContentHandler handler) throws SAXException, IOException, SourceException
SAXExceptionIOExceptionSourceExceptionpublic void transform(Source source, Source stylesheet, Parameters params, Result result) throws XSLTProcessorException
transform in interface XSLTProcessorXSLTProcessorExceptionprivate SAXTransformerFactory _createTransformerFactory(String factoryName)
factoryName - The name of the factory class to createpublic Source resolve(String href, String base) throws TransformerException
resolve in interface URIResolverhref - 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
IOExceptionSource _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.