public final class MsgUtil extends Object
MsgUtilは、共通的に使用されるリソースからメッセージを作成する、ユーティリティークラスです。現状は、"org.opengion.fukurou.message".properties ファイルをリソースとして使用します。 このリソースファイルを、各言語別に作成することで、アプリケーションのメッセージを国際化できます。 通常のリソース変換以外に、キーワードと引数で、RuntimeException を返す簡易メソッドも提供します。
7.0.0.0 (2017/07/07) 新規作成 |
修飾子とタイプ | フィールドと説明 |
---|---|
static String |
F_BS_NM
初期設定されているリソースバンドルのbaseName "org.opengion.fukurou.message"
|
修飾子とタイプ | メソッドと説明 |
---|---|
static String |
errPrintln(String id,
Object[] args)
エラーメッセージを作成して、LOGGER で出力します。
|
static String |
errPrintln(Throwable th,
String id,
Object[] args)
Throwable付きのエラーメッセージを作成して、LOGGER で出力します。
|
static String |
getMsg(String id,
Object[] args)
"jp.euromap.eu63.message" の、Locale.getDefault() リソースから取得するメッセージを文字列で返します。
|
static void |
main(String[] args)
リソース一覧を表示する main メソッドです。
|
static RuntimeException |
throwException(String id,
Object[] args)
メッセージを作成して、RuntimeExceptionの引数にセットして、throw します。
|
static RuntimeException |
throwException(Throwable th,
String id,
Object[] args)
メッセージを作成して、RuntimeExceptionの引数にセットして、throw します。
|
public static String getMsg(String id, Object[] args)
id
- リソースのキーとなるID。args
- リソースを、MessageFormat.format で加工する場合の引数。F_BS_NM
6.4.3.1 (2016/02/12) 新規追加 |
public static RuntimeException throwException(String id, Object[] args)
id
- リソースのキーとなるID。args
- リソースを、MessageFormat.format で加工する場合の引数。getMsg( String,Object... )
,
throwException( Throwable,String,Object... )
6.4.3.1 (2016/02/12) 新規追加 |
public static RuntimeException throwException(Throwable th, String id, Object[] args)
th
- 発生元のThrowable( null値は許容されます )id
- リソースのキーとなるID。args
- リソースを、MessageFormat.format で加工する場合の引数。getMsg( String,Object... )
,
throwException( String,Object... )
6.4.3.1 (2016/02/12) 新規追加 |
public static String errPrintln(String id, Object[] args)
id
- リソースのキーとなるID。args
- リソースを、MessageFormat.format で加工する場合の引数。getMsg( String,Object... )
6.4.3.1 (2016/02/12) 新規追加 |
public static String errPrintln(Throwable th, String id, Object[] args)
th
- 発生元のThrowable( null値は許容されます )id
- リソースのキーとなるID。args
- リソースを、MessageFormat.format で加工する場合の引数。getMsg( String,Object... )
6.4.3.1 (2016/02/12) 新規追加 |
public static void main(String[] args)
args
- コマンド引数配列Webアプリケーションフレームワーク openGionCopyright (c) 2009 The openGion Project.