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 onViewableContext
and has associated with it aTemplateProcessor
that 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, jakarta.ws.rs.core.MediaType mediaType)
Create a resolved viewable.ResolvedViewable(TemplateProcessor<T> viewProcessor, T templateReference, Viewable viewable, Class<?> resolvingClass, jakarta.ws.rs.core.MediaType mediaType)
Create a resolved viewable.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description jakarta.ws.rs.core.MediaType
getMediaType()
Get the media type for which theview processor
resolved the template reference.Class<?>
getResolvingClass()
Get resolving class.void
writeTo(OutputStream out, jakarta.ws.rs.core.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, jakarta.ws.rs.core.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 thetemplateReference
should be transformed into.
-
ResolvedViewable
public ResolvedViewable(TemplateProcessor<T> viewProcessor, T templateReference, Viewable viewable, Class<?> resolvingClass, jakarta.ws.rs.core.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 thetemplateReference
should be transformed into.
-
-
Method Detail
-
writeTo
public void writeTo(OutputStream out, jakarta.ws.rs.core.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 jakarta.ws.rs.core.MediaType getMediaType()
Get the media type for which theview processor
resolved the template reference.- Returns:
- final
media type
of the resolved viewable.
-
getResolvingClass
public Class<?> getResolvingClass()
Get resolving class.- Returns:
- Resolving class.
-
-