public class ResourcePropertySource extends PropertiesPropertySource
Resource
または "classpath:/com/myco/foo.properties"
や "file:/path/to/file.xml"
などのリソースの場所から Properties
SE オブジェクトをロードする PropertiesPropertySource
のサブクラス。 従来のプロパティファイル形式と XML ベースのプロパティファイル形式の両方がサポートされています。ただし、XML 処理を有効にするには、基になる Resource
の getFilename()
メソッドが ".xml"
で終わる非 null
値を返す必要があります。
Resource
, EncodedResource
PropertySource.StubPropertySource
logger, name, source
コンストラクターと説明 |
---|
ResourcePropertySource(EncodedResource resource) 指定されたリソースからロードされたプロパティに基づいて PropertySource を作成します。 |
ResourcePropertySource(Resource resource) 指定されたリソースからロードされたプロパティに基づいて PropertySource を作成します。 |
ResourcePropertySource(StringSE location) 指定されたリソースの場所からロードされたプロパティに基づいて PropertySource を作成します。 |
ResourcePropertySource(StringSE location, ClassLoaderSE classLoader) 指定されたリソースの場所からロードされたプロパティに基づいて PropertySource を作成し、指定されたクラスローダーを使用してリソースをロードします(リソースの接頭辞が classpath: であると想定)。 |
ResourcePropertySource(StringSE name, EncodedResource resource) 指定されたエンコードされたリソースからロードされたプロパティに基づいて、指定された名前を持つ PropertySource を作成します。 |
ResourcePropertySource(StringSE name, Resource resource) 指定されたエンコードされたリソースからロードされたプロパティに基づいて、指定された名前を持つ PropertySource を作成します。 |
ResourcePropertySource(StringSE name, StringSE location) 指定されたリソースの場所からロードされたプロパティに基づいて、指定された名前を持つ PropertySource を作成します。 |
ResourcePropertySource(StringSE name, StringSE location, ClassLoaderSE classLoader) 指定されたリソースの場所からロードされたプロパティに基づいて指定された名前の PropertySource を作成し、指定されたクラスローダーを使用してリソースをロードします(接頭辞が classpath: であると想定)。 |
修飾子と型 | メソッドと説明 |
---|---|
ResourcePropertySource | withName(StringSE name) この ResourcePropertySource の潜在的に適応されたバリアントを返し、以前に与えられた(または派生した)名前を指定された名前でオーバーライドします。 |
ResourcePropertySource | withResourceName() この ResourcePropertySource の潜在的に適応されたバリアントを返し、以前に指定された名前(存在する場合)を元のリソース名(名前のないコンストラクターバリアントによって生成された名前と同等)でオーバーライドします。 |
getPropertyNames
containsProperty, getProperty
equals, getName, getSource, hashCode, named, toString
cloneSE, finalizeSE, getClassSE, notifySE, notifyAllSE, waitSE, waitSE, waitSE
public ResourcePropertySource(StringSE name, EncodedResource resource) throws IOExceptionSE
public ResourcePropertySource(EncodedResource resource) throws IOExceptionSE
description
に基づいて生成されます。public ResourcePropertySource(StringSE name, Resource resource) throws IOExceptionSE
public ResourcePropertySource(Resource resource) throws IOExceptionSE
description
に基づいて生成されます。public ResourcePropertySource(StringSE name, StringSE location, ClassLoaderSE classLoader) throws IOExceptionSE
classpath:
であると想定)。public ResourcePropertySource(StringSE location, ClassLoaderSE classLoader) throws IOExceptionSE
classpath:
であると想定)。PropertySource の名前は、リソースの description
に基づいて生成されます。public ResourcePropertySource(StringSE name, StringSE location) throws IOExceptionSE
classpath
が付いていると仮定します)。public ResourcePropertySource(StringSE location) throws IOExceptionSE
description
に基づいて生成されます。public ResourcePropertySource withName(StringSE name)
ResourcePropertySource
の潜在的に適応されたバリアントを返し、以前に与えられた(または派生した)名前を指定された名前でオーバーライドします。public ResourcePropertySource withResourceName()
ResourcePropertySource
の潜在的に適応されたバリアントを返し、以前に指定された名前(存在する場合)を元のリソース名(名前のないコンストラクターバリアントによって生成された名前と同等)でオーバーライドします。