Class TestEngine
java.lang.Object
com.iizix.translate.TranslationEngine
com.iizix.translate.test.TestEngine
- All Implemented Interfaces:
ITranslationEngine
Test translation engine for stand-alone Java application from command line without proxy.
- Author:
- Christopher Mindus
Field Summary
Fields inherited from class TranslationEngine
DEBUG, ENCODING, ENCODING_NAMEFields inherited from interface ITranslationEngine
REQTYPE_POST, REQTYPE_POST_OVERRIDES_GETConstructor Summary
ConstructorsMethod Summary
Modifier and TypeMethodDescriptionvoidconfigureProxy(HttpURLConnection urlConnection) Configures a Http(s)URLConnection for proxy information.Gets a proxy to use for an URL.Gets the ready state of this translation engine.getTranslator(String sourceLanguageCode, String targetLanguageCode) Gets the translator to use for a particular language combination.booleanisLanguageHandled(String languageCode) Verifies if a Language Code is handled by this translator.protected TranslationQueuenewTranslationQueue(String sourceLanguageCode, String targetLanguageCode, ITranslator translator) Creates a new TranslationQueue instance.Methods inherited from class TranslationEngine
cancel, canTranslate, clearLanguageQueue, getInstance, getQueues, postRequestJSON, requestJSON, requestJSON, requestString, requestString, translate
Constructor Details
TestEngine
Method Details
newTranslationQueue
protected TranslationQueue newTranslationQueue(String sourceLanguageCode, String targetLanguageCode, ITranslator translator) Creates a new TranslationQueue instance.- Specified by:
newTranslationQueuein classTranslationEngine- Parameters:
sourceLanguageCode- The source language code, null for auto-detect.targetLanguageCode- The target language code.translator- The translator.
getTranslator
Gets the translator to use for a particular language combination.- Parameters:
sourceLanguageCode- The source language code, null for automatic detection.targetLanguageCode- The target language code.- Returns:
- The translator, null for not found or not configured.
getReadyState
isLanguageHandled
Verifies if a Language Code is handled by this translator.- Parameters:
languageCode- The language code.- Returns:
- true if supported, false if not.
getProxy
configureProxy
Configures a Http(s)URLConnection for proxy information.- Parameters:
urlConnection- The HttpURLConnection or HttpsURLConnection.