@UnstableApi public interface DocServicePlugin
ServiceSpecifications of the supported Services.| Modifier and Type | Method and Description |
|---|---|
ServiceSpecification |
generateSpecification(Set<ServiceConfig> serviceConfigs,
DocServiceFilter filter)
Generates a new
ServiceSpecification that provides the information about the supported
Services. |
default String |
guessServiceMethodName(Object exampleRequest)
Guesses the name of the service method who handles the specified example request.
|
default String |
guessServiceName(Object exampleRequest)
Guesses the name of the service who handles the specified example request.
|
default Map<String,String> |
loadDocStrings(Set<ServiceConfig> serviceConfigs)
Loads the documentation strings that describes services and their methods, enums and their values and
structs/exceptions and their fields.
|
String |
name()
Returns the name of this plugin.
|
default String |
serializeExampleRequest(String serviceName,
String methodName,
Object exampleRequest)
Serializes the specified example request into a string.
|
default Set<Class<?>> |
supportedExampleRequestTypes()
Returns the
Set of the example request types supported by this plugin. |
Set<Class<? extends Service<?,?>>> |
supportedServiceTypes()
|
String name()
ServiceSpecification generateSpecification(Set<ServiceConfig> serviceConfigs, DocServiceFilter filter)
ServiceSpecification that provides the information about the supported
Services.serviceConfigs - the ServiceConfigs of the Services that are instances of the
supportedServiceTypes()filter - the DocServiceFilter that checks whether a method will be included while
building DocServicedefault Map<String,String> loadDocStrings(Set<ServiceConfig> serviceConfigs)
Map returned by this method will contain the
documentation strings identified by the key strings that conforms to one of the following formats:
"{service name}" - a docstring that describes a service"{service name}/{method name}" - a docstring that describes a service method"{service name}/{method name}/{parameter name}" - a docstring that describes
a service method parameter"{type name}" - a docstring that describes an enum, a struct or an exception"{type name}/{field name}" - a docstring that describes a field of an enum, a struct or
an exceptiondefault Set<Class<?>> supportedExampleRequestTypes()
Set of the example request types supported by this plugin.default String guessServiceName(Object exampleRequest)
exampleRequest - the example request object which is an instance of one of the Classes
returned by supportedExampleRequestTypes()null if failed to guess.default String guessServiceMethodName(Object exampleRequest)
exampleRequest - the example request object which is an instance of one of the Classes
returned by supportedExampleRequestTypes()null if failed to guess.default String serializeExampleRequest(String serviceName, String methodName, Object exampleRequest)
serviceName - the name of the servicemethodName - the name of the methodexampleRequest - the example requestnull if not able to serialize.Copyright © 2020 LeanCloud. All rights reserved.