public class RestDocumentationGenerator extends Object
| Modifier and Type | Class and Description |
|---|---|
protected static class |
RestDocumentationGenerator.RequestMethodColors
Holder object for colors associated with request method;
|
| Constructor and Description |
|---|
RestDocumentationGenerator() |
| Modifier and Type | Method and Description |
|---|---|
protected static String |
createParametersBlock(MethodParameterBreakdown breakdown)
Create the table of parameters.
|
protected static String |
createUriBlock(ParsedMethod method,
RestDocumentationGenerator.RequestMethodColors colors)
Create block that displays REST service URI.
|
protected static String |
generateControllerDocumentation(ParsedController controller)
Generate documentation for a single controller.
|
protected static String |
generateNavigation(List<ParsedController> controllers)
Add the navigation panel.
|
protected static void |
generateRestDocumentation(List<ParsedController> controllers,
File resourcesFolder,
String outputFolder)
Generate documentation.
|
protected static RestDocumentationGenerator.RequestMethodColors |
getRequestMethodColors(ParsedMethod method)
Find colors associated with request method.
|
static void |
main(String[] args) |
protected static ParsedController |
parseController(Class<?> controller,
File resourcesFolder)
Parse information for a given controller.
|
protected static List<ParsedController> |
parseControllers(File resourcesFolder)
Parse all controllers using the
DocumentedController annotation. |
protected static void |
parseExamples(Method method,
ParsedMethod parsedMethod,
File resources)
Parse examples for method.
|
protected static ParsedMethod |
parseMethod(String baseUri,
Method method,
File resources)
Generate documentation for a documented method.
|
protected static List<ParsedParameter> |
parseParameters(Method method)
Parse method parameters.
|
protected static String |
readFile(File file)
Read contents of a file into a String.
|
public static void main(String[] args)
protected static List<ParsedController> parseControllers(File resourcesFolder) throws com.sitewhere.spi.SiteWhereException
DocumentedController annotation.resourcesFolder - com.sitewhere.spi.SiteWhereExceptionprotected static void generateRestDocumentation(List<ParsedController> controllers, File resourcesFolder, String outputFolder) throws com.sitewhere.spi.SiteWhereException
controllers - resourcesFolder - outputFolder - com.sitewhere.spi.SiteWhereExceptionprotected static String generateNavigation(List<ParsedController> controllers)
controllers - protected static String generateControllerDocumentation(ParsedController controller)
controller - protected static String createUriBlock(ParsedMethod method, RestDocumentationGenerator.RequestMethodColors colors)
method - colors - protected static RestDocumentationGenerator.RequestMethodColors getRequestMethodColors(ParsedMethod method)
method - protected static String createParametersBlock(MethodParameterBreakdown breakdown)
method - protected static ParsedController parseController(Class<?> controller, File resourcesFolder) throws com.sitewhere.spi.SiteWhereException
controller - resourcesFolder - com.sitewhere.spi.SiteWhereExceptionprotected static ParsedMethod parseMethod(String baseUri, Method method, File resources) throws com.sitewhere.spi.SiteWhereException
baseUri - method - com.sitewhere.spi.SiteWhereExceptionprotected static List<ParsedParameter> parseParameters(Method method) throws com.sitewhere.spi.SiteWhereException
method - com.sitewhere.spi.SiteWhereExceptionprotected static void parseExamples(Method method, ParsedMethod parsedMethod, File resources) throws com.sitewhere.spi.SiteWhereException
method - parsed - resources - com.sitewhere.spi.SiteWhereExceptionprotected static String readFile(File file) throws com.sitewhere.spi.SiteWhereException
file - com.sitewhere.spi.SiteWhereExceptionCopyright © 2016 SiteWhere, LLC.. All rights reserved.