Interface ITranslator

All Known Implementing Classes:
AbstractTranslator, JenaTranslator

public interface ITranslator

This is the interface that must be implemented by all translators in order to function with SWeDE's translation extension point. The default implementation, which is intended to be subclassed is AbstractTranslator.


Method Summary
 String doTranslation(File inputFile, OutputStream outputStream, String inputFormatExtension, String outputFormatExtension)
          This is the method that is invoked to perform a translation.

Method Detail


public String doTranslation(File inputFile,
                            OutputStream outputStream,
                            String inputFormatExtension,
                            String outputFormatExtension)
                     throws Exception
This is the method that is invoked to perform a translation.

The inputFile is a that represents the source of the translation, and it is encoded in the format specified by the string inputFormatExtension. Similiarly, the ouputStream is the resource to which translation results should be written in the format specified by outputFormatExtension. These format strings will be the case-sensitive extensions of the resources to be translated, and are to be specified by translator implementers in their plugin.xml files. For an example of an implemented translator, which is derived from AbstractTranslator, see JenaTranslator.

inputFile - the file where the source content resides
outputStream - the stream to which the translation results should be output
inputFormatExtension - the extension identifying the input content
outputFormatExtension - the extension identifying the output content
null if translation completed successfully, otherwise an error message describing the problem
Exception - if an error occurs during translation
See Also:
AbstractTranslator, JenaTranslator

Copyright © 2004-2005 BBN Technologies. All Rights Reserved.