Package io.micronaut.views
Class DefaultViewsRendererLocator
java.lang.Object
io.micronaut.views.DefaultViewsRendererLocator
- All Implemented Interfaces:
ViewsRendererLocator
Default implementation of
ViewsRendererLocator
.- Since:
- 3.0.0
- Author:
- Sergio del Amo
-
Constructor Summary
ConstructorDescriptionDefaultViewsRendererLocator
(io.micronaut.context.ApplicationContext applicationContext) -
Method Summary
Modifier and TypeMethodDescription@NonNull Optional<ViewsRenderer>
resolveViewsRenderer
(@NonNull String view, @NonNull String contentType, @Nullable Object body)
-
Constructor Details
-
DefaultViewsRendererLocator
public DefaultViewsRendererLocator(io.micronaut.context.ApplicationContext applicationContext)
-
-
Method Details
-
resolveViewsRenderer
@NonNull public @NonNull Optional<ViewsRenderer> resolveViewsRenderer(@NonNull @NonNull String view, @NonNull @NonNull String contentType, @Nullable @Nullable Object body) throws ViewNotFoundException - Specified by:
resolveViewsRenderer
in interfaceViewsRendererLocator
- Parameters:
view
- view NamecontentType
- Response Content Typebody
- Response Body- Returns:
- The
ViewsRenderer
able to resolve the view with the response body and media type - Throws:
ViewNotFoundException
- if the view is not found for the resolvedViewsRenderer
s.
-