Also: SpringCore
public interface

PropertyResolver

org.springframework.core.env.PropertyResolver
Known Indirect Subclasses

Class Overview

Interface for resolving properties against any underlying source.

Summary

Public Methods
abstract boolean containsProperty(String key)
Return whether the given property key is available for resolution.
abstract <T> T getProperty(String key, Class<T> targetType)
Return the property value associated with the given key, or null if the key cannot be resolved.
abstract String getProperty(String key)
Return the property value associated with the given key.
abstract String getRequiredProperty(String key)
Return the property value associated with the given key, converted to the given targetType (never null).
abstract <T> T getRequiredProperty(String key, Class<T> targetType)
Return the property value associated with the given key, converted to the given targetType (never null).
abstract String resolvePlaceholders(String text)
Resolve ${...} placeholders in the given text, replacing them with corresponding property values as resolved by getProperty(String).
abstract String resolveRequiredPlaceholders(String text)
Resolve ${...} placeholders in the given text, replacing them with corresponding property values as resolved by getProperty(String).

Public Methods

public abstract boolean containsProperty (String key)

Also: SpringCore

Return whether the given property key is available for resolution.

public abstract T getProperty (String key, Class<T> targetType)

Also: SpringCore

Return the property value associated with the given key, or null if the key cannot be resolved.

public abstract String getProperty (String key)

Also: SpringCore

Return the property value associated with the given key.

public abstract String getRequiredProperty (String key)

Also: SpringCore

Return the property value associated with the given key, converted to the given targetType (never null).

Throws
IllegalStateException if the key cannot be resolved

public abstract T getRequiredProperty (String key, Class<T> targetType)

Also: SpringCore

Return the property value associated with the given key, converted to the given targetType (never null).

Throws
IllegalStateException if the given key cannot be resolved

public abstract String resolvePlaceholders (String text)

Also: SpringCore

Resolve ${...} placeholders in the given text, replacing them with corresponding property values as resolved by getProperty(String). Unresolvable placeholders with no default value are ignored and passed through unchanged.

Parameters
text the String to resolve
Returns
  • the resolved String (never null)
Throws
IllegalArgumentException if given text is null

public abstract String resolveRequiredPlaceholders (String text)

Also: SpringCore

Resolve ${...} placeholders in the given text, replacing them with corresponding property values as resolved by getProperty(String). Unresolvable placeholders with no default value will cause an IllegalArgumentException to be thrown.

Returns
  • the resolved String (never null)
Throws
IllegalArgumentException if given text is null
IllegalArgumentException if any placeholders are unresolvable