public class I18nMessageContextImpl extends Object implements I18nMessageContext
Constructor and Description |
---|
I18nMessageContextImpl() |
Modifier and Type | Method and Description |
---|---|
String |
format(String message,
Context context)
对mesasge进行格式化
|
Locale |
getContextLocale(Context context) |
Formater |
getFormater()
返回格式化器
|
String |
getMessage(String code)
根据代码获取
|
String |
getMessage(String code,
Context context)
用指定代码获取信息,并从环境中填充占位符信息
|
String |
getMessage(String code,
Context context,
Locale locale)
用指定时区语言对mesasge进行格式化
|
String |
getMessage(String code,
Locale locale)
采用指定区域获取信息
|
String |
getMessage(String code,
Locale locale,
String defaultMessage) |
String |
getMessage(String code,
String defaultMessage) |
String |
getMessage(String code,
String defaultMessage,
Context context)
用指定代码获取信息,并从环境中填充占位符信息,如果没有指定代码对应的信息,则用defaultMessage
|
String |
getMessage(String code,
String defaultMessage,
Context context,
Locale locale)
用指定时区语言对mesasge进行格式化,如果Code对应的信息不存在,则用defaultMessage
|
void |
setFormater(Formater formatter)
设置格式化器
|
public String getMessage(String code, Locale locale)
code
- 信息代码locale
- 区域public String getMessage(String code, Context context)
I18nMessageContext
getMessage
in interface I18nMessageContext
public String getMessage(String code, Context context, Locale locale)
I18nMessageContext
getMessage
in interface I18nMessageContext
public String format(String message, Context context)
I18nMessageContext
format
in interface I18nMessageContext
public Formater getFormater()
I18nMessageContext
getFormater
in interface I18nMessageContext
public void setFormater(Formater formatter)
I18nMessageContext
setFormater
in interface I18nMessageContext
public String getMessage(String code, String defaultMessage, Context context)
I18nMessageContext
getMessage
in interface I18nMessageContext
defaultMessage
- 默认值public String getMessage(String code, String defaultMessage, Context context, Locale locale)
I18nMessageContext
getMessage
in interface I18nMessageContext
Copyright © 2006–2018 TinyGroup. All rights reserved.