com.hn.translation.TranslationUtil Maven / Gradle / Ivy
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