35 lines
662 B
Java
35 lines
662 B
Java
package com.imyeyu.lang.mapper;
|
|
|
|
import com.imyeyu.lang.bean.Language;
|
|
|
|
import java.util.HashMap;
|
|
import java.util.Properties;
|
|
|
|
/**
|
|
* 基于 Properties 的语言映射实现
|
|
*
|
|
* @author 夜雨
|
|
* @version 2024-04-09 00:50
|
|
*/
|
|
public class PropertiesLanguageMap extends LanguageMap {
|
|
|
|
/**
|
|
* 默认构造
|
|
*
|
|
* @param language 所属语言
|
|
*/
|
|
public PropertiesLanguageMap(Language.Enum language) {
|
|
super(language);
|
|
}
|
|
|
|
/**
|
|
* 从 Properties 对象加载语言映射数据
|
|
*
|
|
* @param properties 属性对象
|
|
*/
|
|
@SuppressWarnings({"unchecked", "rawtypes"})
|
|
public void load(Properties properties) {
|
|
map.putAll(new HashMap(properties));
|
|
}
|
|
}
|