env library
The JetLeaf Framework provides core runtime primitives for building backend applications using Hapnium, including:
- application argument parsing
- environment and configuration management
- profile-based configuration
- framework-level exception handling
This library acts as the public entry point and re-exports the primary JetLeaf APIs so they can be consumed directly.
π§ Key Features
- Centralized environment abstraction (
Environment) - Global environment resolution for runtime configuration
- Multiple configuration property sources
- Built-in support for application arguments
- Profile activation (e.g.,
dev,prod,test)
π¦ Exports Overview
β Argument Handling
ApplicationArgumentsβ runtime arguments wrapperDefaultApplicationArgumentsβ standard implementation
π Environment & Configuration
Environmentβ core environment contractAbstractEnvironmentβ base implementationConfigurationPropertySourceβ config value provider interfaceGlobalEnvironmentβ shared global environment instanceenvβ convenience accessor for the active environment
π· Profiles
profilesβ profile utilities and runtime activation
β οΈ Exceptions
- JetLeaf framework-level exception definitions
π Licensing
This source is part of the JetLeaf Framework and protected under
the JetLeaf license. See the LICENSE file for terms.
Classes
- AbstractEnvironment
- Base class for creating environment implementations in JetLeaf.
- ApplicationArguments
- Defines the contract for accessing and parsing command-line arguments passed to an application.
- ConfigurableEnvironment
- A configurable extension of the Environment interface that allows mutation of environment internals such as active profiles and property sources.
- DefaultApplicationArguments
- Default implementation of ApplicationArguments that wraps command-line arguments and exposes them via a PropertySource-based backing system.
-
Env<
T> - A generic configuration property accessor for environment variables.
- Environment
- Environment Contract
- GlobalEnvironment
- A concrete implementation of AbstractEnvironment that represents the default runtime environment for most applications.
- Profiles
- A profile predicate used by Environment to determine if given profile expressions match the active/default profiles.
Mixins
- ConfigurationPropertySource
- A mixin that provides access to a globally attached Environment.
Exceptions / Errors
- DartLoadingException
- Exception thrown when Dart file loading fails.
- EnvironmentParsingException
- An Exception thrown when an error occurs during environment property parsing.
- MissingRequiredEnvironmentException
- Exception thrown when a required environment variable is not found.
- MissingRequiredPropertiesException
- Exception thrown when required properties are not found.