ApplicationEnvironment class
A concrete environment for standard JetLeaf applications.
This class extends GlobalEnvironment and serves as the default runtime environment for most JetLeaf-based applications unless explicitly overridden.
It inherits all behavior from GlobalEnvironment, including support for:
- System environment variables
- System properties (if available)
- Default property sources
- Active and default profiles
Example:
final env = ApplicationEnvironment();
final port = env.getProperty('server.port');
print('Running on port: $port');
You can customize this environment by registering new property sources or profiles during the boot phase.
- Inheritance
-
- Object
- PropertyResolver
- Environment
- ConfigurableEnvironment
- AbstractEnvironment
- GlobalEnvironment
- ApplicationEnvironment
Constructors
- ApplicationEnvironment()
- A concrete environment for standard JetLeaf applications.
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
-
acceptsProfiles(
Profiles profiles) → bool -
Profile Predicate Evaluation
inherited
-
addActiveProfile(
String profile) → void -
Adds an additional active profile to the current set.
inherited
-
containsProperty(
String key) → bool -
Returns whether the given property
keyis defined.inherited -
createPropertyResolver(
MutablePropertySources propertySources) → ConfigurablePropertyResolver -
Factory for Property Resolver
inherited
-
customizePropertySources(
MutablePropertySources propertySources) → void -
Called during construction to allow subclasses to register default property sources.
inherited
-
doGetActiveProfiles(
) → Set< String> -
Resolves Active Profiles
inherited
-
doGetActiveProfilesProperty(
) → String? -
Reads Active Profiles Property
inherited
-
doGetDefaultProfiles(
) → Set< String> -
Resolves Default Profiles
inherited
-
doGetDefaultProfilesProperty(
) → String? -
Reads Default Profiles Property
inherited
-
getActiveProfiles(
) → List< String> -
Active Profiles
inherited
-
getConversionService(
) → ConfigurableConversionService -
Returns the ConfigurableConversionService used to perform type conversions.
inherited
-
getDefaultProfiles(
) → List< String> -
Default Profiles
inherited
-
getPackageName(
) → String -
Represents an abstraction for identifying the package that an object,
resource, or service belongs to.
inherited
-
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 -
getPropertyResolver(
) → ConfigurablePropertyResolver -
Access to the Property Resolver
inherited
-
getPropertySources(
) → MutablePropertySources -
Returns the MutablePropertySources backing this environment.
inherited
-
getRequiredProperty(
String key) → String -
Returns the property value for
key, or throws IllegalStateException if the property is not defined.inherited -
getRequiredPropertyAs<
T> (String key, Class< T> targetType) → T -
Retrieves and converts the property
keyto typeT, or throws IllegalStateException if missing or invalid.inherited -
getReservedDefaultProfiles(
) → Set< String> -
Reserved Default Profiles
inherited
-
getSystemEnvironment(
) → Map< String, String> -
Returns the environment variables of the underlying OS.
inherited
-
getSystemProperties(
) → Map< String, String> -
Returns the system properties available to the Dart VM (if any),
such as those passed via
--defineor custom bootstrap logic.inherited -
isProfileActive(
String profile) → bool -
Checks Profile Activation
inherited
-
matchesProfiles(
List< String> profileExpressions) → bool -
Profile Expression Matcher
inherited
-
merge(
ConfigurableEnvironment parent) → void -
Merges another ConfigurableEnvironment into this one.
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 -
setActiveProfiles(
List< String> profiles) → void -
Replaces the current set of active profiles with the given list.
inherited
-
setConversionService(
ConfigurableConversionService conversionService) → void -
Replaces the underlying ConfigurableConversionService used for type conversions.
inherited
-
setDefaultProfiles(
List< String> profiles) → void -
Specify the set of profiles to be made active by default if no other profiles
are explicitly made active through {@link #setActiveProfiles}.
inherited
-
setEscapeCharacter(
Character? escapeCharacter) → void -
Sets the escape character used to ignore placeholder prefix and separator.
inherited
-
setIgnoreUnresolvableNestedPlaceholders(
bool ignoreUnresolvableNestedPlaceholders) → void -
Enables or disables ignoring unresolvable nested placeholders.
inherited
-
setPlaceholderPrefix(
String placeholderPrefix) → void -
Sets the prefix that identifies a placeholder in property values.
inherited
-
setPlaceholderSuffix(
String placeholderSuffix) → void -
Sets the suffix that identifies the end of a placeholder in property values.
inherited
-
setRequiredProperties(
List< String> requiredProperties) → void -
Sets the list of property names that are required to be present and non-null.
inherited
-
setValueSeparator(
String? valueSeparator) → void -
Sets the separator for default values within placeholders.
inherited
-
suggestions(
String key) → List< String> -
Configuration Suggestions
inherited
-
suppressGetenvAccess(
) → bool -
Suppresses System Environment Access
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
validateProfile(
String profile) → void -
Profile Name Validation
inherited
-
validateRequiredProperties(
) → void -
Validates that all required properties are present and non-null.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited