@Documented @Target(value={PARAMETER,FIELD,METHOD}) @Retention(value=RUNTIME) @Inherited public @interface Header
The annotation can also be applied to a bean property field or getter when the argument is annotated with
@RequestBean
:
The name()
and value()
elements are synonyms for specifying the header name.
Only one should be used.
The following annotations are fully equivalent:
Modifier and Type | Optional Element and Description |
---|---|
String |
name
The HTTP header name.
|
Class<? extends HttpPartSerializer> |
serializer
Specifies the
HttpPartSerializer class used for serializing values to strings. |
boolean |
skipIfEmpty
Skips this value if it's an empty string or empty collection/array.
|
String |
value
A synonym for
name() . |
public abstract String name
A blank value (the default) indicates to reuse the bean property name when used on a request bean property.
The value should be either
A blank value (the default) has the following behavior:
NameValuePairs
, Map
, or a bean,
then it's the equivalent to
public abstract boolean skipIfEmpty
Note that
public abstract Class<? extends HttpPartSerializer> serializer
HttpPartSerializer
class used for serializing values to strings.
The default value defaults to the using the part serializer defined on the @RequestBean
annotation,
then on the client which by default is UrlEncodingSerializer
.
This annotation is provided to allow values to be custom serialized.
Copyright © 2018 Apache. All rights reserved.