org.springframework.beans.factory.config

Class PreferencesPlaceholderConfigurer

    • Constructor Detail

      • PreferencesPlaceholderConfigurer

        public PreferencesPlaceholderConfigurer()
    • Method Detail

      • setSystemTreePath

        public void setSystemTreePath(java.lang.String systemTreePath)
        Set the path in the system preferences tree to use for resolving placeholders. Default is the root node.
      • setUserTreePath

        public void setUserTreePath(java.lang.String userTreePath)
        Set the path in the system preferences tree to use for resolving placeholders. Default is the root node.
      • afterPropertiesSet

        public void afterPropertiesSet()
        This implementation eagerly fetches the Preferences instances for the required system and user tree nodes.
        Specified by:
        afterPropertiesSet in interface InitializingBean
      • resolvePlaceholder

        protected java.lang.String resolvePlaceholder(java.lang.String placeholder,
                                                      java.util.Properties props)
        This implementation tries to resolve placeholders as keys first in the user preferences, then in the system preferences, then in the passed-in properties.
        Overrides:
        resolvePlaceholder in class PropertyPlaceholderConfigurer
        Parameters:
        placeholder - the placeholder to resolve
        props - the merged properties of this configurer
        Returns:
        the resolved value, of null if none
        See Also:
        PropertyPlaceholderConfigurer.setSystemPropertiesMode(int)
      • resolvePlaceholder

        @Nullable
        protected java.lang.String resolvePlaceholder(@Nullable
                                                                java.lang.String path,
                                                                java.lang.String key,
                                                                java.util.prefs.Preferences preferences)
        Resolve the given path and key against the given Preferences.
        Parameters:
        path - the preferences path (placeholder part before '/')
        key - the preferences key (placeholder part after '/')
        preferences - the Preferences to resolve against
        Returns:
        the value for the placeholder, or null if none found