Class XmlExporter

java.lang.Object
org.harctoolbox.girr.XmlExporter
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
Command, CommandSet, Remote, RemoteSet

public abstract class XmlExporter extends Object implements Serializable
Abstract base class for Girr classes exporting XML.
See Also:
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected static Element
    Returns the root element of the first argument, which is supposed to be a valid XML document.
    protected static Element
    getElement(File file, Schema schema)
    Returns the root element of the first argument, which is supposed to be a valid XML document.
    protected static Element
    Returns the root element of the first argument, which is supposed to read to a valid XML document.
    protected static Element
    getElement(Reader reader, Schema schema)
    Returns the root element of the first argument, which is supposed to read to a valid XML document.
    protected static Element
    Returns the root element of the first argument, which is supposed to be a valid XML document.
    protected static Element
    getElement(String file, Schema schema)
    Returns the root element of the first argument, which is supposed to be a valid XML document.
    protected static Element
    getElement(Document document)
    Returns the root element of the first argument, which is supposed to be a valid XML Document.
    final void
    print(File file)
    Convenience function that generates a DOM and dumps it onto the argument.
    final void
    print(File file, boolean generateProtocol, boolean generateProntoHex, boolean generateRaw)
    Convenience function that generates a DOM and dumps it onto the argument.
    final void
    print(OutputStream ostr, boolean generateProtocol, boolean generateProntoHex, boolean generateRaw)
    Convenience function that generates a DOM and dumps it onto the argument.
    final void
    print(String file)
    Convenience function that generates a DOM and dumps it onto the argument.
    final void
    print(String file, boolean generateProtocol, boolean generateProntoHex, boolean generateRaw)
    Convenience function that generates a DOM and dumps it onto the argument.
    final Document
    toDocument(String title, boolean fatRaw, boolean generateParameters, boolean generateProntoHex, boolean generateRaw)
    Generates an XML Document from a RemoteSet.
    (package private) abstract Element
    toElement(Document doc, boolean fatRaw, boolean generateParameters, boolean generateProntoHex, boolean generateRaw)
    Exports the Object to an Element.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • XmlExporter

      protected XmlExporter()
  • Method Details

    • getElement

      protected static Element getElement(File file, Schema schema) throws IOException, SAXException
      Returns the root element of the first argument, which is supposed to be a valid XML document.
      Parameters:
      file -
      schema -
      Returns:
      Throws:
      IOException
      SAXException
    • getElement

      protected static Element getElement(File file) throws IOException, SAXException
      Returns the root element of the first argument, which is supposed to be a valid XML document.
      Parameters:
      file -
      Returns:
      Throws:
      IOException
      SAXException
    • getElement

      protected static Element getElement(String file, Schema schema) throws IOException, SAXException
      Returns the root element of the first argument, which is supposed to be a valid XML document.
      Parameters:
      file -
      schema -
      Returns:
      Throws:
      IOException
      SAXException
    • getElement

      protected static Element getElement(String file) throws IOException, SAXException
      Returns the root element of the first argument, which is supposed to be a valid XML document.
      Parameters:
      file -
      Returns:
      Throws:
      IOException
      SAXException
    • getElement

      protected static Element getElement(Reader reader, Schema schema) throws IOException, SAXException
      Returns the root element of the first argument, which is supposed to read to a valid XML document.
      Parameters:
      reader -
      schema -
      Returns:
      Throws:
      IOException
      SAXException
    • getElement

      protected static Element getElement(Reader reader) throws IOException, SAXException
      Returns the root element of the first argument, which is supposed to read to a valid XML document.
      Parameters:
      reader -
      Returns:
      Throws:
      IOException
      SAXException
    • getElement

      protected static Element getElement(Document document)
      Returns the root element of the first argument, which is supposed to be a valid XML Document.
      Parameters:
      document -
      Returns:
    • print

      public final void print(OutputStream ostr, boolean generateProtocol, boolean generateProntoHex, boolean generateRaw)
      Convenience function that generates a DOM and dumps it onto the argument.
      Parameters:
      ostr -
      generateProtocol -
      generateProntoHex -
      generateRaw -
    • print

      public final void print(String file, boolean generateProtocol, boolean generateProntoHex, boolean generateRaw) throws IOException
      Convenience function that generates a DOM and dumps it onto the argument.
      Parameters:
      file -
      generateProtocol -
      generateProntoHex -
      generateRaw -
      Throws:
      IOException
    • print

      public final void print(String file) throws IOException
      Convenience function that generates a DOM and dumps it onto the argument.
      Parameters:
      file -
      Throws:
      IOException
    • print

      public final void print(File file, boolean generateProtocol, boolean generateProntoHex, boolean generateRaw) throws IOException
      Convenience function that generates a DOM and dumps it onto the argument.
      Parameters:
      file -
      generateProtocol -
      generateProntoHex -
      generateRaw -
      Throws:
      IOException
    • print

      public final void print(File file) throws IOException
      Convenience function that generates a DOM and dumps it onto the argument.
      Parameters:
      file -
      Throws:
      IOException
    • toDocument

      public final Document toDocument(String title, boolean fatRaw, boolean generateParameters, boolean generateProntoHex, boolean generateRaw)
      Generates an XML Document from a RemoteSet.
      Parameters:
      title - Textual title of document.
      fatRaw - For the raw form, generate elements for each flash and gap, otherwise a long PCDATA text string of durations will be generated.
      generateParameters - If true, the protocol/parameter description will be generated.
      generateProntoHex - If true, the Pronto hex form will be generated.
      generateRaw - If true, the raw form will be generated.
      Returns:
      W3C Document
    • toElement

      abstract Element toElement(Document doc, boolean fatRaw, boolean generateParameters, boolean generateProntoHex, boolean generateRaw)
      Exports the Object to an Element.
      Parameters:
      doc - Owner Document.
      fatRaw - If generating the raw form, generate it in the so-called fat form, with one element per duration.
      generateParameters - If true, generate the parameter form.
      generateProntoHex - If true, generate the Pronto Hex form.
      generateRaw - If true, generate the raw form.
      Returns:
      newly constructed element, belonging to the doc Document.