public class Raml extends Object
| Constructor and Description |
|---|
Raml() |
| Modifier and Type | Method and Description |
|---|---|
static Raml |
build(Raml base,
List<RouteMethod> routes)
Build a
Raml object from list of RouteMethod. |
RamlType |
define(Type type)
Register a Java type and produces an equivalent RAML type.
|
RamlType |
define(Type javaType,
RamlType baseType)
Define/map a custom Java type to RAML type.
|
String |
getBaseUri()
RAML base uri.
|
List<String> |
getMediaType()
Get media types.
|
List<String> |
getProtocols()
Get protocols.
|
Map<String,RamlPath> |
getResources()
Get resources.
|
String |
getTitle()
RAML title.
|
Map<String,RamlType> |
getTypes()
RAML types.
|
String |
getVersion()
RAML version.
|
RamlPath |
path(String pattern)
Get a path for the given pattern.
|
void |
setBaseUri(String baseUri)
Set base uri.
|
void |
setMediaType(List<String> mediaType)
Set media types.
|
void |
setProtocols(List<String> protocols)
Set protocols.
|
void |
setResources(Map<String,RamlPath> resources)
Set RAML paths.
|
void |
setTitle(String title)
Set RAML title.
|
void |
setVersion(String version)
Set RAML version.
|
String |
toYaml()
Convert this RAML object to Yaml.
|
public String getTitle()
public void setTitle(String title)
title - RAML title.public String getVersion()
public void setVersion(String version)
version - RAML version.public String getBaseUri()
public void setBaseUri(String baseUri)
baseUri - Base uri.public void setMediaType(List<String> mediaType)
mediaType - Media types.public void setProtocols(List<String> protocols)
protocols - Protocols.public RamlPath path(String pattern)
pattern - Pattern.public RamlType define(Type javaType, RamlType baseType)
RamlType uuid = raml.define(UUID.class, RamlType.STRING);
uuid.setPattern("...");
javaType - Java type.baseType - RAML base type.public RamlType define(Type type)
type - Java type.public void setResources(Map<String,RamlPath> resources)
resources - RAML paths.public String toYaml() throws IOException
IOException - If something goes wrong.public static Raml build(Raml base, List<RouteMethod> routes)
Raml object from list of RouteMethod.base - Base raml (might be null).routes - List of routes.Copyright © 2021. All rights reserved.