Package uk.ac.starlink.vo

## Class DaliExampleReader

- java.lang.Object
- - uk.ac.starlink.vo.DaliExampleReader

-     public class DaliExampleReader
      extends java.lang.Object

  Extracts DaliExample objects from a document. The document is probably XHTML with RDFa markup.

  Instances of this class are not thread-safe.

  Since:
    12 May 2015
  Author:
    Mark Taylor
  See Also:
    DALI v1.0 sec 2.3

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `DaliExampleReader()` | Constructor.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `DaliExample` | `createExample​(org.w3c.dom.Element exEl, java.net.URL docUrl)` | Creates an example from a given DOM element.
    `static void` | `main​(java.lang.String[] args)` | Reports basic information about the examples in a document at a URL supplied on the command line.
    `DaliExample[]` | `readExamples​(java.net.URL url)` | Reads a list of examples from a document at a given URL.

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

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

- - ### Constructor Detail

    - #### DaliExampleReader

          public DaliExampleReader()

      Constructor.

  - ### Method Detail

    - #### readExamples

          public DaliExample[] readExamples​(java.net.URL url)
                                     throws java.io.IOException

      Reads a list of examples from a document at a given URL. Any fragment identifier on the URL is ignored.
      Parameters:
        `url` - location of examples document
      Returns:
        list of examples
      Throws:
        `java.io.IOException`

    - #### createExample

          public DaliExample createExample​(org.w3c.dom.Element exEl,
                                           java.net.URL docUrl)
                                    throws java.io.IOException

      Creates an example from a given DOM element.
      Parameters:
        `exEl` - element node with DALI RDFa example content
        `docUrl` - base URL of host document
      Returns:
        example object
      Throws:
        `java.io.IOException`

    - #### main

          public static void main​(java.lang.String[] args)
                           throws java.io.IOException

      Reports basic information about the examples in a document at a URL supplied on the command line.
      Throws:
        `java.io.IOException`