1717 * Client for the DeepL API. To use the DeepL API, initialize an instance of this class using your
1818 * DeepL Authentication Key as found in your <a href="https://www.deepl.com/pro-account/">DeepL
1919 * account</a>.
20+ *
21+ * @deprecated Use {@link DeepLClient} instead.
2022 */
23+ @ Deprecated
2124public class Translator {
2225 /** Base URL for DeepL API Free accounts. */
2326 private static final String DEEPL_SERVER_URL_FREE = "https://api-free.deepl.com" ;
2427 /** Base URL for DeepL API Pro accounts */
2528 private static final String DEEPL_SERVER_URL_PRO = "https://api.deepl.com" ;
2629
27- private final Parser jsonParser = new Parser ();
28- private final HttpClientWrapper httpClientWrapper ;
30+ protected final Parser jsonParser = new Parser ();
31+ protected final HttpClientWrapper httpClientWrapper ;
2932
3033 /**
3134 * Initializes a new Translator object using your Authentication Key.
@@ -841,7 +844,7 @@ private static ArrayList<KeyValuePair<String, String>> createHttpParams(
841844 * @param options Options influencing translation.
842845 * @return Iterable of parameters for HTTP request.
843846 */
844- private static ArrayList <KeyValuePair <String , String >> createHttpParams (
847+ protected static ArrayList <KeyValuePair <String , String >> createHttpParams (
845848 String sourceLang , String targetLang , DocumentTranslationOptions options ) {
846849 return createHttpParamsCommon (
847850 sourceLang ,
@@ -861,7 +864,7 @@ private static ArrayList<KeyValuePair<String, String>> createHttpParams(
861864 * @param glossaryId ID of glossary to use for translation.
862865 * @return Iterable of parameters for HTTP request.
863866 */
864- private static ArrayList <KeyValuePair <String , String >> createHttpParamsCommon (
867+ protected static ArrayList <KeyValuePair <String , String >> createHttpParamsCommon (
865868 @ Nullable String sourceLang ,
866869 String targetLang ,
867870 @ Nullable Formality formality ,
@@ -920,7 +923,7 @@ private static String joinTags(Iterable<String> tags) {
920923 * @param targetLang Language code of the desired output language.
921924 * @throws IllegalArgumentException If either language code is invalid.
922925 */
923- private static void checkValidLanguages (@ Nullable String sourceLang , String targetLang )
926+ protected static void checkValidLanguages (@ Nullable String sourceLang , String targetLang )
924927 throws IllegalArgumentException {
925928 if (sourceLang != null && sourceLang .isEmpty ()) {
926929 throw new IllegalArgumentException ("sourceLang must be null or non-empty" );
@@ -982,7 +985,7 @@ private void checkResponse(HttpResponseStream response) throws DeepLException {
982985 * @throws DeepLException Throws {@link DeepLException} or a derived exception depending on the
983986 * type of error.
984987 */
985- private void checkResponse (
988+ protected void checkResponse (
986989 HttpResponse response , boolean inDocumentDownload , boolean usingGlossary )
987990 throws DeepLException {
988991 if (response .getCode () >= 200 && response .getCode () < 300 ) {
0 commit comments