juneau-commons
The juneau-commons module is the foundational layer of the Juneau ecosystem. It has no framework dependencies — just Java — and provides the low-level utilities, collections, I/O helpers, reflection tools, settings management, and dependency-injection support that all other Juneau modules build on top of. Because every other Juneau module depends on it transitively, its classes are always on the classpath whenever you use Juneau.
| Maven | |
|---|---|
| Jar | juneau-commons-10.0.0.jar |
| OSGi | org.apache.juneau.common_10.0.0.jar |
| Links | Maven Central · Javadocs · Source |
Contents/Features
The juneau-commons module provides common utilities and APIs used across the Juneau ecosystem.
Key Packages:
- Utils (org.apache.juneau.commons.utils): General utility classes for strings, collections, classes, dates, files, and more
- Collections (org.apache.juneau.commons.collections): Enhanced collection utilities including fluent collections, multi-maps, filtered collections, and caching utilities
- Lang (org.apache.juneau.commons.lang): Language utilities including value wrappers, version management, string formatting, and state enums
- Reflection (org.apache.juneau.commons.reflect): Comprehensive reflection utilities for working with classes, methods, fields, and annotations
- Beans (org.apache.juneau.commons.bean): The format-independent bean-modeling layer — annotations and the introspection engine describing how Java beans are recognized, read, written, and mapped
- Settings (org.apache.juneau.commons.settings): Thread-local and global settings management with support for functional sources and stores
- Function (org.apache.juneau.commons.function): Functional programming utilities including higher-arity and checked-exception functional interfaces, tuples, and lazy/nullable suppliers
- Conversion (org.apache.juneau.commons.conversion): A lightweight, pluggable type-conversion engine that converts objects between types without a full marshalling context
- I/O (org.apache.juneau.commons.io): File and stream utilities, console support, MIME type detection, and path builders
- Inject (org.apache.juneau.commons.inject): JSR-330–aligned bean store + Spring-lite injection layer (
@Inject,@Named,@Qualifier,@Singleton,@Primary,@Order,@Bean,@Configuration,@Conditional,@PostConstruct,@PreDestroy, andProvider<T>) without compile-time dependencies onjakarta.inject-apiorjakarta.annotation-api - Simple Variable Language (org.apache.juneau.commons.svl): Recursive
$var{key}variable resolution with a built-in function catalog and reusable compiled templates - Http (org.apache.juneau.commons.http): Lightweight, dependency-free primitives for parsing and modeling HTTP header values — media types, content-negotiation ranges, and name/value parameters
- Http-Part (org.apache.juneau.commons.httppart): Shared enumerations and exception describing HTTP parts (query, path, header, form-data, body) for OpenAPI-schema-based serialization and parsing
- Concurrent (org.apache.juneau.commons.concurrent): Concurrency utilities including auto-closeable simple locks, read-write locks, and nullable atomic references
- Logging (org.apache.juneau.commons.logging):
RichLogger-based JUL extensions with configurable message generation, hierarchical capture propagation, and in-memory log capture for testing - Runtime (org.apache.juneau.commons.runtime): Lean accessors for command-line arguments and JAR manifest files
- Time (org.apache.juneau.commons.time): Time utilities for granular, precision-aware date/time handling
In This Section
📄️ 2.1.1. Utils Package
The org.apache.juneau.commons.utils package provides general-purpose utility classes for common operations including string manipulation, collection operations, class utilities, file operations, and more. It contains the most frequently used utility classes in the codebase — most notably Shorts (a terse one-import alias facade) and StringUtils, which are imported statically across the Juneau ecosystem.
📄️ 2.1.2. Collections Package
The org.apache.juneau.commons.collections package provides enhanced collection utilities that extend the standard Java Collections Framework with fluent APIs, specialized collection types, and caching capabilities.
📄️ 2.1.3. Lang Package
The org.apache.juneau.commons.lang package provides language utilities including value wrappers, version management, string formatting, state enums, and other common language constructs.
📄️ 2.1.4. Reflection Package
The org.apache.juneau.commons.reflect package provides comprehensive reflection utilities for working with classes, methods, fields, constructors, and annotations in a more convenient and type-safe way than the standard Java reflection APIs.
📄️ 2.1.5. Beans Package
The org.apache.juneau.commons.bean package provides Juneau's bean-modeling layer — the annotations and introspection engine that describe how Java beans are recognized, read, written, and mapped, independently of any particular marshalling format. The marshalling modules build on this layer through a small set of SPI seams so the bean model stays decoupled from serialization concerns.
📄️ 2.1.6. Settings Package
The org.apache.juneau.commons.settings package provides a thread-safe way to access system properties with support for global and per-thread overrides, making it useful for unit tests and configuration management.
📄️ 2.1.7. Function Package
The org.apache.juneau.commons.function package extends the standard java.util.function toolkit with higher-arity functional interfaces, checked-exception–friendly variants, small immutable tuples, and lazy/nullable suppliers used throughout the framework.
📄️ 2.1.8. Conversion Package
The org.apache.juneau.commons.conversion package provides a lightweight, pluggable type-conversion engine for converting objects between types without requiring a full marshalling context or session.
📄️ 2.1.9. I/O Package
The org.apache.juneau.commons.io package provides file and stream utilities, console support, MIME type detection, and path builders for working with files and I/O operations.
🗃️ 2.1.10. Inject Package
3 items
📄️ 2.1.11. Simple Variable Language
The org.apache.juneau.commons.svl package defines an API for a language called "Simple Variable
📄️ 2.1.12. Http Package
The org.apache.juneau.commons.http package provides lightweight, dependency-free primitives for parsing and modeling HTTP header values — media types, content-negotiation ranges, and name/value parameters — as defined by RFC 2616.
📄️ 2.1.13. Http-Part Package
The org.apache.juneau.commons.httppart package provides the shared enumerations and exception used to describe HTTP "parts" (query parameters, path variables, headers, form data, and request/response bodies) for OpenAPI-schema-based serialization and parsing.
📄️ 2.1.14. Concurrent Package
The org.apache.juneau.commons.concurrent package provides small concurrency helpers that make locks and atomic references work cleanly with try-with-resources and Optional-style APIs.
📄️ 2.1.15. Logging Package
The org.apache.juneau.commons.logging package now centers on RichLogger, a JUL-compatible logger wrapper with configurable message rendering, hierarchical capture propagation, and deterministic test-capture ergonomics.
📄️ 2.1.16. Runtime Package
The org.apache.juneau.commons.runtime package provides lean accessors for two common runtime inputs: command-line arguments and JAR manifest files.
📄️ 2.1.17. Time Package
The org.apache.juneau.commons.time package provides a precision-aware date/time type for granular time operations.
📄️ 2.1.18. BeanQuery Package
The org.apache.juneau.commons.beanquery package is a protocol-agnostic API for searching, sorting, projecting and paging rows of beans. The same query runs over an in-memory collection or, through the juneau-beanquery-sql module, a database table.