Class ResolvedViewable<T>
java.lang.Object
org.glassfish.jersey.server.mvc.Viewable
org.glassfish.jersey.server.mvc.spi.ResolvedViewable<T>
- Type Parameters:
T- the type of the resolved template object.
A resolved
viewable.
A resolved viewable is obtained from the resolving methods on ViewableContext
and has associated with it a TemplateProcessor that is capable of processing a template identified by a template
reference.- Author:
- Paul Sandoz, Michal Gajdos
-
Constructor Summary
ConstructorsConstructorDescriptionResolvedViewable(TemplateProcessor<T> viewProcessor, T templateReference, Viewable viewable, MediaType mediaType) Create a resolved viewable.ResolvedViewable(TemplateProcessor<T> viewProcessor, T templateReference, Viewable viewable, Class<?> resolvingClass, MediaType mediaType) Create a resolved viewable. -
Method Summary
Modifier and TypeMethodDescriptionGet the media type for which theview processorresolved the template reference.Class<?>Get resolving class.voidwriteTo(OutputStream out, MultivaluedMap<String, Object> httpHeaders) Write the resolved viewable.Methods inherited from class org.glassfish.jersey.server.mvc.Viewable
getModel, getTemplateName, isTemplateNameAbsolute
-
Constructor Details
-
ResolvedViewable
public ResolvedViewable(TemplateProcessor<T> viewProcessor, T templateReference, Viewable viewable, MediaType mediaType) Create a resolved viewable.- Parameters:
viewProcessor- the view processor that resolved a template name to a template reference.templateReference- the template reference.viewable- the viewable that is resolved.mediaType- media type thetemplateReferenceshould be transformed into.
-
ResolvedViewable
public ResolvedViewable(TemplateProcessor<T> viewProcessor, T templateReference, Viewable viewable, Class<?> resolvingClass, MediaType mediaType) Create a resolved viewable.- Parameters:
viewProcessor- the view processor that resolved a template name to a template reference.templateReference- the template reference.viewable- the viewable that is resolved.resolvingClass- the resolving class that was used to resolve a relative template name into an absolute template name.mediaType- media type thetemplateReferenceshould be transformed into.
-
-
Method Details
-
writeTo
Write the resolved viewable. This method defers toTemplateProcessor.writeTo(Object, org.glassfish.jersey.server.mvc.Viewable, jakarta.ws.rs.core.MediaType, jakarta.ws.rs.core.MultivaluedMap, java.io.OutputStream)to write the viewable utilizing the template reference.- Parameters:
out- the output stream that the view processor writes to.- Throws:
IOException- if there was an error processing the template.
-
getMediaType
Get the media type for which theview processorresolved the template reference.- Returns:
- final
media typeof the resolved viewable.
-
getResolvingClass
Get resolving class.- Returns:
- Resolving class.
-