All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.hn.translation.TranslationUtil Maven / Gradle / Ivy

There is a newer version: 1.0.18
Show newest version
package com.hn.translation;

import com.hn.translation.factory.TFactory;
import com.hn.translation.factory.TranslatorFactory;

import java.net.URISyntaxException;

/**
 * 描述:
 * 翻译工具类
 * @author fei
 */
public class TranslationUtil {

    private static TFactory factory;

    private TranslationUtil() {}

    static {
        try {
            factory = new TranslatorFactory();
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (InstantiationException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (URISyntaxException e) {
            e.printStackTrace();
        }
    }

    public static Translator translator(String id){
        return factory.get(id);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy