The cui-core-ui-model library provides a comprehensive set of framework-agnostic UI model components designed for building robust and maintainable user interface applications. It offers core functionality that can be used independently of JSF or any other web framework.
-
Type-safe wrapper for operation results (
ResultObject
) -
Standardized error codes and states
-
Comprehensive error detail support
-
Builder pattern for fluent API usage
-
Integration with message bundles
-
Consistent handling of display names
-
Internationalization support
-
Message formatting capabilities
-
Type-safe message parameter handling
-
Standardized service state management
-
Optional-based service access
-
Thread-safe operations
-
Error handling patterns
<dependency>
<groupId>de.cuioss</groupId>
<artifactId>cui-core-ui-model</artifactId>
</dependency>
// Create a result with the builder pattern
ResultObject<User> result = ResultObject.builder()
.result(user)
.state(ResultState.VALID)
.build();
// Handle different result states
if (result.isValid()) {
User user = result.getResult();
// Process valid result
} else {
result.getResultDetail().ifPresent(detail ->
// Handle error with appropriate UI feedback
messageProducer.addError(detail));
}
-
Framework Independence: Components work without specific UI frameworks
-
Type Safety: Strong typing to catch errors at compile time
-
Immutability: Thread-safe and side-effect free operations
-
Builder Pattern: Fluent APIs for object construction
-
Consistent Error Handling: Standardized approach to error management
-
de.cuioss.uimodel.result
: Result handling framework -
de.cuioss.uimodel.nameprovider
: Display name and message handling -
de.cuioss.uimodel.service
: Service integration patterns -
de.cuioss.uimodel.application
: Application lifecycle support
-
ResultObject
: Type-safe wrapper for operation results -
DisplayMessageProvider
: Localized message handling -
OptionalService
: Null-safe service access -
CuiProjectStage
: Application lifecycle management
For detailed documentation, please refer to:
-
JavaDoc documentation in the source code
-
Unit tests demonstrating usage patterns