com.io7m.jstructural.xom

## Class SDocumentParser

- java.lang.Object
- - com.io7m.jstructural.xom.SDocumentParser

-     public final class SDocumentParser
      extends Object

  A document parser that uses XOM to process documents.

  Note: This is not a public API and is subject to change without warning.

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static SDocument` | `fromStream(InputStream stream, URI uri, com.io7m.jlog.LogUsableType log)` Parse a document from a validated stream.
    `static SImage` | `image(nu.xom.Element ec)` Parse an image element.
    `static SLink` | `link(nu.xom.Element ec)` Parse a link element.
    `static SLinkExternal` | `linkExternal(nu.xom.Element ec)` Parse an external link.
    `static SParagraph` | `paragraph(com.io7m.jlog.LogUsableType log, nu.xom.Element e)` Parse a paragraph element.
    `static STerm` | `term(nu.xom.Element ec)` Parse a term element.
    `static SVerbatim` | `verbatim(nu.xom.Element ec)` Parse a verbatim element.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### fromStream

          public static SDocument fromStream(InputStream stream,
                                             URI uri,
                                             com.io7m.jlog.LogUsableType log)
                                      throws nu.xom.ValidityException,
                                             SAXException,
                                             ParserConfigurationException,
                                             nu.xom.ParsingException,
                                             IOException,
                                             URISyntaxException,
                                             nu.xom.xinclude.BadParseAttributeException,
                                             nu.xom.xinclude.InclusionLoopException,
                                             nu.xom.xinclude.NoIncludeLocationException,
                                             nu.xom.xinclude.XIncludeException

      Parse a document from a validated stream.
      Parameters:
        `uri` - The base URI of the document
        `stream` - The stream
        `log` - A log handle
      Returns:
        A document
      Throws:
        `SAXException` - On XML parse errors
        `ParserConfigurationException` - On parser configuration errors
        `nu.xom.ValidityException` - On XML validation errors
        `nu.xom.ParsingException` - On parser errors
        `IOException` - On I/O errors
        `URISyntaxException` - On failing to parse a URI
        `nu.xom.xinclude.XIncludeException` - If an xinclude fails
        `nu.xom.xinclude.NoIncludeLocationException` - If an xinclude fails
        `nu.xom.xinclude.InclusionLoopException` - If an xinclude fails
        `nu.xom.xinclude.BadParseAttributeException` - If an xinclude fails

    - #### image

          public static SImage image(nu.xom.Element ec)
                              throws URISyntaxException

      Parse an image element.
      Parameters:
        `ec` - The raw element
      Returns:
        An image element
      Throws:
        `URISyntaxException` - On malformed URIs

    - #### link

          public static SLink link(nu.xom.Element ec)
                            throws URISyntaxException

      Parse a link element.
      Parameters:
        `ec` - The raw element
      Returns:
        A link element
      Throws:
        `URISyntaxException` - On malformed URIs

    - #### linkExternal

          public static SLinkExternal linkExternal(nu.xom.Element ec)
                                            throws URISyntaxException

      Parse an external link.
      Parameters:
        `ec` - The raw element
      Returns:
        An external link
      Throws:
        `URISyntaxException` - On malformed URIs

    - #### paragraph

          public static SParagraph paragraph(com.io7m.jlog.LogUsableType log,
                                             nu.xom.Element e)
                                      throws URISyntaxException

      Parse a paragraph element.
      Parameters:
        `log` - A log handle
        `e` - The raw element
      Returns:
        A paragraph element
      Throws:
        `URISyntaxException` - On malformed URIs

    - #### term

          public static STerm term(nu.xom.Element ec)

      Parse a term element.
      Parameters:
        `ec` - The raw element
      Returns:
        A term element

    - #### verbatim

          public static SVerbatim verbatim(nu.xom.Element ec)

      Parse a verbatim element.
      Parameters:
        `ec` - The raw element
      Returns:
        A verbatim element

Copyright © 2015 <code@io7m.com> http://io7m.com