Package org.harctoolbox.girr
Class XmlExporter
java.lang.Object
org.harctoolbox.girr.XmlExporter
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
Command
,CommandSet
,Remote
,RemoteSet
Abstract base class for Girr classes exporting XML.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static Element
getElement
(File file) 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
getElement
(Reader reader) 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
getElement
(String file) 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
Convenience function that generates a DOM and dumps it onto the argument.final void
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
Convenience function that generates a DOM and dumps it onto the argument.final void
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.
-
Constructor Details
-
XmlExporter
protected XmlExporter()
-
-
Method Details
-
getElement
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
Returns the root element of the first argument, which is supposed to be a valid XML document.- Parameters:
file
-- Returns:
- Throws:
IOException
SAXException
-
getElement
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
Returns the root element of the first argument, which is supposed to be a valid XML document.- Parameters:
file
-- Returns:
- Throws:
IOException
SAXException
-
getElement
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
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
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
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
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.
-