ConfigurationProperty class final
Annotation used to bind externalized configuration properties
from the Environment into a Dart object.
Supports nested property binding, where nested classes are automatically populated from environment values.
Example
@ConfigurationProperty(prefix: 'server')
class ServerConfig {
late String host;
late int port;
late DatabaseConfig database;
}
class DatabaseConfig {
late String url;
late String username;
late String password;
}
// application.yaml
// server:
// host: localhost
// port: 8080
// database:
// url: jdbc:postgresql://localhost:5432/app
// username: admin
// password: secret
JetLeaf automatically constructs and populates both ServerConfig
and its nested DatabaseConfig.
- Inheritance
-
- Object
- Configuration
- ConfigurationProperty
Constructors
- ConfigurationProperty({String prefix = '', bool ignoreUnknownFields = true, bool validate = false})
-
Annotation used to bind externalized configuration properties
from the
Environmentinto a Dart object.const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- ignoreUnknownFields → bool
-
Whether to ignore unknown fields that are not present in the environment.
final
- prefix → String
-
The prefix used to map environment properties to this object’s fields.
final
- proxyPodMethods → bool
-
Specify whether @Pod methods should get proxied in order to enforce pod lifecycle behavior.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scopeResolver → ScopeMetadataResolver
-
Specify the scope metadata resolver to use for resolving scope metadata.
finalinherited
- validate → bool
-
Whether to validate all fields have matching environment values.
final
- value → String?
-
Optional configuration name
finalinherited
Methods
-
equalizedProperties(
) → List< Object?> -
Mixin-style contract for value-based equality,
hashCode, andtoString.override -
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