SystemPropertyUtils class abstract
Utility class for resolving #{...}
-style placeholders within strings
using system properties or environment variables.
This class provides static methods to:
- Resolve system placeholders like
#{user.name}
- Configure whether unresolved placeholders should throw or be ignored
It supports default value resolution using the colon :
separator, and
escaping using the backslash \
.
Example (strict resolution)
final result = SystemPropertyUtils.resolvePlaceholders('Hello #{USER}');
print(result); // Throws if USER is not found
Example (lenient resolution)
final result = SystemPropertyUtils.resolvePlaceholdersWithPlaceholder(
'Hello #{USER:Guest}',
true,
);
print(result); // Hello Guest
Constructors
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
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- ESCAPE_CHARACTER → Character
-
Escape character for property placeholders:
\
final - PLACEHOLDER_PREFIX → String
-
Prefix for property placeholders:
#{
final - PLACEHOLDER_SUFFIX → String
-
Suffix for property placeholders:
}
final - VALUE_SEPARATOR → String
-
Value separator for property placeholders:
:
final
Static Methods
-
resolvePlaceholders(
String text) → String -
Utility class for resolving
#{...}
-style placeholders within strings using system properties or environment variables. -
resolvePlaceholdersWithPlaceholder(
String text, bool ignoreUnresolvablePlaceholders) → String -
Utility class for resolving
#{...}
-style placeholders within strings using system properties or environment variables.