com.ddtek.xmlconverter
Class Conversion

java.lang.Object
  extended by com.ddtek.xmlconverter.Conversion
All Implemented Interfaces:
ErrorListener, ErrorHandler

public abstract class Conversion
extends Object
implements ErrorHandler, ErrorListener

A Conversion object contains all the information needed during an ongoing conversion.

A conversion is initiated by creating a Converter object and then calling Converter.convert(javax.xml.transform.Source, javax.xml.transform.Result). The convert method returns a Conversion which actually controls the conversion process. In some cases, the conversion has already completed when Converter.convert returns the Conversion object; the Conversion object represents a completed conversion.

When the convert source is a OutputStreamSource, a WriterSource, or a SAXSource, the conversion will not be complete and system resources will not be released until all data has been delivered or the conversion has been cancelled. The application can

A Conversion object implements ErrorHandler and ErrorListener as follows:

Three other methods can be used to start a conversion:

These methods do not give the application program access to a Conversion object.


Constructor Summary
Conversion()
           
 
Method Summary
abstract  void cancel()
          Attempt to cancel a Conversion.
abstract  void cancel(Throwable t)
          Attempt to cancel a conversion with an exception.
abstract  ConversionStatus getConversionStatus()
          Get the current status of this Conversion.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xml.sax.ErrorHandler
error, fatalError, warning
 
Methods inherited from interface javax.xml.transform.ErrorListener
error, fatalError, warning
 

Constructor Detail

Conversion

public Conversion()
Method Detail

getConversionStatus

public abstract ConversionStatus getConversionStatus()
Get the current status of this Conversion.

Returns:
The ConversionStatus for this Conversion.

cancel

public abstract void cancel()
Attempt to cancel a Conversion. If the conversion has already finished, this call has no effect. Otherwise, this cancels the conversion and releases system resources such as open file handles.
This method is useful if the conversion source is a SAXSource, OutputStreamSource, or a WriterSource, and the application cannot or does not want to close the source normally. In this case, the application should call cancel() to make sure system resources are released. In addition to cancelling the Conversion, this method attempts to throw an appropriate exception to the conversion data source and conversion data consumer.


cancel

public abstract void cancel(Throwable t)
Attempt to cancel a conversion with an exception. In addition to cancelling the Conversion, this method will throw its parameter exception (suitably wrapped) to the conversion data source and conversion data consumer.

Parameters:
t - The exception which should be associated with the cancellation.
See Also:
cancel()