com.ddtek.xmlconverter
Interface XHTMLGenerator


public interface XHTMLGenerator

An XHTMLGenerator is used to create XHTML documentation from a message definition.

The XHTMLGenerator is created from a ConverterFactory using ConverterFactory.newXHTMLGenerator.

Sometimes, an XHTMLGenerator will need an instance of the native data file to create the correct XHTML program, so all the methods in XHTMLGenerator come in pairs. One of the methods has a Source parameter to provide the native data file while the other method of the pair has no Source parameter and is used when no native data file is required. The caller can determine whether a Source parameter is needed with the requiresSource() method.


Method Summary
 Configuration getConfiguration()
          Get the Configuration object for this XHTMLGenerator.
 SAXSource getSAXSource()
          Create XHTML documentation and make it available as a SAXSource.
 SAXSource getSAXSource(Source source)
          Create XHTML documentation and make it available as a SAXSource.
 void getXHTML(Result result)
          Create XHTML documentation and write it to the specified result object.
 void getXHTML(Source source, Result result)
          Create XHTML documentation and write it to the specified result object.
 javax.xml.stream.XMLStreamReader getXMLStreamReader()
          Create XHTML documentation and make it available as an XMLStreamReader.
 javax.xml.stream.XMLStreamReader getXMLStreamReader(Source source)
          Create an XHTML documentation and make it available as an XMLStreamReader.
 boolean requiresSource()
          Determine whether this XHTMLGenerator will require an instance of the native data file to generate the XHTML documentation.
 

Method Detail

getXHTML

void getXHTML(Result result)
              throws ConverterException
Create XHTML documentation and write it to the specified result object. This method should be used if the native data file is not needed to generate the XHTML output.

Parameters:
result - Specifies where the created XHTML documentation should be written.
Throws:
ConverterException

getXHTML

void getXHTML(Source source,
              Result result)
              throws ConverterException
Create XHTML documentation and write it to the specified result object. This method should be used if an instance of the native data file is needed to generate the XHTML documentation.

Parameters:
source - A Source object which specifies an instance of the native data file.
result - Specifies where the created XHTML documentation should be written.
Throws:
ConverterException

getSAXSource

SAXSource getSAXSource()
                       throws ConverterException
Create XHTML documentation and make it available as a SAXSource. This method should be used if the native data file is not needed to generate the XHTML documentation.

Returns:
A SAXSource which can be used to access the resulting XHTML documentation. This SAXSource can be used as input to a Transformer or other XML processor.
Throws:
ConverterException

getSAXSource

SAXSource getSAXSource(Source source)
                       throws ConverterException
Create XHTML documentation and make it available as a SAXSource. This method should be used if an instance of the native data file is needed to generate the XHTML documentation.

Parameters:
source - A Source object which specifies an instance of the native data file.
Returns:
A SAXSource which can be used to access the resulting XHTML documentation. This SAXSource can be used as input to a Transformer or other XML processor.
Throws:
ConverterException

getXMLStreamReader

javax.xml.stream.XMLStreamReader getXMLStreamReader()
                                                    throws javax.xml.stream.XMLStreamException
Create XHTML documentation and make it available as an XMLStreamReader. This method should be used if the native data file is not needed to generate the XHTML documentation.

Returns:
An XMLStreamReader which can be used to read the generated XHTML documentation.
Throws:
javax.xml.stream.XMLStreamException

getXMLStreamReader

javax.xml.stream.XMLStreamReader getXMLStreamReader(Source source)
                                                    throws javax.xml.stream.XMLStreamException
Create an XHTML documentation and make it available as an XMLStreamReader. This method should be used if an instance of the native data file is needed to generate the XHTML documentation.

Parameters:
source - A Source object which specifies an instance of the native data file.
Returns:
An XMLStreamReader which can be used to read the generated XHTML documentation.
Throws:
javax.xml.stream.XMLStreamException

requiresSource

boolean requiresSource()
                       throws ConverterException
Determine whether this XHTMLGenerator will require an instance of the native data file to generate the XHTML documentation.

If this method returns true, then the caller should use the getXHTML(Source, Result) method which uses a source object.

If this method returns false, then the caller can use either one of the above methods, or can instead use the getXHTML(Result) method which does not use a source object. Some converters, such as EDI, will take settings from the source object to set their values, and allow them to be augmented by URI parameters. In those cases, it can be useful to specify a source object. There is never harm in specifying a source object; at the very worst, if it is not necessary it will be silently ignored.

Returns:
A boolean indicating whether a Source object is required to generate the XHTML documentation.
Throws:
ConverterException

getConfiguration

Configuration getConfiguration()
Get the Configuration object for this XHTMLGenerator. The caller can modify the returned Configuration object. Any changes affect subsequent operations done with this XHTMLGenerator object.

Returns:
The XHTMLGenerator's Configuration object.