public final class I18nMessages extends Object implements I18nMessage
Constructor and Description |
---|
I18nMessages() |
Modifier and Type | Method and Description |
---|---|
String |
format(String msg,
Context context)
对mesasge进行格式化
|
Formater |
getFormater()
返回格式化器
|
List<I18nMessageContext> |
getI18nMessageContexts() |
List<I18nMessageStandard> |
getI18nMessageStandards() |
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,
Object... args)
采用指定区域获取信息
|
String |
getMessage(String code,
String defaultMessage,
Context context)
用指定代码获取信息,并从环境中填充占位符信息,如果没有指定代码对应的信息,则用defaultMessage
|
String |
getMessage(String code,
String defaultMessage,
Context context,
Locale locale)
用指定时区语言对mesasge进行格式化,如果Code对应的信息不存在,则用defaultMessage
|
String |
getMessage(String code,
String defaultMessage,
Object... args)
采用默认区域获取信息,不存在则返回默认值
|
void |
setFormater(Formater formater)
设置格式化器
|
void |
setI18nMessageContexts(List<I18nMessageContext> i18nMessageContexts) |
void |
setI18nMessageStandards(List<I18nMessageStandard> i18nMessageStandards) |
public List<I18nMessageStandard> getI18nMessageStandards()
public void setI18nMessageStandards(List<I18nMessageStandard> i18nMessageStandards)
public List<I18nMessageContext> getI18nMessageContexts()
public void setI18nMessageContexts(List<I18nMessageContext> i18nMessageContexts)
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 msg, Context context)
I18nMessageContext
format
in interface I18nMessageContext
public Formater getFormater()
I18nMessageContext
getFormater
in interface I18nMessageContext
public void setFormater(Formater formater)
I18nMessageContext
setFormater
in interface I18nMessageContext
public String getMessage(String code, String defaultMessage, Object... args)
I18nMessageStandard
getMessage
in interface I18nMessageStandard
code
- 信息代码defaultMessage
- 默认值args
- 参数列表public String getMessage(String code, Locale locale, String defaultMessage, Object... args)
I18nMessageStandard
getMessage
in interface I18nMessageStandard
code
- 信息代码locale
- 区域defaultMessage
- 默认值args
- 参数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.