public class LocaleSwitchFormatter extends CellFormatter
該当するロケールがない場合、標準のフォーマッタを返す。
| コンストラクタと説明 |
|---|
LocaleSwitchFormatter(CellFormatter defaultFormatter)
標準のフォーマッタを指定するコンストラクタ
|
| 修飾子とタイプ | メソッドと説明 |
|---|---|
CellFormatResult |
format(CommonCell cell,
Locale locale)
セルの値をロケールを指定してフォーマットする
|
String |
getPattern(Locale locale)
ロケールを指定して書式を取得する
|
LocaleSwitchFormatter |
register(CellFormatter cellFormatter,
Locale... locales)
ローケールとフォーマッタを登録する。
|
format, getPatternpublic LocaleSwitchFormatter(CellFormatter defaultFormatter)
defaultFormatter - 標準のフォーマッタ。IllegalArgumentException - defaultFormatter == null.public CellFormatResult format(CommonCell cell, Locale locale)
CellFormatterformat クラス内 CellFormattercell - フォーマット対象のセル。locale - ロケール。指定しない場合は、実行環境のロケールが設定される。public LocaleSwitchFormatter register(CellFormatter cellFormatter, Locale... locales)
cellFormatter - 登録対象のフォーマッタ。locales - 登録対象のロケール。複数指定可能。IllegalArgumentException - cellFormatter == null.IllegalArgumentException - locales == null || locales.length == 0.public String getPattern(Locale locale)
CellFormattergetPattern クラス内 CellFormatterlocale - ロケール。指定しない場合は、実行環境のロケールが設定される。Copyright © 2021 mygreen. All rights reserved.