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 RestInfoProviderreq - The incoming HTTP request.Exception - Error occurred.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.
@Rest(messages)
on the resource class, then any parent classes.
@RestMethod(summary) annotation.
getMethodSummary in interface RestInfoProvidermethod - The Java method annotated with @RestMethod.req - The current request.Exception - Error occurred.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.
@Rest(messages)
on the resource class, then any parent classes.
@RestMethod(description) annotation.
getMethodDescription in interface RestInfoProvidermethod - The Java method annotated with @RestMethod.req - The current request.Exception - Error occurred.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):
@Rest(siteName) annotation on this class, and then any parent classes.
@Rest(messages)
on the resource class, then any parent classes.
@Rest(siteName) annotation.
getSiteName in interface RestInfoProviderreq - The current request.Exception - Error occurred.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):
@Rest(siteName) annotation on this class, and then any parent classes.
@Rest(messages)
on the resource class, then any parent classes.
@Rest(title) annotation.
getTitle in interface RestInfoProviderreq - The current request.Exception - Error occurred.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):
@Rest(description) annotation on this class, and then any parent classes.
@Rest(messages)
on the resource class, then any parent classes.
@Rest(description) annotation.
getDescription in interface RestInfoProviderreq - The current request.Exception - Error occurred.Copyright © 2016–2019 The Apache Software Foundation. All rights reserved.