Annotation Type Mapping
Annotation for mapping Dubbo services to Rest endpoints.
Example usage:
@Mapping(value = "/example", method = HttpMethods.GET, produces = "application/json") String handleExample();
- See Also:
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionString[]Specifies the media types that the mapped handler consumes.booleanIndicates whether the mapping is enabled.String[]Specifies the request headers that must be present for this mapping to be invoked.Defines the HTTP methods supported by the mapped handler.String[]Specifies the request parameters that must be present for this mapping to be invoked.String[]Specifies the path patterns to be mapped.String[]Specifies the media types that the mapped handler produces.String[]Alias forpath().
-
Element Details
-
value
String[] valueAlias forpath(). The path patterns to be mapped. If not specified, the method or class name is used as the default.- Default:
{}
-
path
String[] pathSpecifies the path patterns to be mapped. If not specified, the method or class name is used as the default.- Default:
{}
-
method
HttpMethods[] methodDefines the HTTP methods supported by the mapped handler. Supports values like GET, POST, etc.- Default:
{}
-
params
String[] paramsSpecifies the request parameters that must be present for this mapping to be invoked. Example: "param1=value1", "param2".- Default:
{}
-
headers
String[] headersSpecifies the request headers that must be present for this mapping to be invoked. Example: "content-type=application/json".- Default:
{}
-
consumes
String[] consumesSpecifies the media types that the mapped handler consumes. Example: "application/json", "text/plain".- Default:
{}
-
produces
String[] producesSpecifies the media types that the mapped handler produces. Example: "application/json", "text/html".- Default:
{}
-
enabled
boolean enabledIndicates whether the mapping is enabled. Defaults totrue. If set tofalse, the mapping will be ignored.- Default:
true
-