|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public static interface Request.RequestBuilder
An interface used to build Request
instances, typically used in
JAX-RS filters. An initial instance may be obtained via FilterContext
that is passed to the filters.
Request
.
Method Summary | |
---|---|
Request.RequestBuilder |
accept(MediaType... types)
Add acceptable media types. |
Request.RequestBuilder |
accept(String... types)
Add acceptable media types. |
Request.RequestBuilder |
acceptLanguage(Locale... locales)
Add acceptable languages. |
Request.RequestBuilder |
acceptLanguage(String... locales)
Add acceptable languages. |
Request.RequestBuilder |
allow(Set<String> methods)
Set the list of allowed methods for the resource. |
Request.RequestBuilder |
allow(String... methods)
Set the list of allowed methods for the resource. |
Request |
build()
|
Request.RequestBuilder |
cacheControl(CacheControl cacheControl)
Set the cache control data of the message. |
Request.RequestBuilder |
clone()
Create a copy of the request builder preserving its state. |
Request.RequestBuilder |
cookie(Cookie cookie)
Add a cookie to be set. |
Request.RequestBuilder |
encoding(String encoding)
Set the message entity content encoding. |
Request.RequestBuilder |
entity(Object entity)
Set the request entity in the builder. |
Request.RequestBuilder |
entity(Object entity,
Annotation[] annotations)
Set the request entity in the builder. |
Request.RequestBuilder |
header(String name,
Object value)
Add an arbitrary header. |
Request.RequestBuilder |
language(Locale language)
Set the message entity language. |
Request.RequestBuilder |
language(String language)
Set the message entity language. |
Request.RequestBuilder |
method(String httpMethod)
Modify the HTTP method of the request. |
Request.RequestBuilder |
redirect(String uri)
|
Request.RequestBuilder |
redirect(URI uri)
|
Request.RequestBuilder |
redirect(UriBuilder uri)
|
Request.RequestBuilder |
replaceAll(RequestHeaders headers)
Replaces all existing headers with the newly supplied headers. |
Request.RequestBuilder |
type(MediaType type)
Set the message entity media type. |
Request.RequestBuilder |
type(String type)
Set the message entity media type. |
Request.RequestBuilder |
variant(Variant variant)
Set message entity representation metadata. |
Method Detail |
---|
Request.RequestBuilder allow(String... methods)
methods
- the methods to be listed as allowed for the resource,
if null
any existing allowed method list will be removed.
Request.RequestBuilder allow(Set<String> methods)
methods
- the methods to be listed as allowed for the resource,
if null
any existing allowed method list will be removed.
Request.RequestBuilder cacheControl(CacheControl cacheControl)
cacheControl
- the cache control directives, if null
any existing cache control directives will be removed.
Request.RequestBuilder encoding(String encoding)
encoding
- the content encoding of the message entity,
if null
any existing value for content encoding will be
removed.
Request.RequestBuilder header(String name, Object value)
name
- the name of the headervalue
- the value of the header, the header will be serialized
using a RuntimeDelegate.HeaderDelegate
if
one is available via RuntimeDelegate.createHeaderDelegate(java.lang.Class)
for the class of value
or using its toString
method
if a header delegate is not available. If value
is null
then all current headers of the same name will be removed.
Request.RequestBuilder replaceAll(RequestHeaders headers)
headers
- new headers to be set, if null
all existing
headers will be removed.
Request.RequestBuilder language(String language)
language
- the language of the message entity, if null
any
existing value for language will be removed.
Request.RequestBuilder language(Locale language)
language
- the language of the message entity, if null
any
existing value for type will be removed.
Request.RequestBuilder type(MediaType type)
type
- the media type of the message entity. If null
, any
existing value for type will be removed
Request.RequestBuilder type(String type)
type
- the media type of the message entity. If null
, any
existing value for type will be removed
Request.RequestBuilder variant(Variant variant)
variant
- metadata of the message entity, a null
value is
equivalent to a variant with all null
properties.
encoding(java.lang.String)
,
language(java.util.Locale)
,
type(javax.ws.rs.core.MediaType)
Request.RequestBuilder accept(MediaType... types)
types
- an array of the acceptable media types
Request.RequestBuilder accept(String... types)
types
- an array of the acceptable media types
Request.RequestBuilder acceptLanguage(Locale... locales)
locales
- an array of the acceptable languages
Request.RequestBuilder acceptLanguage(String... locales)
locales
- an array of the acceptable languages
Request.RequestBuilder cookie(Cookie cookie)
cookie
- to be set.
Request.RequestBuilder redirect(String uri)
Request.RequestBuilder redirect(URI uri)
Request.RequestBuilder redirect(UriBuilder uri)
Request.RequestBuilder method(String httpMethod)
httpMethod
- new method to be set on the request.
Request.RequestBuilder entity(Object entity)
GenericEntity
if preservation of its generic
type is required. Note that the entity can be also set as an
input stream
.
A specific entity media type can be set using one of the type(...)
methods.
entity
- the request entity.
entity(java.lang.Object, java.lang.annotation.Annotation[])
,
type(javax.ws.rs.core.MediaType)
,
type(java.lang.String)
Request.RequestBuilder entity(Object entity, Annotation[] annotations)
GenericEntity
if preservation of its generic
type is required. Note that the entity can be also set as an
input stream
.
A specific entity media type can be set using one of the type(...)
methods.
entity
- the request entity.annotations
- annotations that will be passed to the MessageBodyWriter
.
entity(java.lang.Object)
,
type(javax.ws.rs.core.MediaType)
,
type(java.lang.String)
Request.RequestBuilder clone()
request
headers
but the header values are shared with the original
RequestBuilder
instance. Similarly, entity instance is also
shared with the original RequestBuilder
instance.
Request build()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |