クラス StandardServletEnvironment
java.lang.ObjectSE
org.springframework.core.env.AbstractEnvironment
org.springframework.core.env.StandardEnvironment
org.springframework.web.context.support.StandardServletEnvironment
- 実装されているすべてのインターフェース:
ConfigurableEnvironment、ConfigurablePropertyResolver、Environment、PropertyResolver、ConfigurableWebEnvironment
public class StandardServletEnvironment
extends StandardEnvironment
implements ConfigurableWebEnvironment
Servlet ベースの Web アプリケーションで使用される Environment 実装。すべての Web 関連(サーブレットベース)の ApplicationContext クラスは、デフォルトでインスタンスを初期化します。ServletConfig、ServletContext、JNDI ベースの PropertySource インスタンスに貢献します。詳細については、customizePropertySources(org.springframework.core.env.MutablePropertySources) メソッドのドキュメントを参照してください。
- 導入:
- 3.1
- 作成者:
- Chris Beams, Juergen Hoeller
- 関連事項:
フィールドのサマリー
フィールド修飾子と型フィールド説明static final StringSEJNDI プロパティソース名: "jndiProperties" .static final StringSEサーブレット構成の初期化パラメータープロパティソース名: "servletConfigInitParams"。static final StringSEサーブレットコンテキスト初期化パラメータープロパティソース名: "servletContextInitParams"。クラス org.springframework.core.env.StandardEnvironment から継承されたフィールド
SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME, SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAMEクラス org.springframework.core.env.AbstractEnvironment から継承されたフィールド
ACTIVE_PROFILES_PROPERTY_NAME, DEFAULT_PROFILES_PROPERTY_NAME, IGNORE_GETENV_PROPERTY_NAME, logger, RESERVED_DEFAULT_PROFILE_NAMEコンストラクターの概要
コンストラクター修飾子コンストラクター説明新しいStandardServletEnvironmentインスタンスを作成します。protectedStandardServletEnvironment(MutablePropertySources propertySources) 特定のMutablePropertySourcesインスタンスを使用して新しいStandardServletEnvironmentインスタンスを作成します。メソッドのサマリー
修飾子と型メソッド説明protected voidcustomizePropertySources(MutablePropertySources propertySources) プロパティソースのセットを、スーパークラスによって提供されたもの、標準のサーブレットベースの環境に適したものでカスタマイズします。"servletConfigInitParams" "servletContextInitParams" "jndiProperties"voidinitPropertySources(ServletContextEE servletContext, ServletConfigEE servletConfig) 指定されたパラメーターを使用して、プレースホルダーとして機能するスタブプロパティソースインスタンスを実際のサーブレットコンテキスト / 構成プロパティソースに置き換えます。クラス org.springframework.core.env.AbstractEnvironment から継承されたメソッド
acceptsProfiles, acceptsProfiles, addActiveProfile, containsProperty, createPropertyResolver, doGetActiveProfiles, doGetActiveProfilesProperty, doGetDefaultProfiles, doGetDefaultProfilesProperty, getActiveProfiles, getConversionService, getDefaultProfiles, getProperty, getProperty, getProperty, getProperty, getPropertyResolver, getPropertySources, getRequiredProperty, getRequiredProperty, getReservedDefaultProfiles, getSystemEnvironment, getSystemProperties, isProfileActive, merge, resolvePlaceholders, resolveRequiredPlaceholders, setActiveProfiles, setConversionService, setDefaultProfiles, setEscapeCharacter, setIgnoreUnresolvableNestedPlaceholders, setPlaceholderPrefix, setPlaceholderSuffix, setRequiredProperties, setValueSeparator, suppressGetenvAccess, toString, validateProfile, validateRequiredPropertiesクラス java.lang.ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, wait, waitSE, waitSEインターフェース org.springframework.core.env.ConfigurableEnvironment から継承されたメソッド
addActiveProfile, getPropertySources, getSystemEnvironment, getSystemProperties, merge, setActiveProfiles, setDefaultProfilesインターフェース org.springframework.core.env.ConfigurablePropertyResolver から継承されたメソッド
getConversionService, setConversionService, setEscapeCharacter, setIgnoreUnresolvableNestedPlaceholders, setPlaceholderPrefix, setPlaceholderSuffix, setRequiredProperties, setValueSeparator, validateRequiredPropertiesインターフェース org.springframework.core.env.Environment から継承されたメソッド
acceptsProfiles, acceptsProfiles, getActiveProfiles, getDefaultProfiles, matchesProfilesインターフェース org.springframework.core.env.PropertyResolver から継承されたメソッド
containsProperty, getProperty, getProperty, getProperty, getProperty, getRequiredProperty, getRequiredProperty, resolvePlaceholders, resolveRequiredPlaceholders
フィールドの詳細
コンストラクターの詳細
StandardServletEnvironment
public StandardServletEnvironment()新しいStandardServletEnvironmentインスタンスを作成します。StandardServletEnvironment
特定のMutablePropertySourcesインスタンスを使用して新しいStandardServletEnvironmentインスタンスを作成します。- パラメーター:
propertySources- 使用するプロパティソース- 導入:
- 5.3.4
メソッドの詳細
customizePropertySources
プロパティソースのセットを、スーパークラスによって提供されたものと標準のサーブレットベースの環境に適したものでカスタマイズします。"servletConfigInitParams" にあるプロパティは "servletContextInitParams" にあるプロパティよりも優先され、上記のいずれかにあるプロパティは "jndiProperties" にあるプロパティよりも優先されます。
上記のいずれかのプロパティは、
StandardEnvironmentスーパークラスによって提供されるシステムプロパティおよび環境変数よりも優先されます。Servlet関連のプロパティソースはこの段階でstubsとして追加され、実際のServletContextEE オブジェクトが利用可能になると完全に初期化されます。"jndiProperties" の追加は
JndiLocatorDelegate.IGNORE_JNDI_PROPERTY_NAMEで無効にできます。- オーバーライド:
- クラス
StandardEnvironmentのcustomizePropertySources - 関連事項:
StandardEnvironment.customizePropertySources(org.springframework.core.env.MutablePropertySources)AbstractEnvironment.customizePropertySources(org.springframework.core.env.MutablePropertySources)ServletConfigPropertySourceServletContextPropertySourceJndiPropertySourceAbstractApplicationContext.initPropertySources()initPropertySources(ServletContext, ServletConfig)
initPropertySources
public void initPropertySources(@Nullable ServletContextEE servletContext, @Nullable ServletConfigEE servletConfig) インターフェースからコピーされた説明:ConfigurableWebEnvironment指定されたパラメーターを使用して、プレースホルダーとして機能するスタブプロパティソースインスタンスを実際のサーブレットコンテキスト / 構成プロパティソースに置き換えます。- 次で指定:
- インターフェース
ConfigurableWebEnvironmentのinitPropertySources - パラメーター:
servletContext-ServletContextEE (利用できない場合はnull)servletConfig-ServletConfigEE (利用できない場合はnull)- 関連事項: