org.semwebcentral.sweetrules.infrastructure
Interface ISweetTranslatorDescriptor

All Superinterfaces:
java.lang.Cloneable
All Known Implementing Classes:
AbstractSweetTranslatorDescriptor

public interface ISweetTranslatorDescriptor
extends java.lang.Cloneable

This is an interface which describes a translator

TODO: 1) Handle preferences in a generic way through the preference header perhaps at the repository level. 2) Separate the Translator descriptor and the translation descriptor. The translation descriptor should describe the ingredients for the translation process and not concerned with any specific translator This makes things more modular, because the client can just specify the translation descriptor and perferences the appropriate translator will be found by the repository by running a suitable match algorithm

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

Method Summary
 java.lang.Object clone()
          The clone method to clone this object
 java.lang.String getKRTranslatorDoc()
          KR translator document describes the translation (including caveats).
 ISweetInvocationDescriptor getOptions()
          Retrieves the currently set options, if no options are explicitly set then the default options are returned.
 ISweetKRDescriptor getSourceKRDescriptor()
          Returns the source format supported by this translator
 ISweetKRDescriptor getTargetKRDescriptor()
          Returns the target format supported by this translator
 java.lang.String getTranslatorClassName()
          Gets the class name of the ISweetTranslator implementation corresponding to this descriptor
 ISweetCanonicalVersionNumber getTranslatorVersionNumber()
          Retreives the version number as an instance of CanonicalVersionNumber, which can further be used to retrieve the native version number if so desired.
 void setKRTranslatorDoc(java.lang.String translatorDocContents)
          KR translator document describes the translation (including caveats).
 void setOptions(ISweetInvocationDescriptor options)
          Sets the options for the translator.
 void setTranslatorClassName(java.lang.String className)
          Sets the class name of the ISweetTranslator implementation corresponding to this descriptor
 void setTranslatorVersionNumber(ISweetCanonicalVersionNumber versionNumber)
          Sets the version number as an instance of CanonicalVersionNumber.
 

Method Detail

getSourceKRDescriptor

public ISweetKRDescriptor getSourceKRDescriptor()
Returns the source format supported by this translator

Returns:
the KRDescriptor of the source format

getTargetKRDescriptor

public ISweetKRDescriptor getTargetKRDescriptor()
Returns the target format supported by this translator

Returns:
the KRDescriptor of the target format

getKRTranslatorDoc

public java.lang.String getKRTranslatorDoc()
KR translator document describes the translation (including caveats). This API retreives the contents of such a doc if it exists or returns null if it doesn't

Returns:
The contents of KR translator document which describes the translation process

setKRTranslatorDoc

public void setKRTranslatorDoc(java.lang.String translatorDocContents)
KR translator document describes the translation (including caveats). This API recieves the contents of such a doc and caches it

Parameters:
translatorDocContents - The contents of KR translator document which describes the translation process

getTranslatorVersionNumber

public ISweetCanonicalVersionNumber getTranslatorVersionNumber()
Retreives the version number as an instance of CanonicalVersionNumber, which can further be used to retrieve the native version number if so desired. CanonicalVersionNumber facilitates easier comparison of version numbers

Returns:
The canonical version number of the translator

setTranslatorVersionNumber

public void setTranslatorVersionNumber(ISweetCanonicalVersionNumber versionNumber)
Sets the version number as an instance of CanonicalVersionNumber. CanonicalVersionNumber is an abstraction to ease the task of version number comparsion

Parameters:
versionNumber - The canonical version number of the translator

getOptions

public ISweetInvocationDescriptor getOptions()
Retrieves the currently set options, if no options are explicitly set then the default options are returned. If null is returned then there are no options set, default or otherwise.

Returns:
The option header which is currently used by the translator

setOptions

public void setOptions(ISweetInvocationDescriptor options)
                throws SweetTranslatorException
Sets the options for the translator.

Parameters:
options - The option header for setting any options to the translator If it is null the default options are used.
Throws:
TranslatorException - If any option is not supported. Note that there is a difference between "not supported" and "not relevant" options that are not relevant are ignored even if they are specified in the OptionsHeader
SweetTranslatorException

getTranslatorClassName

public java.lang.String getTranslatorClassName()
                                        throws SweetTranslatorException
Gets the class name of the ISweetTranslator implementation corresponding to this descriptor

Returns:
The full class name of ISweetTranslator implementation
Throws:
TranslatorException - if the class name is not set
SweetTranslatorException

setTranslatorClassName

public void setTranslatorClassName(java.lang.String className)
Sets the class name of the ISweetTranslator implementation corresponding to this descriptor

Parameters:
className - Full class name of the ISweetTranslator implementation corresponding to this descriptor

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
The clone method to clone this object

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