SnuggleEngine#createSession(), optionally passing
configuration details for this session.
parseInput(SnuggleInput) on one or more input documents to tokenise and
fix-up the LaTeX contained therein.
getErrors() to get at the errors that have arisen during this session.
createSnapshot() at any time to make a "snapshot" of the current state for
later reuse.
| Modifier and Type | Class and Description |
|---|---|
| public static enum | SnuggleSession.
Trivial enumeration which specifies the possible actions to perform once we
finish writing with the various |
| Modifier and Type | Field and Description |
|---|---|
| private final SessionConfiguration | configuration
Configuration for this session |
| pack-priv final DOMOutputOptions | defaultDOMOutputOptions
Default |
| pack-priv final XMLStringOutputOptions | defaultXMLStringOutputOptions
Default |
| private final SnuggleEngine | engine
Engine that created this Session |
| private final List | errors
Errors accumulated during this session |
| private final SnugglePackage[] | packages
Copy of the List of all currently registered |
| private final List | parsedTokens
All tokens currently completely parsed (and fixed) by this session |
| private final StyleEvaluator | |
| private final StyleRebuilder | |
| private final TokenFixer | tokenFixer
|
| private final LaTeXTokeniser | tokeniser
|
| private final Map | userCommandMap
Map of user-defined commands, keyed on name |
| private final Map | userEnvironmentMap
Map of user-defined environments, keyed on name |
| Access | Constructor and Description |
|---|---|
| pack-priv | SnuggleSession(final SnuggleEngine engine, final SessionConfiguration configuration)
(This package-private constructor is used when creating a new session via
|
| pack-priv | SnuggleSession(final SnuggleSnapshot snapshot)
(This package-private constructor is used when creating a session from an existing
|
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if completed successfully, false if the process was terminated by an error in the input LaTeX and if the session was configured to fail on the first error.Builds a DOM sub-tree based on the currently parsed tokens, appending the results as children of the given target root Element. |
| public boolean | Returns: true if completed successfully, false if the process was terminated by an error in the input LaTeX and if the session was configured to fail on the first error.Builds a DOM sub-tree based on the currently parsed tokens, appending the results as children of the given target root Element. |
| public NodeList | Returns: resultingNodeList if the process completed successfully, null if the process was
terminated by an error in the input LaTeX and if the session was configured to fail on
the first error.Convenience method to build a DOM |
| public NodeList | Returns: resultingNodeList if the process completed successfully, null if the process was
terminated by an error in the input LaTeX and if the session was configured to fail on
the first error.DOMOutputOptions to use, which must not be nullConvenience method to build a DOM |
| public Document | Returns: resulting Document if the process completed successfully, null if the process was terminated by an error in the input LaTeX and if the session was configured to fail on the first error.Builds a complete web page based on the currently parsed tokens, returning a DOM
|
| public String | Returns: resulting Document if the process completed successfully, null if the process was terminated by an error in the input LaTeX and if the session was configured to fail on the first error.Builds a complete web page based on the currently parsed tokens, returning a String containing the resulting content. |
| public String | Returns: resulting XML if the process completed successfully, null if the process was terminated by an error in the input LaTeX and if the session was configured to fail on the first error.Creates a well-formed external general parsed entity out of the currently parsed tokens. |
| public String | Returns: resulting XML if the process completed successfully, null if the process was terminated by an error in the input LaTeX and if the session was configured to fail on the first error.XMLStringOutputOptions to use, which must not be null.Creates a well-formed external general parsed entity out of the currently parsed tokens. |
| public String | Returns: resulting XML if the process completed successfully, null if the process was terminated by an error in the input LaTeX and if the session was configured to fail on the first error.whether to indent the resulting XML or not indent)
Deprecated
Use
buildXMLString(XMLStringOutputOptions) instead
Convenience method to create a well-formed external general parsed entity out of the currently parsed tokens. |
| public String | Returns: resulting XML if the process completed successfully, null if the process was terminated by an error in the input LaTeX and if the session was configured to fail on the first error.
Deprecated
Use
buildXMLString(XMLStringOutputOptions) instead.
Convenience method to create a well-formed external general parsed entity out of the currently parsed tokens. |
| public String | Returns: resulting XML if the process completed successfully, null if the process was terminated by an error in the input LaTeX and if the session was configured to fail on the first error.whether to indent the resulting XML or not indent)
Deprecated
Use
buildXMLString(XMLStringOutputOptions) instead.
Convenience method to create a well-formed external general parsed entity out of the currently parsed tokens. |
| public SnuggleSnapshot | createSnapshot()
Creates a |
| public Document | createWebPage(final WebPageOutputOptions options)
Deprecated
For naming consistency, please use |
| public BuiltinCommand | getBuiltinCommandByTeXName(String texName)
Implements uk. Returns the |
| public BuiltinEnvironment | getBuiltinEnvironmentByTeXName(String texName)
Implements uk. Returns the |
| public SessionConfiguration | |
| public List | |
| public MathCharacter | getMathCharacter(int codePoint)
Implements uk.
|
| public List | |
| public StylesheetManager | getStylesheetManager()
Implements uk. Gets the |
| public Map | getUserCommandMap()
Implements uk. Gets the |
| public Map | getUserEnvironmentMap()
Implements uk. Gets the |
| public boolean | Returns: true if parsing finished, false if it was terminated by an error in the input LaTeX and if the session was configured to fail on the first error.input to parse, which must not be null snuggleInput)Parses the data contained within the given |
| public void | registerError(InputError
InputError to register, which must not be null.Implements uk. Records a new error, throwing a |
| public void | |
| public void | setWebPageContentType(final WebPageOutputOptions options, final Object contentTypeSettable)
Calls the setContentType of the given Object to something appropriate for the
given |
| public boolean | Returns: true if completed successfully, false if the process was terminated by an error in the input LaTeX and if the session was configured to fail on the first error.Builds a complete web page based on the currently parsed tokens, sending the results
to the given |
| public boolean | Returns: true if completed successfully, false if the process was terminated by an error in the input LaTeX and if the session was configured to fail on the first error.Builds a complete web page based on the currently parsed tokens, sending the results
to the given |
| public boolean | Returns: true if completed successfully, false if the process was terminated by an error in the input LaTeX and if the session was configured to fail on the first error.Builds a complete web page based on the currently parsed tokens, sending the results
to the given |
| public boolean | Returns: true if completed successfully, false if the process was terminated by an error in the input LaTeX and if the session was configured to fail on the first error.Builds a complete web page based on the currently parsed tokens, sending the results
to the given |
| configuration | back to summary |
|---|---|
| private final SessionConfiguration configuration Configuration for this session | |
| defaultDOMOutputOptions | back to summary |
|---|---|
| pack-priv final DOMOutputOptions defaultDOMOutputOptions Default | |
| defaultXMLStringOutputOptions | back to summary |
|---|---|
| pack-priv final XMLStringOutputOptions defaultXMLStringOutputOptions Default | |
| engine | back to summary |
|---|---|
| private final SnuggleEngine engine Engine that created this Session | |
| errors | back to summary |
|---|---|
| private final List<InputError> errors Errors accumulated during this session | |
| packages | back to summary |
|---|---|
| private final SnugglePackage[] packages Copy of the List of all currently registered | |
| parsedTokens | back to summary |
|---|---|
| private final List<FlowToken> parsedTokens All tokens currently completely parsed (and fixed) by this session | |
| styleEvaluator | back to summary |
|---|---|
| private final StyleEvaluator styleEvaluator | |
| styleRebuilder | back to summary |
|---|---|
| private final StyleRebuilder styleRebuilder | |
| tokenFixer | back to summary |
|---|---|
| private final TokenFixer tokenFixer
| |
| tokeniser | back to summary |
|---|---|
| private final LaTeXTokeniser tokeniser
| |
| userCommandMap | back to summary |
|---|---|
| private final Map<String, UserDefinedCommand> userCommandMap Map of user-defined commands, keyed on name | |
| userEnvironmentMap | back to summary |
|---|---|
| private final Map<String, UserDefinedEnvironment> userEnvironmentMap Map of user-defined environments, keyed on name | |
| SnuggleSession | back to summary |
|---|---|
| pack-priv SnuggleSession(final SnuggleEngine engine, final SessionConfiguration configuration) (This package-private constructor is used when creating a new session via
| |
| SnuggleSession | back to summary |
|---|---|
| pack-priv SnuggleSession(final SnuggleSnapshot snapshot) (This package-private constructor is used when creating a session from an existing
| |
| buildDOMSubtree | back to summary |
|---|---|
| public boolean buildDOMSubtree(final Element targetRoot, final DOMOutputOptions options) Builds a DOM sub-tree based on the currently parsed tokens, appending the results as
children of the given target root Element. The given
If the
| |
| buildDOMSubtree | back to summary |
|---|---|
| public boolean buildDOMSubtree(final Element targetRoot) Builds a DOM sub-tree based on the currently parsed tokens, appending the results as
children of the given target root Element. This uses the default
| |
| buildDOMSubtree | back to summary |
|---|---|
| public NodeList buildDOMSubtree() Convenience method to build a DOM
The default | |
| buildDOMSubtree | back to summary |
|---|---|
| public NodeList buildDOMSubtree(final DOMOutputOptions options) Convenience method to build a DOM
The given
| |
| buildWebPage | back to summary |
|---|---|
| public Document buildWebPage(final WebPageOutputOptions options) Builds a complete web page based on the currently parsed tokens, returning a DOM
The provided
Any XSLT stylesheet specified by
| |
| buildWebPageString | back to summary |
|---|---|
| public String buildWebPageString(final WebPageOutputOptions options) Builds a complete web page based on the currently parsed tokens, returning a String
containing the resulting content. This is a convenience method; using
The provided
Any XSLT stylesheet specified by
| |
| buildXMLString | back to summary |
|---|---|
| public String buildXMLString() Creates a well-formed external general parsed entity out of the currently parsed tokens.
The default
| |
| buildXMLString | back to summary |
|---|---|
| public String buildXMLString(final XMLStringOutputOptions options) Creates a well-formed external general parsed entity out of the currently parsed tokens.
The given
| |
| buildXMLString | back to summary |
|---|---|
| public String buildXMLString(boolean indent)
Deprecated Use Convenience method to create a well-formed external general parsed entity out of the currently parsed tokens.
The default
| |
| buildXMLString | back to summary |
|---|---|
| public String buildXMLString(final DOMOutputOptions options)
Deprecated Use Convenience method to create a well-formed external general parsed entity out of the currently parsed tokens.
The given
| |
| buildXMLString | back to summary |
|---|---|
| public String buildXMLString(final DOMOutputOptions options, final boolean indent)
Deprecated Use Convenience method to create a well-formed external general parsed entity out of the currently parsed tokens.
The given
| |
| createSnapshot | back to summary |
|---|---|
| public SnuggleSnapshot createSnapshot() Creates a | |
| createWebPage | back to summary |
|---|---|
| public Document createWebPage(final WebPageOutputOptions options)
Deprecated
For naming consistency, please use
| |
| getBuiltinCommandByTeXName | back to summary |
|---|---|
| public BuiltinCommand getBuiltinCommandByTeXName(String texName) Implements uk. Returns the | |
| getBuiltinEnvironmentByTeXName | back to summary |
|---|---|
| public BuiltinEnvironment getBuiltinEnvironmentByTeXName(String texName) Implements uk. Returns the | |
| getConfiguration | back to summary |
|---|---|
| public SessionConfiguration getConfiguration() Implements uk. | |
| getErrors | back to summary |
|---|---|
| public List Implements uk. | |
| getMathCharacter | back to summary |
|---|---|
| public MathCharacter getMathCharacter(int codePoint) Implements uk. | |
| getParsedTokens | back to summary |
|---|---|
| public List | |
| getStylesheetManager | back to summary |
|---|---|
| public StylesheetManager getStylesheetManager() Implements uk. Gets the | |
| getUserCommandMap | back to summary |
|---|---|
| public Map Implements uk. Gets the | |
| getUserEnvironmentMap | back to summary |
|---|---|
| public Map Implements uk. Gets the | |
| parseInput | back to summary |
|---|---|
| public boolean parseInput(SnuggleInput snuggleInput) throws IOException Parses the data contained within the given
| |
| registerError | back to summary |
|---|---|
| public void registerError(InputError inputError) throws SnuggleParseException Implements uk. Records a new error, throwing a
| |
| reset | back to summary |
|---|---|
| public void reset() Resets this | |
| setWebPageContentType | back to summary |
|---|---|
| public void setWebPageContentType(final WebPageOutputOptions options, final Object contentTypeSettable) Calls the setContentType of the given Object to something appropriate for the
given The main example for this would be passing a javax.servlet.http.HttpResponse Object, which I want to avoid a compile-time dependency on. | |
| writeWebPage | back to summary |
|---|---|
| public boolean writeWebPage(final WebPageOutputOptions options, final OutputStream outputStream) throws IOException Builds a complete web page based on the currently parsed tokens, sending the results
to the given
The provided
| |
| writeWebPage | back to summary |
|---|---|
| public boolean writeWebPage(final WebPageOutputOptions options, final OutputStream outputStream, final SnuggleSession. Builds a complete web page based on the currently parsed tokens, sending the results
to the given
The provided
| |
| writeWebPage | back to summary |
|---|---|
| public boolean writeWebPage(final WebPageOutputOptions options, final Object contentTypeSettable, final OutputStream outputStream) throws IOException Builds a complete web page based on the currently parsed tokens, sending the results
to the given
The provided If the contentTypeSettable Object has a property called contentType, then it is set in advance to the appropriate HTTP Content-Type header for the resulting page before the web page data is written.
| |
| writeWebPage | back to summary |
|---|---|
| public boolean writeWebPage(final WebPageOutputOptions options, final Object contentTypeSettable, final OutputStream outputStream, final SnuggleSession. Builds a complete web page based on the currently parsed tokens, sending the results
to the given
The provided If the contentTypeSettable Object has a property called contentType, then it is set in advance to the appropriate HTTP Content-Type header for the resulting page before the web page data is written.
| |
SnuggleSession#writeWebPage(WebPageOutputOptions, OutputStream)
methods.
| Modifier and Type | Field and Description |
|---|---|
| public static final SnuggleSession. | CLOSE
Closes the |
| public static final SnuggleSession. | DO_NOTHING
Does nothing after writing |
| public static final SnuggleSession. | FLUSH
Flushes the |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static SnuggleSession. | |
| public static SnuggleSession. |
| CLOSE | back to summary |
|---|---|
| public static final SnuggleSession. Closes the | |
| DO_NOTHING | back to summary |
|---|---|
| public static final SnuggleSession. Does nothing after writing | |
| FLUSH | back to summary |
|---|---|
| public static final SnuggleSession. Flushes the | |
| EndOutputAction | back to summary |
|---|---|
| private EndOutputAction() | |
| valueOf | back to summary |
|---|---|
| public static SnuggleSession. | |
| values | back to summary |
|---|---|
| public static SnuggleSession. | |