org.cishell.service.conversion
Interface Converter


public interface Converter

A class for converting Data objects

Author:
Bruce Herr (bh2@bh2.net)

Method Summary
 Data convert(Data data)
          Uses this Converter to convert the given Data object to a new format.
 AlgorithmFactory getAlgorithmFactory()
          Returns the AlgorithmFactory that can be invoked to convert a given Data object of the correct input format (as specified in the Dictionary from getProperties()) to a Data object of the correct output format
 ServiceReference[] getConverterChain()
          Returns an array of ServiceReferences to converter algorithms in the order in which they will be called when converting a Data object
 Dictionary getProperties()
          Get properties of the Converter (same as algorithm service properties).
 

Method Detail

getConverterChain

ServiceReference[] getConverterChain()
Returns an array of ServiceReferences to converter algorithms in the order in which they will be called when converting a Data object

Returns:
An array of ServiceReferences to converter algorithms to be used

getAlgorithmFactory

AlgorithmFactory getAlgorithmFactory()
Returns the AlgorithmFactory that can be invoked to convert a given Data object of the correct input format (as specified in the Dictionary from getProperties()) to a Data object of the correct output format

Returns:
The AlgorithmFactory to do the converting

getProperties

Dictionary getProperties()
Get properties of the Converter (same as algorithm service properties). It is a set of properties that correspond to the AlgorithmPropertys properties. The IN_DATA and OUT_DATA properties are guaranteed to be set in this Dictionary.

Returns:
A set of properties describing the converter (including its in and out data)

convert

Data convert(Data data)
             throws ConversionException
Uses this Converter to convert the given Data object to a new format. This is a convenience method that uses this Converter to convert a Data object of the corrent format to a Data object of the defined output format.

Parameters:
data - The Data object with compatible format
Returns:
A Data object of correct output format
Throws:
ConversionException - If the data conversion fails while converting