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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static ElementgetElement(File file) Returns the root element of the first argument, which is supposed to be a valid XML document.protected static ElementgetElement(File file, Schema schema) Returns the root element of the first argument, which is supposed to be a valid XML document.protected static ElementgetElement(Reader reader) Returns the root element of the first argument, which is supposed to read to a valid XML document.protected static ElementgetElement(Reader reader, Schema schema) Returns the root element of the first argument, which is supposed to read to a valid XML document.protected static ElementgetElement(String file) Returns the root element of the first argument, which is supposed to be a valid XML document.protected static ElementgetElement(String file, Schema schema) Returns the root element of the first argument, which is supposed to be a valid XML document.protected static ElementgetElement(Document document) Returns the root element of the first argument, which is supposed to be a valid XML Document.final voidConvenience function that generates a DOM and dumps it onto the argument.final voidConvenience function that generates a DOM and dumps it onto the argument.final voidprint(OutputStream ostr, boolean generateProtocol, boolean generateProntoHex, boolean generateRaw) Convenience function that generates a DOM and dumps it onto the argument.final voidConvenience function that generates a DOM and dumps it onto the argument.final voidConvenience function that generates a DOM and dumps it onto the argument.final DocumenttoDocument(String title, boolean fatRaw, boolean generateParameters, boolean generateProntoHex, boolean generateRaw) Generates an XML Document from a RemoteSet.(package private) abstract ElementtoElement(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:
IOExceptionSAXException
-
getElement
Returns the root element of the first argument, which is supposed to be a valid XML document.- Parameters:
file-- Returns:
- Throws:
IOExceptionSAXException
-
getElement
Returns the root element of the first argument, which is supposed to be a valid XML document.- Parameters:
file-schema-- Returns:
- Throws:
IOExceptionSAXException
-
getElement
Returns the root element of the first argument, which is supposed to be a valid XML document.- Parameters:
file-- Returns:
- Throws:
IOExceptionSAXException
-
getElement
Returns the root element of the first argument, which is supposed to read to a valid XML document.- Parameters:
reader-schema-- Returns:
- Throws:
IOExceptionSAXException
-
getElement
Returns the root element of the first argument, which is supposed to read to a valid XML document.- Parameters:
reader-- Returns:
- Throws:
IOExceptionSAXException
-
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.
-