A specialized PropertyResolver that allows full control over property
placeholder behavior and type conversion logic using a configurable
ConfigurableConversionService.
This interface enables:
- Custom placeholder syntax configuration (prefix, suffix, separator, escape).
- Tolerance or strictness for unresolvable nested placeholders.
- Custom
Converterregistration. - Required property validation.
🔁 Example:
final resolver = MyPropertyResolver();
resolver.setPlaceholderPrefix('#{');
resolver.setPlaceholderSuffix('}');
resolver.setValueSeparator(':');
resolver.setEscapeCharacter(r'\');
resolver.setIgnoreUnresolvableNestedPlaceholders(false);
resolver.getConversionService().addConverter(StringToDurationConverter());
This is intended for internal use by Environment implementations and advanced property injection infrastructure.
- Inheritance
-
- Object
- PropertyResolver
- ConfigurablePropertyResolver
- Implementers
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
containsProperty(
String key) → bool -
Returns whether the given property
keyis defined.inherited -
getConversionService(
) → ConfigurableConversionService -
Returns the
ConfigurableConversionServiceused to perform type conversions. -
getProperty(
String key, [String? defaultValue]) → String? -
Retrieves the value for the given property
key, ornullif not found.inherited -
getPropertyAs<
T> (String key, Class< T> targetType, [T? defaultValue]) → T? -
Retrieves and converts the value of
keyto the desired typeT.inherited -
getRequiredProperty(
String key) → String -
Returns the property value for
key, or throwsIllegalStateExceptionif the property is not defined.inherited -
getRequiredPropertyAs<
T> (String key, Class< T> targetType) → T -
Retrieves and converts the property
keyto typeT, or throwsIllegalStateExceptionif missing or invalid.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
resolvePlaceholders(
String text) → String -
Resolves
#{...}placeholders in the inputtextusing available properties.inherited -
resolveRequiredPlaceholders(
String text) → String -
Resolves
#{...}placeholders in the inputtextusing available properties.inherited -
setConversionService(
ConfigurableConversionService conversionService) → void -
Replaces the underlying
ConfigurableConversionServiceused for type conversions. -
setEscapeCharacter(
Character? escapeCharacter) → void - Sets the escape character used to ignore placeholder prefix and separator.
-
setIgnoreUnresolvableNestedPlaceholders(
bool ignoreUnresolvableNestedPlaceholders) → void - Enables or disables ignoring unresolvable nested placeholders.
-
setPlaceholderPrefix(
String placeholderPrefix) → void - Sets the prefix that identifies a placeholder in property values.
-
setPlaceholderSuffix(
String placeholderSuffix) → void - Sets the suffix that identifies the end of a placeholder in property values.
-
setRequiredProperties(
List< String> requiredProperties) → void - Sets the list of property names that are required to be present and non-null.
-
setValueSeparator(
String? valueSeparator) → void - Sets the separator for default values within placeholders.
-
suggestions(
String key) → List< String> -
Returns a list of suggestions for the given key.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
validateRequiredProperties(
) → void - Validates that all required properties are present and non-null.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited