public abstract class HypermediaDocumentation extends Object
Modifier and Type | Method and Description |
---|---|
static LinkExtractor |
atomLinks()
Returns a
LinkExtractor capable of extracting links in Atom format where
the links are found in an array named links . |
static LinkExtractor |
halLinks()
Returns a
LinkExtractor capable of extracting links in Hypermedia
Application Language (HAL) format where the links are found in a map named
_links . |
static LinksSnippet |
links(LinkDescriptor... descriptors)
Returns a new
Snippet that will document the links in the API operation's
response. |
static LinksSnippet |
links(LinkExtractor linkExtractor,
LinkDescriptor... descriptors)
Returns a new
Snippet that will document the links in the API operation's
response. |
static LinksSnippet |
links(LinkExtractor linkExtractor,
List<LinkDescriptor> descriptors)
Returns a new
Snippet that will document the links in the API operation's
response. |
static LinksSnippet |
links(LinkExtractor linkExtractor,
Map<String,Object> attributes,
LinkDescriptor... descriptors)
Returns a new
Snippet that will document the links in the API operation's
response. |
static LinksSnippet |
links(LinkExtractor linkExtractor,
Map<String,Object> attributes,
List<LinkDescriptor> descriptors)
Returns a new
Snippet that will document the links in the API operation's
response. |
static LinksSnippet |
links(List<LinkDescriptor> descriptors)
Returns a new
Snippet that will document the links in the API operation's
response. |
static LinksSnippet |
links(Map<String,Object> attributes,
LinkDescriptor... descriptors)
Returns a new
Snippet that will document the links in the API call's
response. |
static LinksSnippet |
links(Map<String,Object> attributes,
List<LinkDescriptor> descriptors)
Returns a new
Snippet that will document the links in the API call's
response. |
static LinkDescriptor |
linkWithRel(String rel)
Creates a
LinkDescriptor that describes a link with the given rel . |
static LinksSnippet |
relaxedLinks(LinkDescriptor... descriptors)
Returns a new
Snippet that will document the links in the API operation's
response. |
static LinksSnippet |
relaxedLinks(LinkExtractor linkExtractor,
LinkDescriptor... descriptors)
Returns a new
Snippet that will document the links in the API operation's
response. |
static LinksSnippet |
relaxedLinks(LinkExtractor linkExtractor,
List<LinkDescriptor> descriptors)
Returns a new
Snippet that will document the links in the API operation's
response. |
static LinksSnippet |
relaxedLinks(LinkExtractor linkExtractor,
Map<String,Object> attributes,
LinkDescriptor... descriptors)
Returns a new
Snippet that will document the links in the API operation's
response. |
static LinksSnippet |
relaxedLinks(LinkExtractor linkExtractor,
Map<String,Object> attributes,
List<LinkDescriptor> descriptors)
Returns a new
Snippet that will document the links in the API operation's
response. |
static LinksSnippet |
relaxedLinks(List<LinkDescriptor> descriptors)
Returns a new
Snippet that will document the links in the API operation's
response. |
static LinksSnippet |
relaxedLinks(Map<String,Object> attributes,
LinkDescriptor... descriptors)
Returns a new
Snippet that will document the links in the API call's
response. |
static LinksSnippet |
relaxedLinks(Map<String,Object> attributes,
List<LinkDescriptor> descriptors)
Returns a new
Snippet that will document the links in the API call's
response. |
public static LinkDescriptor linkWithRel(String rel)
LinkDescriptor
that describes a link with the given rel
.rel
- The rel of the linkLinkDescriptor
ready for further configurationpublic static LinksSnippet links(LinkDescriptor... descriptors)
Snippet
that will document the links in the API operation's
response. Links will be extracted from the response automatically based on its
content type and will be documented using the given descriptors
.
If a link is present in the response, but is not documented by one of the descriptors, a failure will occur when the snippet is invoked. Similarly, if a link is documented, is not marked as optional, and is not present in the response, a failure will also occur.
If you do not want to document a link, a link descriptor can be marked as
IgnorableDescriptor.ignored
. This will prevent it from appearing in the
generated snippet while avoiding the failure described above.
If a descriptor does not have a description
, the title
of the link will be used. If the
link does not have a title a failure will occur.
descriptors
- the descriptions of the response's linkspublic static LinksSnippet links(List<LinkDescriptor> descriptors)
Snippet
that will document the links in the API operation's
response. Links will be extracted from the response automatically based on its
content type and will be documented using the given descriptors
.
If a link is present in the response, but is not documented by one of the descriptors, a failure will occur when the snippet is invoked. Similarly, if a link is documented, is not marked as optional, and is not present in the response, a failure will also occur.
If you do not want to document a link, a link descriptor can be marked as
IgnorableDescriptor.ignored
. This will prevent it from appearing in the
generated snippet while avoiding the failure described above.
If a descriptor does not have a description
, the title
of the link will be used. If the
link does not have a title a failure will occur.
descriptors
- the descriptions of the response's linkspublic static LinksSnippet relaxedLinks(LinkDescriptor... descriptors)
Snippet
that will document the links in the API operation's
response. Links will be extracted from the response automatically based on its
content type and will be documented using the given descriptors
.
If a link is documented, is not marked as optional, and is not present in the response, a failure will occur. Any undocumented links will be ignored.
If a descriptor does not have a description
, the title
of the link will be used. If the
link does not have a title a failure will occur.
descriptors
- the descriptions of the response's linkspublic static LinksSnippet relaxedLinks(List<LinkDescriptor> descriptors)
Snippet
that will document the links in the API operation's
response. Links will be extracted from the response automatically based on its
content type and will be documented using the given descriptors
.
If a link is documented, is not marked as optional, and is not present in the response, a failure will occur. Any undocumented links will be ignored.
If a descriptor does not have a description
, the title
of the link will be used. If the
link does not have a title a failure will occur.
descriptors
- the descriptions of the response's linkspublic static LinksSnippet links(Map<String,Object> attributes, LinkDescriptor... descriptors)
Snippet
that will document the links in the API call's
response. The given attributes
will be available during snippet generation.
Links will be extracted from the response automatically based on its content type
and will be documented using the given descriptors
.
If a link is present in the response, but is not documented by one of the descriptors, a failure will occur when the snippet is invoked. Similarly, if a link is documented, is not marked as optional, and is not present in the response, a failure will also occur.
If you do not want to document a link, a link descriptor can be marked as
IgnorableDescriptor.ignored
. This will prevent it from appearing in the
generated snippet while avoiding the failure described above.
If a descriptor does not have a description
, the title
of the link will be used. If the
link does not have a title a failure will occur.
attributes
- the attributesdescriptors
- the descriptions of the response's linkspublic static LinksSnippet links(Map<String,Object> attributes, List<LinkDescriptor> descriptors)
Snippet
that will document the links in the API call's
response. The given attributes
will be available during snippet generation.
Links will be extracted from the response automatically based on its content type
and will be documented using the given descriptors
.
If a link is present in the response, but is not documented by one of the descriptors, a failure will occur when the snippet is invoked. Similarly, if a link is documented, is not marked as optional, and is not present in the response, a failure will also occur.
If you do not want to document a link, a link descriptor can be marked as
IgnorableDescriptor.ignored
. This will prevent it from appearing in the
generated snippet while avoiding the failure described above.
If a descriptor does not have a description
, the title
of the link will be used. If the
link does not have a title a failure will occur.
attributes
- the attributesdescriptors
- the descriptions of the response's linkspublic static LinksSnippet relaxedLinks(Map<String,Object> attributes, LinkDescriptor... descriptors)
Snippet
that will document the links in the API call's
response. The given attributes
will be available during snippet generation.
Links will be extracted from the response automatically based on its content type
and will be documented using the given descriptors
.
If a link is documented, is not marked as optional, and is not present in the response, a failure will occur. Any undocumented links will be ignored.
If a descriptor does not have a description
, the title
of the link will be used. If the
link does not have a title a failure will occur.
attributes
- the attributesdescriptors
- the descriptions of the response's linkspublic static LinksSnippet relaxedLinks(Map<String,Object> attributes, List<LinkDescriptor> descriptors)
Snippet
that will document the links in the API call's
response. The given attributes
will be available during snippet generation.
Links will be extracted from the response automatically based on its content type
and will be documented using the given descriptors
.
If a link is documented, is not marked as optional, and is not present in the response, a failure will occur. Any undocumented links will be ignored.
If a descriptor does not have a description
, the title
of the link will be used. If the
link does not have a title a failure will occur.
attributes
- the attributesdescriptors
- the descriptions of the response's linkspublic static LinksSnippet links(LinkExtractor linkExtractor, LinkDescriptor... descriptors)
Snippet
that will document the links in the API operation's
response. Links will be extracted from the response using the given
linkExtractor
and will be documented using the given descriptors
.
If a link is present in the response, but is not documented by one of the descriptors, a failure will occur when the snippet is invoked. Similarly, if a link is documented, is not marked as optional, and is not present in the response, a failure will also occur.
If you do not want to document a link, a link descriptor can be marked as
IgnorableDescriptor.ignored
. This will prevent it from appearing in the
generated snippet while avoiding the failure described above.
If a descriptor does not have a description
, the title
of the link will be used. If the
link does not have a title a failure will occur.
linkExtractor
- used to extract the links from the responsedescriptors
- the descriptions of the response's linkspublic static LinksSnippet links(LinkExtractor linkExtractor, List<LinkDescriptor> descriptors)
Snippet
that will document the links in the API operation's
response. Links will be extracted from the response using the given
linkExtractor
and will be documented using the given descriptors
.
If a link is present in the response, but is not documented by one of the descriptors, a failure will occur when the snippet is invoked. Similarly, if a link is documented, is not marked as optional, and is not present in the response, a failure will also occur.
If you do not want to document a link, a link descriptor can be marked as
IgnorableDescriptor.ignored
. This will prevent it from appearing in the
generated snippet while avoiding the failure described above.
If a descriptor does not have a description
, the title
of the link will be used. If the
link does not have a title a failure will occur.
linkExtractor
- used to extract the links from the responsedescriptors
- the descriptions of the response's linkspublic static LinksSnippet relaxedLinks(LinkExtractor linkExtractor, LinkDescriptor... descriptors)
Snippet
that will document the links in the API operation's
response. Links will be extracted from the response using the given
linkExtractor
and will be documented using the given descriptors
.
If a link is documented, is not marked as optional, and is not present in the response, a failure will occur. Any undocumented links will be ignored.
If a descriptor does not have a description
, the title
of the link will be used. If the
link does not have a title a failure will occur.
linkExtractor
- used to extract the links from the responsedescriptors
- the descriptions of the response's linkspublic static LinksSnippet relaxedLinks(LinkExtractor linkExtractor, List<LinkDescriptor> descriptors)
Snippet
that will document the links in the API operation's
response. Links will be extracted from the response using the given
linkExtractor
and will be documented using the given descriptors
.
If a link is documented, is not marked as optional, and is not present in the response, a failure will occur. Any undocumented links will be ignored.
If a descriptor does not have a description
, the title
of the link will be used. If the
link does not have a title a failure will occur.
linkExtractor
- used to extract the links from the responsedescriptors
- the descriptions of the response's linkspublic static LinksSnippet links(LinkExtractor linkExtractor, Map<String,Object> attributes, LinkDescriptor... descriptors)
Snippet
that will document the links in the API operation's
response. The given attributes
will be available during snippet generation.
Links will be extracted from the response using the given linkExtractor
and
will be documented using the given descriptors
.
If a link is present in the response, but is not documented by one of the descriptors, a failure will occur when the snippet is invoked. Similarly, if a link is documented, is not marked as optional, and is not present in the response, a failure will also occur.
If you do not want to document a link, a link descriptor can be marked as
IgnorableDescriptor.ignored
. This will prevent it from appearing in the
generated snippet while avoiding the failure described above.
If a descriptor does not have a description
, the title
of the link will be used. If the
link does not have a title a failure will occur.
attributes
- the attributeslinkExtractor
- used to extract the links from the responsedescriptors
- the descriptions of the response's linkspublic static LinksSnippet links(LinkExtractor linkExtractor, Map<String,Object> attributes, List<LinkDescriptor> descriptors)
Snippet
that will document the links in the API operation's
response. The given attributes
will be available during snippet generation.
Links will be extracted from the response using the given linkExtractor
and
will be documented using the given descriptors
.
If a link is present in the response, but is not documented by one of the descriptors, a failure will occur when the snippet is invoked. Similarly, if a link is documented, is not marked as optional, and is not present in the response, a failure will also occur.
If you do not want to document a link, a link descriptor can be marked as
IgnorableDescriptor.ignored
. This will prevent it from appearing in the
generated snippet while avoiding the failure described above.
If a descriptor does not have a description
, the title
of the link will be used. If the
link does not have a title a failure will occur.
attributes
- the attributeslinkExtractor
- used to extract the links from the responsedescriptors
- the descriptions of the response's linkspublic static LinksSnippet relaxedLinks(LinkExtractor linkExtractor, Map<String,Object> attributes, LinkDescriptor... descriptors)
Snippet
that will document the links in the API operation's
response. The given attributes
will be available during snippet generation.
Links will be extracted from the response using the given linkExtractor
and
will be documented using the given descriptors
.
If a link is documented, is not marked as optional, and is not present in the response, a failure will occur. Any undocumented links will be ignored.
If a descriptor does not have a description
, the title
of the link will be used. If the
link does not have a title a failure will occur.
attributes
- the attributeslinkExtractor
- used to extract the links from the responsedescriptors
- the descriptions of the response's linkspublic static LinksSnippet relaxedLinks(LinkExtractor linkExtractor, Map<String,Object> attributes, List<LinkDescriptor> descriptors)
Snippet
that will document the links in the API operation's
response. The given attributes
will be available during snippet generation.
Links will be extracted from the response using the given linkExtractor
and
will be documented using the given descriptors
.
If a link is documented, is not marked as optional, and is not present in the response, a failure will occur. Any undocumented links will be ignored.
If a descriptor does not have a description
, the title
of the link will be used. If the
link does not have a title a failure will occur.
attributes
- the attributeslinkExtractor
- used to extract the links from the responsedescriptors
- the descriptions of the response's linkspublic static LinkExtractor halLinks()
LinkExtractor
capable of extracting links in Hypermedia
Application Language (HAL) format where the links are found in a map named
_links
. For example:
{ "_links": { "self": { "href": "http://example.com/foo" } } }
public static LinkExtractor atomLinks()
LinkExtractor
capable of extracting links in Atom format where
the links are found in an array named links
. For example:
{ "links": [ { "rel": "self", "href": "http://example.com/foo" } ] }