@Documented @Target(value=PARAMETER) @Retention(value=RUNTIME) @Inherited public @interface Path
@RestMethod
annotated method to identify it as a variable
in a URL path pattern converted to a POJO.
The RestRequest
and RestResponse
parameters, and are specified in the same order as the
variables in the URL path pattern.
The following example is equivalent to the previous example.
If the order of parameters is not the default order shown above, the attribute names must be specified (since
parameter names are lost during compilation).
The following example is equivalent to the previous example, except the parameter order has been switched, requiring
the use of the
You can also use {#}
notation to specify path parameters without specifying names.
Modifier and Type | Optional Element and Description |
---|---|
String |
name
URL path variable name.
|
Class<? extends HttpPartParser> |
parser
Specifies the
HttpPartParser class used for parsing values from strings. |
String |
value
A synonym for
name() . |
public abstract Class<? extends HttpPartParser> parser
HttpPartParser
class used for parsing values from strings.
The default value for this parser is inherited from the servlet/method which defaults to UonPartParser
.
You can use SimplePartParser
to parse POJOs that are directly convertible from Strings
.
Copyright © 2018 Apache. All rights reserved.