Package com.iizix.translate
Class Translation
- java.lang.Object
- com.iizix.translate.Translation
public class Translation extends java.lang.Object
Translation class holding the information processed by the translation engine.- Author:
- Christopher Mindus
Field Summary
Fields Modifier and Type Field Description java.lang.Throwable
exception
Exception for failure, null otherwise.java.lang.String
originalLangID
The original language ID.java.lang.String
originalText
The original text as passed in to the translator.KString
sourceText
The KString as the source text.boolean
success
Success flag: the members translatedText, translationLangID can be used (not null).java.lang.String
translatedText
The translated text, null for failure.java.lang.String
translationLangID
The translation language ID.ITranslator
translator
The translator that provided the translation.
Constructor Summary
Constructors Constructor Description Translation(ITranslator translator, KString sourceText, java.lang.String originalText, java.lang.String originalLangID, java.lang.String translatedText, java.lang.String translationLangID)
Constructs the successful Translation.Translation(ITranslator translator, KString sourceText, java.lang.String originalText, java.lang.String originalLangID, java.lang.String translationLangID, java.lang.Throwable exception)
Constructs the failed Translation, only from the engine itself.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getTranslatorName()
Gets the name of the translator.java.lang.String
toString()
The string representation of this class.
Field Detail
originalText
public final java.lang.String originalText
The original text as passed in to the translator.
originalLangID
public final java.lang.String originalLangID
The original language ID. If no language is set on translation request, this member will contain what the Translator detected as language. This member may be null when the translation failed.
translatedText
public final java.lang.String translatedText
The translated text, null for failure.
translationLangID
public final java.lang.String translationLangID
The translation language ID.
sourceText
public final KString sourceText
The KString as the source text.
translator
public final ITranslator translator
The translator that provided the translation.
success
public final boolean success
Success flag: the members translatedText, translationLangID can be used (not null).
exception
public final java.lang.Throwable exception
Exception for failure, null otherwise.
Constructor Detail
Translation
public Translation(ITranslator translator, KString sourceText, java.lang.String originalText, java.lang.String originalLangID, java.lang.String translatedText, java.lang.String translationLangID)
Constructs the successful Translation.- Parameters:
translator
- The translator.sourceText
- The KString source text.originalText
- The original text as passed in to the translator.originalLangID
- The original language. If no language is set on translation request, this member will contain what the translation engine detected as language.translatedText
- The translated text.translationLangID
- The translation language.
Translation
public Translation(ITranslator translator, KString sourceText, java.lang.String originalText, java.lang.String originalLangID, java.lang.String translationLangID, java.lang.Throwable exception)
Constructs the failed Translation, only from the engine itself.- Parameters:
translator
- The translator.sourceText
- The KString source text.originalText
- The original text as passed in to the translator.originalLangID
- The original language. If no language is set on translation request, this member will contain what the translation engine detected as language, null if this failed.translationLangID
- The translation language.exception
- The exception.