Top Description Methods
jakarta.ws.rs

public @Interface DefaultValue

extends Annotation
Annotations
@Target:PARAMETER, METHOD, FIELD
@Retention:RUNTIME
@Documented
Imports
java.lang.annotation.Documented, .ElementType, .Retention, .RetentionPolicy, .Target

Defines the default value of request meta-data that is bound using one of the following annotations: jakarta.ws.rs.PathParam, jakarta.ws.rs.QueryParam, jakarta.ws.rs.MatrixParam, jakarta.ws.rs.CookieParam, jakarta.ws.rs.FormParam, or jakarta.ws.rs.HeaderParam. The default value is used if the corresponding meta-data is not present in the request.

If the type of the annotated parameter is java.util.List, java.util.Set or java.util.SortedSet then the resulting collection will have a single entry mapped from the supplied default value.

If this annotation is not used and the corresponding meta-data is not present in the request, the value will be an empty collection for List, Set or SortedSet, null for other object types, and the Java-defined default for primitive types.

Authors
Paul Sandoz, Marc Hadley
Since
1.0
See Also
PathParam, QueryParam, FormParam, HeaderParam, MatrixParam, CookieParam

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

default value.
value
()

The specified default value.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

valueback to summary
public String value()

The specified default value.

Returns:String

default value.