public class BasicRestInfoProvider extends Object implements RestInfoProvider
RestInfoProvider
.
Subclasses can override these methods to tailor how HTTP REST resources are documented.
RestInfoProvider.Null
Constructor and Description |
---|
BasicRestInfoProvider(RestContext context)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
getDescription(RestRequest req)
Returns the localized description of this REST resource.
|
String |
getMethodDescription(Method method,
RestRequest req)
Returns the localized description of the specified java method on this servlet.
|
String |
getMethodSummary(Method method,
RestRequest req)
Returns the localized summary of the specified java method on this servlet.
|
String |
getSiteName(RestRequest req)
Returns the localized site name of this REST resource.
|
Swagger |
getSwagger(RestRequest req)
Returns the localized swagger for this REST resource.
|
String |
getTitle(RestRequest req)
Returns the localized title of this REST resource.
|
public BasicRestInfoProvider(RestContext context)
context
- The resource context.public Swagger getSwagger(RestRequest req) throws Exception
Subclasses can override this method to customize the Swagger.
getSwagger
in interface RestInfoProvider
req
- The incoming HTTP request.Exception
public String getMethodSummary(Method method, RestRequest req) throws Exception
Subclasses can override this method to provide their own summary.
The default implementation returns the value from the following locations (whichever matches first):
@RestMethod.summary()
annotation.
@RestResource.messages()
on the resource class, then any parent classes.
@RestMethod.summary()
annotation.
getMethodSummary
in interface RestInfoProvider
method
- The Java method annotated with @RestMethod
.req
- The current request.Exception
public String getMethodDescription(Method method, RestRequest req) throws Exception
Subclasses can override this method to provide their own description.
The default implementation returns the value from the following locations (whichever matches first):
@RestMethod.description()
annotation.
@RestResource.messages()
on the resource class, then any parent classes.
@RestMethod.description()
annotation.
getMethodDescription
in interface RestInfoProvider
method
- The Java method annotated with @RestMethod
.req
- The current request.Exception
public String getSiteName(RestRequest req) throws Exception
Subclasses can override this method to provide their own site name.
The default implementation returns the value from the following locations (whichever matches first):
@RestResource.siteName()
annotation on this class, and then any parent classes.
@RestResource.messages()
on the resource class, then any parent classes.
@RestResource.siteName()
annotation.
getSiteName
in interface RestInfoProvider
req
- The current request.Exception
public String getTitle(RestRequest req) throws Exception
Subclasses can override this method to provide their own title.
The default implementation returns the value from the following locations (whichever matches first):
@RestResource.siteName()
annotation on this class, and then any parent classes.
@RestResource.messages()
on the resource class, then any parent classes.
@RestResource.title()
annotation.
getTitle
in interface RestInfoProvider
req
- The current request.Exception
public String getDescription(RestRequest req) throws Exception
Subclasses can override this method to provide their own description.
The default implementation returns the value from the following locations (whichever matches first):
@RestResource.description()
annotation on this class, and then any parent classes.
@RestResource.messages()
on the resource class, then any parent classes.
@RestResource.description()
annotation.
getDescription
in interface RestInfoProvider
req
- The current request.Exception
Copyright © 2018 Apache. All rights reserved.