forked from jooby-project/jooby
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathParam.java
More file actions
43 lines (38 loc) · 997 Bytes
/
Param.java
File metadata and controls
43 lines (38 loc) · 997 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/**
* Jooby https://jooby.io
* Apache License Version 2.0 https://jooby.io/LICENSE.txt
* Copyright 2014 Edgar Espina
*/
package io.jooby.annotations;
import io.jooby.ParamSource;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Allow access to a parameter from MVC route method and from multiple sources.
* <p>
* The order of {@link ParamSource}s defines the search priority.
*
* <pre>{@code
* public String search(@Param({ ParamSource.QUERY, ParamSource.PATH }) String q) {
* ...
* }
* }</pre>
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.PARAMETER)
public @interface Param {
/**
* Parameter name.
*
* @return Parameter name.
*/
String name() default "";
/**
* Parameter sources to search in, the order defines the search priority.
*
* @return Parameter sources to search in.
*/
ParamSource[] value();
}