Package io.micronaut.views
Class DefaultViewsModelDecorator
java.lang.Object
io.micronaut.views.DefaultViewsModelDecorator
- All Implemented Interfaces:
ViewsModelDecorator
@Singleton
@Requires(classes=io.micronaut.http.HttpRequest.class)
public class DefaultViewsModelDecorator
extends Object
implements ViewsModelDecorator
Default implementation of
ViewsModelDecorator
which enhances a model by running it by all applicable ViewModelProcessors ViewModelProcessor
.- Since:
- 3.0.0
- Author:
- Sergio del Amo
-
Constructor Summary
ConstructorDescriptionDefaultViewsModelDecorator
(io.micronaut.context.ApplicationContext applicationContext) -
Method Summary
Modifier and TypeMethodDescriptionvoid
decorate
(io.micronaut.http.HttpRequest<?> request, @NonNull ModelAndView<?> modelAndView) Enhances a model by running it by all applicable ViewModelProcessorsViewModelProcessor
.
-
Constructor Details
-
DefaultViewsModelDecorator
public DefaultViewsModelDecorator(io.micronaut.context.ApplicationContext applicationContext)
-
-
Method Details
-
decorate
public void decorate(io.micronaut.http.HttpRequest<?> request, @NonNull @NonNull ModelAndView<?> modelAndView) Enhances a model by running it by all applicable ViewModelProcessorsViewModelProcessor
.- Specified by:
decorate
in interfaceViewsModelDecorator
- Parameters:
request
- The http request this model relates to.modelAndView
- The ModelAndView to be enhanced.
-