Class OsEnvironmentVariableExternalizedLoader
java.lang.Object
nablarch.core.repository.di.config.externalize.OsEnvironmentVariableExternalizedLoader
- All Implemented Interfaces:
ExternalizedComponentDefinitionLoader
public class OsEnvironmentVariableExternalizedLoader
extends Object
implements ExternalizedComponentDefinitionLoader
OS環境変数をコンポーネント定義として読み込む
このとき、OS環境変数で使用できる文字種に制限があることを踏まえて、コンポーネント名を 次のように変換してから検索する。
ExternalizedComponentDefinitionLoader。
このローダーは、読み込み済みのコンポーネントの名前を元に、OS環境変数を検索する。このとき、OS環境変数で使用できる文字種に制限があることを踏まえて、コンポーネント名を 次のように変換してから検索する。
- ドット(
".")とハイフン("-")をアンダーバー("_")に置換する - 小文字を大文字に変換する(
String.toUpperCase())
"foo-bar.fizz-buzz"という名前のコンポーネントが存在した場合は、
"FOO_BAR_FIZZ_BUZZ"という名前でOS環境変数が検索されることになる。
変換後の名前でOS環境変数が見つかった場合は、その値をStringのコンポーネントとして読み込む。-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionload(DiContainer container, Map<String, ComponentHolder> loadedComponents) 外部化されたコンポーネントを読み込む。
-
Constructor Details
-
OsEnvironmentVariableExternalizedLoader
public OsEnvironmentVariableExternalizedLoader()コンストラクタ。
-
-
Method Details
-
load
public List<ComponentDefinition> load(DiContainer container, Map<String, ComponentHolder> loadedComponents) Description copied from interface:ExternalizedComponentDefinitionLoader外部化されたコンポーネントを読み込む。- Specified by:
loadin interfaceExternalizedComponentDefinitionLoader- Parameters:
container- DIコンテナloadedComponents- 読み込み済みのコンポーネント(マップのキーはコンポーネントの名前)- Returns:
- 読み込んだコンポーネント定義のリスト
-