Package com.imyeyu.lang.mapper
Class AbstractLanguageMapper
java.lang.Object
com.imyeyu.lang.mapper.AbstractLanguageMapper
- All Implemented Interfaces:
LanguageMapping
- Direct Known Subclasses:
LanguageMap
抽象语言映射器,提供语言映射的基础实现,提供字符串插值、调试模式等基础功能
- Version:
- 2024-04-01 16:25
- Author:
- 夜雨
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final com.imyeyu.utils.StringInterpolator字符串插值器,用于处理占位符替换protected booleantrue 为启用调试模式protected final Language.Enum当前映射器所属语言 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription当前映射器所属语言获取文本插入参数获取文本,使用 ${key} 格式进行占位符替换voidsetDebugging(boolean isDebugging) true 为启用调试模式Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.imyeyu.lang.bean.LanguageMapping
add, has, message
-
Field Details
-
INTERPOLATOR
protected final com.imyeyu.utils.StringInterpolator INTERPOLATOR字符串插值器,用于处理占位符替换 -
language
当前映射器所属语言 -
isDebugging
protected boolean isDebuggingtrue 为启用调试模式
-
-
Constructor Details
-
AbstractLanguageMapper
构造语言映射器- Parameters:
language- 所属语言
-
-
Method Details
-
message
获取文本- Specified by:
messagein interfaceLanguageMapping- Parameters:
key- 键def- 默认值(没有找到映射值时)- Returns:
- 获取结果
-
message
插入参数获取文本,使用 ${key} 格式进行占位符替换- Specified by:
messagein interfaceLanguageMapping- Parameters:
key- 键args- 参数映射表- Returns:
- 替换占位符后的文本
-
getLanguage
当前映射器所属语言 -
setDebugging
public void setDebugging(boolean isDebugging) true 为启用调试模式
-