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.
public final class ResolvedViewable<T> extends Viewable
A resolvedviewable. A resolved viewable is obtained from the resolving methods onViewableContextand has associated with it aTemplateProcessorthat is capable of processing a template identified by a template reference.- Author:
- Paul Sandoz, Michal Gajdos
-
-
Constructor Summary
Constructors Constructor Description ResolvedViewable(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MediaTypegetMediaType()Get the media type for which theview processorresolved the template reference.Class<?>getResolvingClass()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 Detail
-
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 Detail
-
writeTo
public void writeTo(OutputStream out, MultivaluedMap<String,Object> httpHeaders) throws IOException
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
public MediaType getMediaType()
Get the media type for which theview processorresolved the template reference.- Returns:
- final
media typeof the resolved viewable.
-
getResolvingClass
public Class<?> getResolvingClass()
Get resolving class.- Returns:
- Resolving class.
-
-