Advanced
Advanced features for type conversion, interceptors, validation, custom editors, and more.
Crest provides a rich set of advanced features beyond basic command definition. These capabilities let you build sophisticated CLI tools with custom type handling, cross-cutting concerns, input validation, and fine-grained control over the framework’s behavior.
- Type Conversion – How Crest converts CLI strings to Java types, including the conversion chain, built-in types, and domain wrapper types.
- Interceptors – Define cross-cutting concerns with
@CrestInterceptorand attach them to commands via direct reference or custom annotations. - Validation – Bean Validation (JSR-380) integration with built-in file validators and custom constraint support.
- Editors – Register custom
PropertyEditorimplementations with@Editorfor CLI parsing and table display. - Loader – The central registry for commands, interceptors, and editors, with
META-INF/servicesandMain.builder()integration. - Exit Codes – Control process exit codes with
@Exit-annotated exceptions.
Type Conversion
How Crest converts CLI string arguments to Java types using a chain of strategies, and how to leverage domain wrapper types.
Interceptors
Define cross-cutting concerns with @CrestInterceptor and attach them to commands via direct reference or custom annotations.
Validation
Bean Validation (JSR-380) integration with built-in file validators and custom constraint support.
Editors
Register custom PropertyEditor implementations with @Editor for CLI argument parsing and table cell formatting.
Loader
The central registry for commands, interceptors, and editors, with META-INF/services and Main.builder() integration.
Exit Codes
Control process exit codes with @Exit-annotated exceptions for structured CLI error handling.