org.semwebcentral.sweetrules.infrastructure
Interface ISweetTranslator

All Superinterfaces:
java.lang.Cloneable
All Known Subinterfaces:
ISweetCompositeTranslator
All Known Implementing Classes:
AbstractSweetCompositeTranslator, AbstractSweetTranslator

public interface ISweetTranslator
extends java.lang.Cloneable

A generic interface for translators to and from various Knowledge representation formats. NB: The translation is using String objects for data

Author:
Shashidhara K Ganjugunte, Dr. Benjamin Grosof, Dr. Said Tabet, Chitravanu Neogy

Method Summary
 java.lang.Object clone()
          The clone method to clone the translator
 java.lang.String getSourceData()
          Returns the source data which will be translated
 ISweetTranslatorDescriptor getTranslatorDescriptor()
          Retrievs the translator descriptor of this object
 void print()
          Utility API to print the translator information
 void setSourceData(java.lang.String sourceData)
          Set the source data to be translated
 void setSourceKBDescriptor(ISweetKBDescriptor kbDescriptor)
          Sets the source KB descriptor
 void setTargetKBDescriptor(ISweetKBDescriptor kbDescriptor)
          Sets the target KB descriptor
 void setTranslatorDescriptor(ISweetTranslatorDescriptor translatorDescriptor)
          Sets the translator descriptor for this class
 java.lang.String translate()
          Perfroms translation from the specified source format to the target format
 

Method Detail

translate

public java.lang.String translate()
                           throws SweetTranslatorException
Perfroms translation from the specified source format to the target format

Returns:
The translated string in the target format
Throws:
TranslatorException - If translation cannot be performed then an exception is thrown
SweetTranslatorException

getSourceData

public java.lang.String getSourceData()
                               throws SweetTranslatorException
Returns the source data which will be translated

Returns:
The source data which will be subject to translation
Throws:
SweetTranslatorException - if an error occurs while fetching the data

setSourceData

public void setSourceData(java.lang.String sourceData)
Set the source data to be translated

Parameters:
sourceData - The data which needs to be translated

setSourceKBDescriptor

public void setSourceKBDescriptor(ISweetKBDescriptor kbDescriptor)
Sets the source KB descriptor

Parameters:
kbDescriptor - The source KB descriptor

setTargetKBDescriptor

public void setTargetKBDescriptor(ISweetKBDescriptor kbDescriptor)
Sets the target KB descriptor

Parameters:
kbDescriptor - The target KB descriptor

getTranslatorDescriptor

public ISweetTranslatorDescriptor getTranslatorDescriptor()
Retrievs the translator descriptor of this object

Returns:
The tranlator describing the translation performed by this object

setTranslatorDescriptor

public void setTranslatorDescriptor(ISweetTranslatorDescriptor translatorDescriptor)
Sets the translator descriptor for this class

Parameters:
translatorDescriptor - An instance of class implementing ISweetTranslatorDescriptor which describes the translation performed by this class

print

public void print()
Utility API to print the translator information


clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
The clone method to clone the translator

Returns:
The cloned translator
Throws:
java.lang.CloneNotSupportedException - if an error occurs