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 wrapper
  • DefaultApplicationArguments β€” standard implementation

🌍 Environment & Configuration

  • Environment β€” core environment contract
  • AbstractEnvironment β€” base implementation
  • ConfigurationPropertySource β€” config value provider interface
  • GlobalEnvironment β€” shared global environment instance
  • env β€” 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.