public final class SnuggleEngine extends Object
SnugglePackages you have
created or want to use by calling addPackage(SnugglePackage).
createSession() to create a "session" that will take one (or more) input
documents and produce a DOM.
SnuggleSession created will use a _copy_ of
the SnugglePackages registered with the engine and _copies_ of
the current defaultSessionConfiguration, defaultDOMOutputOptions,
and defaultXMLStringOutputOptions. On the other hand, it will use the shared
StylesheetManager set for this engine.
| Constructor and Description |
|---|
SnuggleEngine()
Creates a new
SnuggleEngine using a very simple internal cache for any
XSLT stylesheets required that simply stores them internally for the lifetime
of the engine. |
SnuggleEngine(StylesheetCache stylesheetCache)
Creates a new
SnuggleEngine using the given StylesheetCache
for managing stylesheets. |
SnuggleEngine(StylesheetManager stylesheetManager)
Creates a new
SnuggleEngine using the given StylesheetManager
for managing stylesheets. |
SnuggleEngine(TransformerFactoryChooser transformerFactoryChooser,
StylesheetCache stylesheetCache)
Creates a new
SnuggleEngine using the given StylesheetCache
for managing stylesheets and given TransformerFactoryChooser for choosing which
XSLT implementation to use. |
public SnuggleEngine()
SnuggleEngine using a very simple internal cache for any
XSLT stylesheets required that simply stores them internally for the lifetime
of the engine. The DefaultTransformerFactoryChooser is used to choose
XSLT implementations.
This will be fine in most cases. If you want more control over this, consider the alternative constructor.
public SnuggleEngine(StylesheetCache stylesheetCache)
SnuggleEngine using the given StylesheetCache
for managing stylesheets. Use this if you want to integrate XSLT caching
with your own code or want more control over how things get cached.
The DefaultTransformerFactoryChooser is used to choose
XSLT implementations.public SnuggleEngine(TransformerFactoryChooser transformerFactoryChooser, StylesheetCache stylesheetCache)
SnuggleEngine using the given StylesheetCache
for managing stylesheets and given TransformerFactoryChooser for choosing which
XSLT implementation to use. Use this if you want to integrate XSLT caching
with your own code, want more control over how things get cached or want to control
the selection of XSLT implementations.public SnuggleEngine(StylesheetManager stylesheetManager)
SnuggleEngine using the given StylesheetManager
for managing stylesheets. Use this if you want to integrate XSLT caching
with your own code, want more control over how things get cached or want to control
the selection of XSLT implementations.public StylesheetManager getStylesheetManager()
StylesheetManager used by
this engine. Most people won't care about this, but it might be useful if you're
trying to integrate stylesheet caching.public List<SnugglePackage> getPackages()
List of all SnugglePackages registered
with this engine.public void addPackage(SnugglePackage snugglePackage)
SnugglePackage with this SnuggleEngine.
All commands, environments and error codes defined by the SnugglePackage will
then become available for use.public SnuggleSession createSession()
SnuggleSession using the default SessionConfiguration
or a fresh SessionConfiguration if no default has been set.public SnuggleSession createSession(SessionConfiguration sessionConfiguration)
SnuggleSession using the given SessionConfigurationsessionConfiguration - SessionConfiguration to use, which must not be null.public SnuggleSimpleMathRunner createSimpleMathRunner()
public SnuggleSimpleMathRunner createSimpleMathRunner(SessionConfiguration sessionConfiguration)
public BuiltinCommand getBuiltinCommandByTeXName(String texName)
BuiltinCommand corresponding to LaTeX command called
\texName, or null if this command is not defined.public BuiltinEnvironment getBuiltinEnvironmentByTeXName(String texName)
BuiltinEnvironment corresponding to LaTeX environment
called texName, or null if this environment is not defined.public SessionConfiguration getDefaultSessionConfiguration()
SessionConfiguration for this SnuggleEngine,
which will not be null.public void setDefaultSessionConfiguration(SessionConfiguration defaultSessionConfiguration)
SessionConfiguration for this SnuggleEngine.
This will be used when creating a new SnuggleSession via
createSession().defaultSessionConfiguration - new default SessionConfiguration, which
must not be null.public DOMOutputOptions getDefaultDOMOutputOptions()
DOMOutputOptions for this SnuggleEngine, which will not
be null.public void setDefaultDOMOutputOptions(DOMOutputOptions defaultDOMOutputOptions)
DOMOutputOptions for this SnuggleEngine. These
will be used when calling SnuggleSession.buildDOMSubtree().defaultDOMOutputOptions - new DOMOutputOptions, which must not be null.public XMLStringOutputOptions getDefaultXMLStringOutputOptions()
XMLStringOutputOptions for this SnuggleEngine, which
will not be null.public void setDefaultXMLStringOutputOptions(XMLStringOutputOptions defaultXMLOutputOptions)
XMLStringOutputOptions for this SnuggleEngine.
These will be used when calling SnuggleSession.buildXMLString().defaultXMLOutputOptions - new XMLStringOutputOptions, which must not be null.@Deprecated public DOMOutputOptions getDefaultDOMOptions()
getDefaultDOMOutputOptions()@Deprecated public void setDefaultDOMOptions(DOMOutputOptions defaultDOMOptions)
setDefaultDOMOutputOptions(DOMOutputOptions)Copyright © 2008–2026 The University of Edinburgh. All rights reserved.