Interface ViewableContext


@Contract @ConstrainedTo(SERVER) public interface ViewableContext
The context for resolving an instance of Viewable to an instance of ResolvedViewable.

Note: resolveViewable(org.glassfish.jersey.server.mvc.Viewable, jakarta.ws.rs.core.MediaType, Class, TemplateProcessor) method may be called multiple times (combination of all the calculated possible media types of the response with all found template processors).

Author:
Paul Sandoz, Michal Gajdos
  • Method Details

    • resolveViewable

      ResolvedViewable resolveViewable(Viewable viewable, MediaType mediaType, Class<?> resourceClass, TemplateProcessor templateProcessor)
      Resolve given viewable using mediaType, resourceClass and templateProcessor.

      If the template name of the viewable is not absolute then the given resourceClass may be utilized to resolve the relative template name into an absolute template name.

        resourceClass contains class of the matched resource.
      Parameters:
      viewable - viewable to be resolved.
      mediaType - media type the viewable may be transformed into.
      resourceClass - resource class.
      templateProcessor - template processor to be used.
      Returns:
      resolved viewable or null if the viewable cannot be resolved.