Top Description Methods
javax.mvc.engine

public Interface ViewEngineContext

Imports
javax.mvc.Models, javax.ws.rs.container.ResourceInfo, javax.ws.rs.core.Configuration, .MediaType, .MultivaluedMap, .UriInfo, java.io.OutputStream, java.util.Locale

Contextual data used by a javax.mvc.engine.ViewEngine to process a view. This includes the view name, the models instance and the request and response objects from the container, among other data.

Authors
Santiago Pericas-Geertsen, Christian Kaltepoth
Since
1.0
See Also
javax.mvc.engine.ViewEngine

Method Summary

Modifier and TypeMethod and Description
public Configuration

Returns:

application's configuration.
getConfiguration
()

Returns the application's configuration.

public Locale

Returns:

the request locale
getLocale
()

Returns the request locale resolved for the current request.

public MediaType

Returns:

The media type
getMediaType
()

The media type to use for the response.

public Models

Returns:

the models instance.
getModels
()

Returns the models instance needed to process the view.

public OutputStream

Returns:

The output stream
getOutputStream
()

The output stream which should be used to write the result of processing a view.

public <
The expected type of the HTTP request object
T
>
T

Returns:

HTTP request object.
getRequest
(Class<T>
The expected type of the HTTP request object.
type
)

Returns the HTTP request object from the container.

public ResourceInfo

Returns:

the resource info for the current request.
getResourceInfo
()

Returns the javax.ws.rs.container.ResourceInfo instance containing information about the controller method matched in the current request.

public <
The expected type of the HTTP request object
T
>
T

Returns:

HTTP response object.
getResponse
(Class<T>
The expected type of the HTTP response object.
type
)

Returns the HTTP response object from the container.

public MultivaluedMap<String, Object>

Returns:

mutable multivalued map of response headers.
getResponseHeaders
()

Get the mutable response headers multivalued map.

public UriInfo

Returns:

the URI info for the current request.
getUriInfo
()

Returns the javax.ws.rs.core.UriInfo instance containing information about the current request URI.

public String

Returns:

the view.
getView
()

Returns the view.

Method Detail

getConfigurationback to summary
public Configuration getConfiguration()

Returns the application's configuration. The configuration provides access to properties such as javax.mvc.engine.ViewEngine#VIEW_FOLDER, which view engines must use to locate views.

Returns:Configuration

application's configuration.

See Also
javax.ws.rs.core.Configuration
getLocaleback to summary
public Locale getLocale()

Returns the request locale resolved for the current request.

Returns:Locale

the request locale

getMediaTypeback to summary
public MediaType getMediaType()

The media type to use for the response. Please note that ViewEngine implementations should respect the charset parameter of the media type when writing data to the output stream obtained from getOutputStream().

Returns:MediaType

The media type

getModelsback to summary
public Models getModels()

Returns the models instance needed to process the view.

Returns:Models

the models instance.

getOutputStreamback to summary
public OutputStream getOutputStream()

The output stream which should be used to write the result of processing a view.

Returns:OutputStream

The output stream

getRequestback to summary
public <T> T getRequest(Class<T> type)

Returns the HTTP request object from the container. The type of the request object depends on the environment. In a servlet environment you can use this method to get the HttpServletRequest object.

Parameters
<T>
The expected type of the HTTP request object
type:Class<T>

The expected type of the HTTP request object.

Returns:T

HTTP request object.

getResourceInfoback to summary
public ResourceInfo getResourceInfo()

Returns the javax.ws.rs.container.ResourceInfo instance containing information about the controller method matched in the current request.

Returns:ResourceInfo

the resource info for the current request.

See Also
javax.ws.rs.container.ResourceInfo
getResponseback to summary
public <T> T getResponse(Class<T> type)

Returns the HTTP response object from the container. The type of the response object depends on the environment. In a servlet environment you can use this method to get the HttpServletResponse object.

Please note that you should generally prefer using getOutputStream() and getResponseHeaders() to write the result of processing the view, because these methods are guaranteed to work in all supported environments.

Parameters
<T>
The expected type of the HTTP request object
type:Class<T>

The expected type of the HTTP response object.

Returns:T

HTTP response object.

getResponseHeadersback to summary
public MultivaluedMap<String, Object> getResponseHeaders()

Get the mutable response headers multivalued map. This map can be modified to change the HTTP response headers. Please note that changing the map will only have an effect on the headers if modifications are performed before data is written to the output stream obtained from getOutputStream().

Returns:MultivaluedMap<String, Object>

mutable multivalued map of response headers.

getUriInfoback to summary
public UriInfo getUriInfo()

Returns the javax.ws.rs.core.UriInfo instance containing information about the current request URI.

Returns:UriInfo

the URI info for the current request.

See Also
javax.ws.rs.core.UriInfo
getViewback to summary
public String getView()

Returns the view.

Returns:String

the view.