public class RamlGenerator extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
logger
Class Logger
|
| Constructor and Description |
|---|
RamlGenerator()
Default constructor.
|
RamlGenerator(ResourceParser scanner) |
| Modifier and Type | Method and Description |
|---|---|
protected List<RamlDocumentationItem> |
generateDocuments(Set<ApiDocumentMetadata> documents)
Parses the list of document models and adds them as RAML documentItem nodes in the RAML document.
|
RamlGenerator |
generateRamlForClasses(String title,
String version,
String baseUri,
Class<?>[] classesToGenerate,
Set<ApiDocumentMetadata> documents)
Parses classes array supplied and builds a Raml Model from any request mappings defined inside
|
RamlRoot |
getRaml()
Returns the RAML Model
|
File |
getRamlOutputFile(String path)
Takes the absolute path and gets the Raml file to be created
|
File |
outputRamlToFile(String path,
Boolean createPathIfMissing,
Boolean removeOldOutput)
Emits the RAML model into its string representation and saves it as a file in the specified path
|
String |
outputRamlToString()
Emits the RAML model into its string representation
|
protected String |
postProcessRaml(String preRaml)
Raml post-processor that will be run before the final RAML string is output to overcome a limitation due to
character escaping.
|
void |
setRamlMediaType(String mediaType)
Adds a global media type to the document
|
public RamlGenerator()
public RamlGenerator(ResourceParser scanner)
scanner - The resource parsing engine. Only required for RAML generationpublic void setRamlMediaType(String mediaType)
mediaType - The default media typepublic RamlGenerator generateRamlForClasses(String title, String version, String baseUri, Class<?>[] classesToGenerate, Set<ApiDocumentMetadata> documents)
title - Document Titleversion - Version of the ApibaseUri - Base uri of the api at runtimeclassesToGenerate - List of classes to parsedocuments - A set of documents to be includedprotected List<RamlDocumentationItem> generateDocuments(Set<ApiDocumentMetadata> documents)
documents - A set of metadata identifying the documents to be includedprotected String postProcessRaml(String preRaml)
preRaml - The raw RAML as a string before processing has been appliedpublic String outputRamlToString()
public File outputRamlToFile(String path, Boolean createPathIfMissing, Boolean removeOldOutput) throws FileNotFoundException
path - The path to which the RAML document will be savedcreatePathIfMissing - Indicates if the path and/or file should be created if it doesn't existremoveOldOutput - Indicates if we will empty the output directory before generation occursFileNotFoundException - if the supplied path does not existpublic File getRamlOutputFile(String path)
path - The path for the raml file to be saved inpublic RamlRoot getRaml()
Copyright © 2017. All rights reserved.