|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.jersey.message.internal.HeadersFactory
public final class HeadersFactory
Utility class supporting the processing of message headers.
| Method Summary | ||
|---|---|---|
static String |
asHeaderString(List<Object> values,
RuntimeDelegate rd)
Converts a list of message header values to a single string value (with individual values separated by ','). |
|
static String |
asString(Object headerValue,
RuntimeDelegate rd)
Convert a message header value, represented as a general object, to it's string representation. |
|
static MultivaluedMap<String,String> |
asStringHeaders(MultivaluedMap<String,Object> headers)
Returns string view of passed headers. |
|
static List<String> |
asStringList(List<Object> headerValues,
RuntimeDelegate rd)
Returns string view of list of header values. |
|
static AbstractMultivaluedMap<String,String> |
createInbound()
Create an empty inbound message headers container. |
|
static AbstractMultivaluedMap<String,Object> |
createOutbound()
Create an empty outbound message headers container. |
|
static
|
empty()
Get immutable empty message headers container. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static AbstractMultivaluedMap<String,String> createInbound()
public static <V> MultivaluedMap<String,V> empty()
V - header value type. Typically Object in case of the outbound
headers and String in case of the inbound headers.
public static AbstractMultivaluedMap<String,Object> createOutbound()
public static String asString(Object headerValue,
RuntimeDelegate rd)
null,
this method returns null.
This method defers to RuntimeDelegate.createHeaderDelegate(java.lang.Class to
obtain a RuntimeDelegate.HeaderDelegate to convert the value to a String.
If a RuntimeDelegate.HeaderDelegate is not found then the toString()
method on the header object is utilized.
headerValue - the header value represented as an object.rd - runtime delegate instance to be used for header delegate
retrieval. If null, a default RuntimeDelegate
instance will be obtained and
used.
null
if the supplied header value is null.
public static List<String> asStringList(List<Object> headerValues,
RuntimeDelegate rd)
headerValues - header values.rd - RuntimeDelegate instance or null (in that case RuntimeDelegate.getInstance()
will be called for before element conversion.
public static MultivaluedMap<String,String> asStringHeaders(MultivaluedMap<String,Object> headers)
headers - headers.
null if {code headers} input parameter is null.
public static String asHeaderString(List<Object> values,
RuntimeDelegate rd)
',').
Each single header value is converted to String using a
RuntimeDelegate.HeaderDelegate if one is available
via RuntimeDelegate.createHeaderDelegate(java.lang.Class)
for the header value class or using its toString() method if a header
delegate is not available.
values - list of individual header values.rd - RuntimeDelegate instance or null (in that case RuntimeDelegate.getInstance()
will be called for before conversion of elements).
null,
null is returned. If the list of values is empty, an empty string is returned.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||