public abstract class SelfRegisteringRSDocProvider extends Object implements RSDocProvider
RSDocProvider
, which
extracts the required Swagger Resource Listings and
API Declaration JSON documents from the enclosing JAR file.
By convention, resource.json
will be used for resource listing and
the rest of the *.json
files will be used as API declarations. Base
names of the files will be used as the API name.
Modifier | Constructor and Description |
---|---|
protected |
SelfRegisteringRSDocProvider(String name,
String path,
ClassLoader loader)
Creates a new documentation provider.
|
Modifier and Type | Method and Description |
---|---|
protected void |
bindRSDocRegistry(RSDocRegistry s)
Hook for self-registering when RSDocRegistry service becomes available.
|
InputStream |
declaration(String resource)
Gets the REST API documentation for the specified service name.
|
String |
name()
Gets the REST API provider name.
|
InputStream |
resources()
Gets the root document for the REST API services offered by this
provider.
|
protected void |
stop()
Unregisters self when deactivated.
|
protected void |
unbindRSDocRegistry(RSDocRegistry s)
Hook for withdrawing RSDocRegistry service.
|
protected SelfRegisteringRSDocProvider(String name, String path, ClassLoader loader)
name
- name of the REST API documentation providerpath
- path to the Swagger Resource Listing
and API Declaration JSON resourcesloader
- class loader to be used for locating resourcesprotected void bindRSDocRegistry(RSDocRegistry s)
s
- newly advertised registry serviceprotected void unbindRSDocRegistry(RSDocRegistry s)
s
- registry service being revoked@Deactivate protected void stop()
public String name()
RSDocProvider
name
in interface RSDocProvider
public InputStream resources()
RSDocProvider
https://github.com/wordnik/swagger-core/wiki/Resource-Listing
resources
in interface RSDocProvider
public InputStream declaration(String resource)
RSDocProvider
https://github.com/wordnik/swagger-core/wiki/API-Declaration
declaration
in interface RSDocProvider
resource
- REST API resource nameCopyright © 2015. All Rights Reserved.