Top Description Methods
org.springframework.messaging.handler.annotation

public @Interface Header

extends Annotation
Annotations
@Target:PARAMETER
@Retention:RUNTIME
@Documented
Imports
java.lang.annotation.Documented, .ElementType, .Retention, .RetentionPolicy, .Target, org.springframework.core.annotation.AliasFor

Annotation which indicates that a method parameter should be bound to a message header.
Authors
Rossen Stoyanchev, Sam Brannen
Since
4.0

Method Summary

Modifier and TypeMethod and Description
public String
defaultValue()

The default value to use as a fallback.

public String
name()

The name of the request header to bind to.

public boolean
required()

Whether the header is required.

public String
value()

Alias for name.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

defaultValueback to summary
public String defaultValue()

The default value to use as a fallback.

Supplying a default value implicitly sets required to false.

nameback to summary
public String name()

The name of the request header to bind to.

Annotations
@AliasFor:value
Since
4.2
requiredback to summary
public boolean required()

Whether the header is required.

Default is true, leading to an exception if the header is missing. Switch this to false if you prefer a null value in case of a header missing.

See Also
defaultValue
valueback to summary
public String value()

Alias for name.

Annotations
@AliasFor:name