Example Usage

For example:

public Order addItem(Product product, @ParameterLayout(named="Quantity") int quantity) {
    if(productRepository.stockLevel(product) == 0) {
        messageService.warnUser(
            product.getDescription() + " out of stock; order fulfillment may be delayed");
    }
    ...
}

i18n

Messages and warnings can optionally be translated according to the locale of the current user.

The contextClass and contextMethod parameters provided by the framework are used to create a context string for translation, eg "com.mycompany.Customer#placeOrder".

For the "big picture" and further details on the framework’s i18n support, can be found in a chapter in the user guide.