StylesheetCache to cache stylesheets for performance.
This has been made "public" as it is used by certain standalone tools, like the
MathMLDownConverter, but its use outside SnuggleTeX is perhaps somewhat limited.
This class is thread-safe.
| Modifier and Type | Field and Description |
|---|---|
| private StylesheetCache | |
| private TransformerFactoryChooser |
| Access | Constructor and Description |
|---|---|
| public | StylesheetManager()
Creates a new |
| public | StylesheetManager(StylesheetCache
StylesheetCache to use, which may be null if you don't want to do any
caching.Creates a new |
| public | StylesheetManager(TransformerFactoryChooser
TransformerFactoryChooser to use, which must not
be null.Creates a new |
| Modifier and Type | Method and Description |
|---|---|
| private Templates | |
| private Templates | compileStylesheetDriver(final List<String> importUris, boolean requireXSLT20)
Compiles a "driver" XSLT stylesheet that imports the stylesheets at the given URIs. |
| private void | |
| public Templates | Returns: compiled XSLT stylesheet.location of the XSLT stylesheet in the ClassPath, following the
URI scheme in classPathUri)ClassPathURIResolver.Obtains the XSLT stylesheet at the given ClassPathURI, using the |
| public Templates | Returns: compiled XSLT stylesheet.location of the XSLT stylesheet in the ClassPath, following the
URI scheme in classPathUri, final boolean ClassPathURIResolver.if false uses the JAXP default requireXSLT20)TransformerFactory, otherwise
specifies that we require an XSLT 2.0-compliant transformer, of which the only currently
supported implementation is SAXON 9.x.Obtains the XSLT stylesheet at the given ClassPathURI, using the |
| public Templates | Returns: compiled XSLT stylesheet.List of locations of the XSLT stylesheets to be compiled, following the
URI scheme in importClassPathUris, final boolean ClassPathURIResolver.if false uses the JAXP default requireXSLT20)TransformerFactory, otherwise
specifies that we require an XSLT 2.0-compliant transformer, of which the only currently
supported implementation is SAXON 9.x.Obtains a "driver" XSLT stylesheet that imports the stylesheets having the given
ClassPath URIs, using the |
| public Transformer | getSerializer(final String
URI for the required serializing stylesheet, null for the default
serializer. serializerUri, final SerializationSpecifier desired serializationOptions)SerializationSpecifier, null for default optionsObtains a serializer stylesheet based on the stylesheet at the given URI, configured
as per the given |
| public StylesheetCache | |
| public TransformerFactory | getTransformerFactory(final boolean requireXSLT20)
Uses the current |
| public TransformerFactoryChooser | getTransformerFactoryChooser()
Returns the current |
| public void | setStylesheetCache(StylesheetCache stylesheetCache)
Sets the |
| public void | setTransformerFactoryChooser(TransformerFactoryChooser
new transformerFactoryChooser)TransformerFactoryChooser, which must not be null.Sets the |
| public boolean | supportsXSLT20()
Returns whether or not XSLT 2.0 is supported, by asking the underlying
|
| stylesheetCache | back to summary |
|---|---|
| private StylesheetCache stylesheetCache | |
| transformerFactoryChooser | back to summary |
|---|---|
| private TransformerFactoryChooser transformerFactoryChooser | |
| StylesheetManager | back to summary |
|---|---|
| public StylesheetManager() Creates a new | |
| StylesheetManager | back to summary |
|---|---|
| public StylesheetManager(StylesheetCache cache) Creates a new
| |
| StylesheetManager | back to summary |
|---|---|
| public StylesheetManager(TransformerFactoryChooser transformerFactoryChooser, StylesheetCache cache) Creates a new
| |
| compileStylesheet | back to summary |
|---|---|
| private Templates compileStylesheet(final String classPathUri, final boolean requireXSLT20) | |
| compileStylesheetDriver | back to summary |
|---|---|
| private Templates compileStylesheetDriver(final List<String> importUris, boolean requireXSLT20) Compiles a "driver" XSLT stylesheet that imports the stylesheets at the given URIs. | |
| ensureChooserSpecified | back to summary |
|---|---|
| private void ensureChooserSpecified() | |
| getCompiledStylesheet | back to summary |
|---|---|
| public Templates getCompiledStylesheet(final String classPathUri) Obtains the XSLT stylesheet at the given ClassPathURI, using the
| |
| getCompiledStylesheet | back to summary |
|---|---|
| public Templates getCompiledStylesheet(final String classPathUri, final boolean requireXSLT20) Obtains the XSLT stylesheet at the given ClassPathURI, using the
| |
| getCompiledStylesheetDriver | back to summary |
|---|---|
| public Templates getCompiledStylesheetDriver(final List<String> importClassPathUris, final boolean requireXSLT20) Obtains a "driver" XSLT stylesheet that imports the stylesheets having the given
ClassPath URIs, using the
| |
| getSerializer | back to summary |
|---|---|
| public Transformer getSerializer(final String serializerUri, final SerializationSpecifier serializationOptions) Obtains a serializer stylesheet based on the stylesheet at the given URI, configured
as per the given
| |
| getStylesheetCache | back to summary |
|---|---|
| public StylesheetCache getStylesheetCache() Returns the current | |
| getTransformerFactory | back to summary |
|---|---|
| public TransformerFactory getTransformerFactory(final boolean requireXSLT20) Uses the current | |
| getTransformerFactoryChooser | back to summary |
|---|---|
| public TransformerFactoryChooser getTransformerFactoryChooser() Returns the current | |
| setStylesheetCache | back to summary |
|---|---|
| public void setStylesheetCache(StylesheetCache stylesheetCache) Sets the | |
| setTransformerFactoryChooser | back to summary |
|---|---|
| public void setTransformerFactoryChooser(TransformerFactoryChooser transformerFactoryChooser) Sets the
| |
| supportsXSLT20 | back to summary |
|---|---|
| public boolean supportsXSLT20() Returns whether or not XSLT 2.0 is supported, by asking the underlying
| |