You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@juneau.apache.org by ja...@apache.org on 2018/02/02 00:55:52 UTC
[juneau] branch master updated: Update javadocs.
This is an automated email from the ASF dual-hosted git repository.
jamesbognar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/juneau.git
The following commit(s) were added to refs/heads/master by this push:
new edb30b6 Update javadocs.
edb30b6 is described below
commit edb30b6634cdf402122569c496c87b9ce1212325
Author: JamesBognar <ja...@apache.org>
AuthorDate: Thu Feb 1 19:55:50 2018 -0500
Update javadocs.
---
.../org/apache/juneau/html/HtmlDocSerializer.java | 4 +-
.../main/javadoc/doc-files/HelloWorldOptions.png | Bin 0 -> 301812 bytes
juneau-doc/src/main/javadoc/overview.html | 548 ++++++++-------------
.../java/org/apache/juneau/rest/RestContext.java | 40 +-
.../org/apache/juneau/rest/RestInfoProvider.java | 227 +--------
.../juneau/rest/RestInfoProviderDefault.java | 19 +-
.../org/apache/juneau/rest/annotation/HtmlDoc.java | 197 +++++---
.../juneau/rest/annotation/MethodSwagger.java | 232 +++------
.../juneau/rest/annotation/ResourceSwagger.java | 21 -
.../apache/juneau/rest/annotation/RestMethod.java | 330 +++++--------
.../juneau/rest/annotation/RestResource.java | 467 +++++++-----------
.../org/apache/juneau/rest/vars/RestInfoVar.java | 27 +-
12 files changed, 728 insertions(+), 1384 deletions(-)
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocSerializer.java
index 42f44aa..b77f032 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocSerializer.java
@@ -53,9 +53,9 @@ import org.apache.juneau.serializer.*;
* <p class='bcode'>
* <ja>@RestResource</ja>(
* messages=<js>"nls/AddressBookResource"</js>,
+ * title=<js>"$L{title}"</js>,
+ * description=<js>"$L{description}"</js>,
* htmldoc=<ja>@HtmlDoc</ja>(
- * title=<js>"$L{title}"</js>,
- * description=<js>"$L{description}"</js>,
* navlinks={
* <js>"options: ?method=OPTIONS"</js>,
* <js>"doc: doc"</js>
diff --git a/juneau-doc/src/main/javadoc/doc-files/HelloWorldOptions.png b/juneau-doc/src/main/javadoc/doc-files/HelloWorldOptions.png
new file mode 100644
index 0000000..6f9310e
Binary files /dev/null and b/juneau-doc/src/main/javadoc/doc-files/HelloWorldOptions.png differ
diff --git a/juneau-doc/src/main/javadoc/overview.html b/juneau-doc/src/main/javadoc/overview.html
index b6c10ea..19a0b79 100644
--- a/juneau-doc/src/main/javadoc/overview.html
+++ b/juneau-doc/src/main/javadoc/overview.html
@@ -199,7 +199,8 @@
<li><p><a class='doclink' href='#juneau-rest-server.ClientVersioning'><i>Client Versioning</i></a></p>
<li><p><a class='doclink' href='#juneau-rest-server.OptionsPages'><i>OPTIONS pages</i></a></p>
<ol>
- <li><p><a class='doclink' href='#juneau-rest-server.InfoProviders'><i>Info Providers</i></a></p>
+ <li><p><a class='doclink' href='#juneau-rest-server.RestInfoProvider'><i>RestInfoProvider</i></a></p>
+ <li><p><a class='doclink' href='#juneau-rest-server.RestInfoProviderDefault'><i>RestInfoProviderDefault</i></a></p>
</ol>
<li><p><a class='doclink' href='#juneau-rest-server.HtmlDocAnnotation'><i>@HtmlDoc</i></a></p>
<ol>
@@ -7253,66 +7254,68 @@
<br>{@link org.apache.juneau.rest.RestRequest#getVarResolverSession()} method returns initialization and request-time variables.
</ul>
<p>
- The following is the default list of supported variables:
+ The following is the default list of supported variables.
</p>
- <ul>
+ <a id="DefaultRestSvlVariables"></a>
+ <h6 class='topic'>Default REST SVL variables</h6>
+ <ul class='spaced-list'>
<li><b>Initialization-time variables:</b>
<ul>
- <li><l>$C{key[,defaultValue]}</l> - Config file entry. See {@link org.apache.juneau.ini.ConfigFileVar}.
- <li><l>$E{envVar[,defaultValue]}</l> - Environment variable. See {@link org.apache.juneau.svl.vars.EnvVariablesVar}.
- <li><l>$S{systemProperty[,defaultValue]}</l> - System property. See {@link org.apache.juneau.svl.vars.SystemPropertiesVar}.
+ <li><l>$C{key[,defaultValue]}</l> - {@link org.apache.juneau.ini.ConfigFileVar}
+ <li><l>$E{envVar[,defaultValue]}</l> - {@link org.apache.juneau.svl.vars.EnvVariablesVar}
+ <li><l>$S{systemProperty[,defaultValue]}</l> - {@link org.apache.juneau.svl.vars.SystemPropertiesVar}
</ul>
<li><b>Initialization-time construct variables:</b>
<ul>
- <li><l>$CO{arg1[,arg2...]}</l> - Coalesce variable. See {@link org.apache.juneau.svl.vars.CoalesceVar}.
- <li><l>$CR{arg1[,arg2...]}</l> - Coalesce-and-recurse variable. See {@link org.apache.juneau.svl.vars.CoalesceAndRecurseVar}.
- <li><l>$IF{booleanArg,thenValue[,elseValue]}</l> - If/else variable. See {@link org.apache.juneau.svl.vars.IfVar}.
- <li><l>$SW{stringArg(,pattern,thenValue)+[,elseValue]}</l> - Switch variable. See {@link org.apache.juneau.svl.vars.SwitchVar}.
+ <li><l>$CO{arg1[,arg2...]}</l> - {@link org.apache.juneau.svl.vars.CoalesceVar}
+ <li><l>$CR{arg1[,arg2...]}</l> - {@link org.apache.juneau.svl.vars.CoalesceAndRecurseVar}
+ <li><l>$IF{booleanArg,thenValue[,elseValue]}</l> - {@link org.apache.juneau.svl.vars.IfVar}
+ <li><l>$SW{stringArg(,pattern,thenValue)+[,elseValue]}</l> - {@link org.apache.juneau.svl.vars.SwitchVar}
</ul>
<li><b>Request-time variables:</b>
<ul>
- <li><l>$F{path[,defaultValue]}</l> - File resource. See {@link org.apache.juneau.rest.vars.FileVar}.
- <li><l>$I{name[,defaultValue]}</l> - Servlet init parameter. See {@link org.apache.juneau.rest.vars.ServletInitParamVar}.
- <li><l>$L{key[,args...]}</l> - Localized message. See {@link org.apache.juneau.rest.vars.LocalizationVar}.
- <li><l>$RA{key1[,key2...]}</l> - Request attribute variable. See {@link org.apache.juneau.rest.vars.RequestAttributeVar}.
- <li><l>$RF{key1[,key2...]}</l> - Request form-data variable. See {@link org.apache.juneau.rest.vars.RequestFormDataVar}.
- <li><l>$RH{key1[,key2...]}</l> - Request header variable. See {@link org.apache.juneau.rest.vars.RequestHeaderVar}.
- <li><l>$RI{key}</l> - Rest info provider variable. See {@link org.apache.juneau.rest.vars.RequestHeaderVar}.
+ <li><l>$F{path[,defaultValue]}</l> - {@link org.apache.juneau.rest.vars.FileVar}
+ <li><l>$I{name[,defaultValue]}</l> - {@link org.apache.juneau.rest.vars.ServletInitParamVar}
+ <li><l>$L{key[,args...]}</l> - {@link org.apache.juneau.rest.vars.LocalizationVar}
+ <li><l>$RA{key1[,key2...]}</l> - {@link org.apache.juneau.rest.vars.RequestAttributeVar}
+ <li><l>$RF{key1[,key2...]}</l> - {@link org.apache.juneau.rest.vars.RequestFormDataVar}
+ <li><l>$RH{key1[,key2...]}</l> - {@link org.apache.juneau.rest.vars.RequestHeaderVar}
+ <li><l>$RI{key}</l> - {@link org.apache.juneau.rest.vars.RequestHeaderVar}
<br>Possible keys:
<ul>
- <li><l>$RI{contact}</l> - Value returned by {@link org.apache.juneau.rest.RestInfoProvider#getContact(RestRequest)}.
- <li><l>$RI{description}</l> - Value returned by {@link org.apache.juneau.rest.RestInfoProvider#getDescription(RestRequest)}.
- <li><l>$RI{externalDocs}</l> - Value returned by {@link org.apache.juneau.rest.RestInfoProvider#getExternalDocs(RestRequest)}.
- <li><l>$RI{license}</l> - Value returned by {@link org.apache.juneau.rest.RestInfoProvider#getLicense(RestRequest)}.
- <li><l>$RI{methodDescription}</l> - Value returned by {@link org.apache.juneau.rest.RestInfoProvider#getMethodDescription(Method,RestRequest)}.
- <li><l>$RI{methodSummary}</l> - Value returned by {@link org.apache.juneau.rest.RestInfoProvider#getMethodSummary(Method,RestRequest)}.
- <li><l>$RI{siteName}</l> - Value returned by {@link org.apache.juneau.rest.RestInfoProvider#getSiteName(RestRequest)}.
- <li><l>$RI{tags}</l> - Value returned by {@link org.apache.juneau.rest.RestInfoProvider#getTags(RestRequest)}.
- <li><l>$RI{termsOfService}</l> - Value returned by {@link org.apache.juneau.rest.RestInfoProvider#getTermsOfService(RestRequest)}.
- <li><l>$RI{title}</l> - Value returned by {@link org.apache.juneau.rest.RestInfoProvider#getTitle(RestRequest)}.
- <li><l>$RI{version}</l> - Value returned by {@link org.apache.juneau.rest.RestInfoProvider#getVersion(RestRequest)}.
+ <li><l>$RI{contact}</l> - {@link org.apache.juneau.dto.swagger.Info#getContact()}
+ <li><l>$RI{description}</l> - {@link org.apache.juneau.rest.RestInfoProvider#getDescription(RestRequest)}
+ <li><l>$RI{externalDocs}</l> - {@link org.apache.juneau.dto.swagger.Swagger#getExternalDocs()}
+ <li><l>$RI{license}</l> - {@link org.apache.juneau.dto.swagger.Info#getLicense()}
+ <li><l>$RI{methodDescription}</l> - {@link org.apache.juneau.rest.RestInfoProvider#getMethodDescription(Method,RestRequest)}
+ <li><l>$RI{methodSummary}</l> - {@link org.apache.juneau.rest.RestInfoProvider#getMethodSummary(Method,RestRequest)}
+ <li><l>$RI{siteName}</l> - {@link org.apache.juneau.rest.RestInfoProvider#getSiteName(RestRequest)}
+ <li><l>$RI{tags}</l> - {@link org.apache.juneau.dto.swagger.Swagger#getTags()}
+ <li><l>$RI{termsOfService}</l> - {@link org.apache.juneau.dto.swagger.Info#getTermsOfService()}
+ <li><l>$RI{title}</l> - {@link org.apache.juneau.rest.RestInfoProvider#getTitle(RestRequest)}
+ <li><l>$RI{version}</l> - {@link org.apache.juneau.dto.swagger.Info#getVersion()}
</ul>
- <li><l>$RP{key1[,key2...]}</l> - Request path variable. See {@link org.apache.juneau.rest.vars.RequestPathVar}.
- <li><l>$RQ{key1[,key2...]}</l> - Request query parameter variable. See {@link org.apache.juneau.rest.vars.RequestQueryVar}.
- <li><l>$R{key1[,key2...]}</l> - Request object variable. See {@link org.apache.juneau.rest.vars.RequestVar}.
+ <li><l>$RP{key1[,key2...]}</l> - {@link org.apache.juneau.rest.vars.RequestPathVar}
+ <li><l>$RQ{key1[,key2...]}</l> - {@link org.apache.juneau.rest.vars.RequestQueryVar}
+ <li><l>$R{key1[,key2...]}</l> - {@link org.apache.juneau.rest.vars.RequestVar}
<br>Possible keys:
<ul>
- <li><l>$R{method}</l> - Value returned by {@link org.apache.juneau.rest.RestRequest#getMethod()}.
- <li><l>$R{methodSummary}</l> - Value returned by {@link org.apache.juneau.rest.RestRequest#getMethodSummary()}.
- <li><l>$R{methodDescription}</l> - Value returned by {@link org.apache.juneau.rest.RestRequest#getMethodDescription()}.
- <li><l>$R{pathInfo}</l> - Value returned by {@link org.apache.juneau.rest.RestRequest#getPathInfo()}.
- <li><l>$R{requestParentURI}</l> - Value returned by {@link org.apache.juneau.UriContext#getRootRelativePathInfoParent()}.
- <li><l>$R{requestURI}</l> - Value returned by {@link org.apache.juneau.rest.RestRequest#getRequestURI()}.
- <li><l>$R{resourceDescription}</l> - Value returned by {@link org.apache.juneau.rest.RestRequest#getResourceDescription()}.
- <li><l>$R{resourceTitle}</l> - Value returned by {@link org.apache.juneau.rest.RestRequest#getResourceTitle()}.
- <li><l>$R{servletParentURI}</l> - Value returned by {@link org.apache.juneau.UriContext#getRootRelativeServletPathParent()}.
- <li><l>$R{servletPath}</l> - Value returned by {@link org.apache.juneau.rest.RestRequest#getServletPath()}.
- <li><l>$R{servletURI}</l> - Value returned by {@link org.apache.juneau.UriContext#getRootRelativeServletPath()}.
+ <li><l>$R{method}</l> - {@link org.apache.juneau.rest.RestRequest#getMethod()}
+ <li><l>$R{methodSummary}</l> - {@link org.apache.juneau.rest.RestRequest#getMethodSummary()}
+ <li><l>$R{methodDescription}</l> - {@link org.apache.juneau.rest.RestRequest#getMethodDescription()}
+ <li><l>$R{pathInfo}</l> - {@link org.apache.juneau.rest.RestRequest#getPathInfo()}
+ <li><l>$R{requestParentURI}</l> - {@link org.apache.juneau.UriContext#getRootRelativePathInfoParent()}
+ <li><l>$R{requestURI}</l> - {@link org.apache.juneau.rest.RestRequest#getRequestURI()}
+ <li><l>$R{resourceDescription}</l> - {@link org.apache.juneau.rest.RestRequest#getResourceDescription()}
+ <li><l>$R{resourceTitle}</l> - {@link org.apache.juneau.rest.RestRequest#getResourceTitle()}
+ <li><l>$R{servletParentURI}</l> - {@link org.apache.juneau.UriContext#getRootRelativeServletPathParent()}
+ <li><l>$R{servletPath}</l> - {@link org.apache.juneau.rest.RestRequest#getServletPath()}
+ <li><l>$R{servletURI}</l> - {@link org.apache.juneau.UriContext#getRootRelativeServletPath()}
</ul>
- <li><l>$SA{contentType,key[,defaultValue]}</l> - Serialized request attribute. See {@link org.apache.juneau.rest.vars.SerializedRequestAttrVar}.
- <li><l>$U{uri}</l> - URI resolver. See {@link org.apache.juneau.rest.vars.UrlVar}.
- <li><l>$UE{uriPart}</l> - URL-Encoder. See {@link org.apache.juneau.rest.vars.UrlEncodeVar}.
- <li><l>$W{widgetName}</l> - HTML widget variable. See {@link org.apache.juneau.rest.vars.WidgetVar}.
+ <li><l>$SA{contentType,key[,defaultValue]}</l> - {@link org.apache.juneau.rest.vars.SerializedRequestAttrVar}
+ <li><l>$U{uri}</l> - {@link org.apache.juneau.rest.vars.UrlVar}
+ <li><l>$UE{uriPart}</l> - {@link org.apache.juneau.rest.vars.UrlEncodeVar}
+ <li><l>$W{widgetName}</l> - {@link org.apache.juneau.rest.vars.WidgetVar}
</ul>
</ul>
</div>
@@ -7592,7 +7595,7 @@
</p>
<h6 class='figure'>OPTIONS page for HelloWorld sample resource</h6>
- <img class='bordered' src='doc-files/HelloWorldResourceOptions.png'>
+ <img class='bordered' src='doc-files/HelloWorldOptions.png' style='width:800px;'>
<p>
The {@link org.apache.juneau.rest.RestServletDefault} class implements the page by creating a method
mapped to the <l>OPTIONS</l> HTTP method that simply returns a Swagger bean:
@@ -7616,276 +7619,12 @@
}
</p>
<p>
- This page is constructed through reflection on the servlet class and it's methods, combined with
- information provided in the following locations:
- </p>
- <ul>
- <li>Annotations (i.e. {@link org.apache.juneau.rest.annotation.RestResource @RestResource} and
- {@link org.apache.juneau.rest.annotation.RestMethod @RestMethod}).
- <li>Resource bundle properties.
- <li>Swagger JSON files.
- </ul>
- <p>
- Swagger JSON files are specified with the same name as the servlet
- (e.g. <code>MyResource.java</code> -> <code>MyResource.json</code>).
- Localized versions of Swagger JSON files can be specified by appending the locale to the file name
- (e.g. <code>MyResource_ja_JP.json</code>).
- The existence of Swagger JSON files will override any auto-generation of the OPTIONS pages.
- This allows you to fully control the contents of the OPTIONS page with your own Swagger spec.
- </p>
- <p>
- The framework takes the information above and populates a {@link org.apache.juneau.dto.swagger.Swagger} bean.
- This bean is then serialized just like any other POJO to produce the page shown above.
- </p>
- <p>
- {@link org.apache.juneau.rest.RestServletDefault} provides a default OPTIONS page by implementing
- a {@link org.apache.juneau.rest.RestServletDefault#getOptions(RestRequest)} method that returns a POJO
- consisting of beans describing the class.
- It uses the {@link org.apache.juneau.rest.RestRequest#getSwagger()} method that returns a localized swagger
- bean.
- </p>
-
- <h6 class='topic'>Title and Description</h6>
- <p>
- The title and description can be defined in the following ways.
- </p>
- <ul>
- <li>Annotations: {@link org.apache.juneau.rest.annotation.RestResource#title() @RestResource.title()},
- {@link org.apache.juneau.rest.annotation.RestResource#description() @RestResource.description()}
- <li>By overriding methods on the servlet class:
- {@link org.apache.juneau.rest.RestInfoProvider#getTitle(RestRequest)},
- {@link org.apache.juneau.rest.RestInfoProvider#getDescription(RestRequest)}
- <li>By defining properties in the resource bundle.
- <li>By specifying them in a Swagger JSON file.
- </ul>
- <p>
- If you don't care about internationalization, then the easiest way is to use annotations on the servlet.
- </p>
- <p class='bcode'>
- <ja>@RestResource</ja>(
- path=<js>"/example"</js>,
- title=<js>"Example Resource"</js>,
- description=<js>"This shows how to use labels and descriptions."</js>
- )
- <jk>public class</jk> ExampleResource <jk>extends</jk> RestServletDefault {
- </p>
- <p>
- The second approach which supports internationalization is to use the
- {@link org.apache.juneau.rest.annotation.RestResource#messages() @RestResource.messages()} annotation to
- point to a resource bundle, and then use predefined properties that identify the label and description.
- </p>
- <p class='bcode'>
- <ja>@RestResource</ja>(
- messages=<js>"nls/Messages"</js>
- )
- <jk>public class</jk> ExampleResource <jk>extends</jk> RestServletDefault {
- </p>
- <p>
- The title and description are specified as special properties in the resource bundle:
- </p>
- <p class='bcode'>
- <cc>#--------------------------------------------------------------------------------
- # Contents of Messages.properties
- #--------------------------------------------------------------------------------</cc>
- <ck>title</ck> = <cv>Example Resource</cv>
- <ck>description</ck> = <cv>This shows how to use labels and descriptions.</cv>
- </p>
- <p>
- Message keys can optionally be prefixed by the short class name if the resource bundle is shared by
- multiple servlets:
- </p>
- <p class='bcode'>
- <cc>#--------------------------------------------------------------------------------
- # Contents of Messages.properties
- #--------------------------------------------------------------------------------</cc>
- <ck>ExampleResource.title</ck> = <cv>Example Resource</cv>
- <ck>ExampleResource.description</ck> = <cv>This shows how to use labels and descriptions.</cv>
- </p>
- <p>
- When both annotations and properties are used, annotations take precedence.
- </p>
- <p>
- The localized label and description are also available through the following methods:
- </p>
- <ul class='doctree'>
- <li class='jm'>
- {@link org.apache.juneau.rest.RestRequest#getResourceTitle()}
- <li class='jm'>
- {@link org.apache.juneau.rest.RestRequest#getResourceDescription()}
- </ul>
- <p>
- They are also made available as the request string variables <js>"$R{resourceTitle}"</js> and
- <js>"$R{resourceDescription}"</js>.
- These variable facilitate the localized label and descriptions on the HTML pages when using
- {@link org.apache.juneau.rest.RestServletDefault}:
- </p>
- <p class='bcode'>
- <ja>@RestResource</ja>(
- pageTitle=<js>"The title for this page is $R{resourceTitle}"</js>,
- pageText=<js>"The description for this page is $R{resourceDescription}"</js>
- )
- <jk>public abstract class</jk> RestServletDefault <jk>extends</jk> RestServlet {
- </p>
- <p>
- The title and description annotations support string variables.
- So in theory, you could also provide localized messages using <js>"$L"</js> variables pointing to your own
- resource bundle properties:
- </p>
- <p class='bcode'>
- <ja>@RestResource</ja>(
- path=<js>"/example"</js>,
- messages=<js>"nls/Messages"</js>
- title=<js>"$L{my.resource.label}"</js>,
- description=<js>"$L{my.resource.description}"</js>
- )
- <jk>public class</jk> ExampleResource <jk>extends</jk> RestServletDefault {
- </p>
- <p>
- Another option is to override the {@link org.apache.juneau.rest.RestInfoProvider#getTitle(RestRequest)}
- and {@link org.apache.juneau.rest.RestInfoProvider#getDescription(RestRequest)} methods.
- </p>
-
- <h6 class='topic'>Method Description, Input, and Responses</h6>
- <p>
- The <l>methods</l> field in the OPTIONS page is mostly populated through reflection.
- However, the description, input, and responses field can be specified through either annotations or
- resource properties.
- </p>
- <p>
- For example, the <l>AddressBookResource</l> has a <l>getPerson()</l> method
- that gets rendered in the OPTIONS page like so...
- </p>
- <img class='bordered' src='doc-files/Options2.png'>
- <p>
- This method is described through the
- {@link org.apache.juneau.rest.annotation.RestMethod#description() @RestMethod.description()},
- {@link org.apache.juneau.rest.annotation.RestMethod#swagger() @RestMethod.swagger()},
- and {@link org.apache.juneau.rest.annotation.MethodSwagger @MethodSwagger} annotations.
+ This page is constructed using the Info Provider API described next.
</p>
- <p class='bcode'>
- <ja>@RestMethod</ja>(
- name=<jsf>GET</jsf>,
- path=<js>"/people/{id}/*"</js>,
- converters={Traversable.<jk>class</jk>,Queryable.<jk>class</jk>,Introspectable.<jk>class</jk>},
- description=<js>"Get a person by id in the address book"</js>,
- parameters={
- <ja>@Parameter</ja>(in=<js>"path"</js>, name=<js>"id"</js>, description=<js>"Person UUID"</js>)
- },
- responses={
- <ja>@Response</ja>(value=200, description="Person bean"),
- <ja>@Response</ja>(value=404, description=<js>"Person with specified id not found"</js>)
- }
- )
- <jk>public</jk> Person getPerson(<ja>@Path</ja> <jk>int</jk> id) throws Exception {
- <jk>return</jk> findPerson(id);
- }
- </p>
- <p>
- These labels can also be localized by instead specifying them in the servlet properties file:
- </p>
- <p class='bcode'>
- <ja>@RestMethod</ja>(
- name=<jsf>GET</jsf>,
- path=<js>"/people/{id}/*"</js>,
- converters={Traversable.<jk>class</jk>,Queryable.<jk>class</jk>,Introspectable.<jk>class</jk>}
- <jc>// Don't specify annotations for labels...they'll be detected in resource bundle.</jc>
- )
- <jk>public</jk> Person getPerson(<ja>@Path</ja> <jk>int</jk> id) throws Exception {
- <jk>return</jk> findPerson(id);
- }
- </p>
- <p class='bcode'>
- <cc>#--------------------------------------------------------------------------------
- # Contents of AddressBookResource.properties
- #--------------------------------------------------------------------------------</cc>
- <ck>getPerson.summary</ck> = <cv>Get a person by id in the address book</cv>
- <ck>getPerson.req.path.id.description</ck> = <cv>Person UUID</cv>
- <ck>getPerson.res.200.description</ck> = <cv>Person found</cv>
- <ck>getPerson.res.404.description</ck> = <cv>Person with specified id not found</cv>
- </p>
- <p>
- The following table shows the predefined resource bundle message property names:
- </p>
- <table class='styled'>
- <tr>
- <th>Property</th>
- <th>Description</th>
- <th>Equivalent Annotation</th>
- <th>Equivalent Method</th>
- </tr>
- <tr>
- <td><ck>label</ck></td>
- <td>Servlet label</td>
- <td>{@link org.apache.juneau.rest.annotation.RestResource#title() @RestResource.title()}</td>
- <td>{@link org.apache.juneau.rest.RestInfoProvider#getTitle(RestRequest)}</td>
- </tr>
- <tr>
- <td><ck>description</ck></td>
- <td>Servlet description</td>
- <td>{@link org.apache.juneau.rest.annotation.RestResource#description() @RestResource.description()}</td>
- <td>{@link org.apache.juneau.rest.RestInfoProvider#getDescription(RestRequest)}</td>
- </tr>
- <tr>
- <td><ck>[javaMethodName].summary</ck></td>
- <td>Java method summary</td>
- <td>{@link org.apache.juneau.rest.annotation.RestMethod#summary() @RestMethod.summary()}</td>
- </tr>
- <tr>
- <td><ck>[javaMethodName].description</ck></td>
- <td>Java method description</td>
- <td>{@link org.apache.juneau.rest.annotation.RestMethod#description() @RestMethod.description()}</td>
- </tr>
- <tr>
- <td><ck>[javaMethodName].req.body.description</ck></td>
- <td>
- A description of the HTTP request body.
- </td>
- <td>{@link org.apache.juneau.rest.annotation.MethodSwagger#parameters() @MethodSwagger.parameters()}</td>
- </tr>
- <tr>
- <td><ck>[javaMethodName].req.[category].[name].description</ck></td>
- <td>
- A request input variable.
- <br>Categories: <l>path, query, formData, header</l>
- </td>
- <td>{@link org.apache.juneau.rest.annotation.MethodSwagger#parameters() @MethodSwagger.parameters()}</td>
- </tr>
- <tr>
- <td><ck>[javaMethodName].res.[code].description</ck></td>
- <td>
- A possible HTTP response code and description.
- </td>
- <td>{@link org.apache.juneau.rest.annotation.MethodSwagger#responses() @MethodSwagger.responses()}</td>
- </tr>
- <tr>
- <td><ck>[javaMethodName].res.[code].body.description</ck></td>
- <td>
- A description of response content for the specified HTTP response.
- </td>
- <td>{@link org.apache.juneau.rest.annotation.MethodSwagger#responses() @MethodSwagger.responses()}</td>
- </tr>
- <tr>
- <td><ck>[javaMethodName].res.[code].header.[name].description</ck></td>
- <td>
- A response header.
- </td>
- <td>{@link org.apache.juneau.rest.annotation.MethodSwagger#responses() @MethodSwagger.responses()}</td>
- </tr>
- </table>
-
- <h6 class='topic'>Additional Information</h6>
- <ul class='doctree'>
- <li class='ja'>
- {@link org.apache.juneau.rest.annotation.RestMethod#description() @RestMethod.description()}
- <li class='ja'>
- {@link org.apache.juneau.rest.annotation.MethodSwagger#parameters() @MethodSwagger.parameters()}
- <li class='ja'>
- {@link org.apache.juneau.rest.annotation.MethodSwagger#responses() @MethodSwagger.responses()}
- </ul>
<!-- ======================================================================================================== -->
- <a id="juneau-rest-server.InfoProviders"></a>
- <h4 class='topic' onclick='toggle(this)'>3.1.23.1 - Info Providers</h4>
+ <a id="juneau-rest-server.RestInfoProvider"></a>
+ <h4 class='topic' onclick='toggle(this)'>3.1.23.1 - RestInfoProvider</h4>
<div class='topic'>
<p>
The {@link org.apache.juneau.rest.RestInfoProvider} class is used to find the title
@@ -7893,16 +7632,126 @@
<br>It can be overridden to provide your own custom Swagger documentation.
</p>
<p>
- Info providers are registered through the following:
+ The methods on this interface are:
+ </p>
+ <ul class='doctree'>
+ <li class='jic'>{@link org.apache.juneau.rest.RestInfoProvider}
+ <ul>
+ <li class='jm'>{@link org.apache.juneau.rest.RestInfoProvider#getSwagger(RestRequest) getSwagger(RestRequest)}
+ <li class='jm'>{@link org.apache.juneau.rest.RestInfoProvider#getSiteName(RestRequest) getSiteName(RestRequest)}
+ <li class='jm'>{@link org.apache.juneau.rest.RestInfoProvider#getTitle(RestRequest) getTitle(RestRequest)}
+ <li class='jm'>{@link org.apache.juneau.rest.RestInfoProvider#getDescription(RestRequest) getDescription(RestRequest)}
+ <li class='jm'>{@link org.apache.juneau.rest.RestInfoProvider#getMethodSummary(Method,RestRequest) getMethodSummary(Method,RestRequest)}
+ <li class='jm'>{@link org.apache.juneau.rest.RestInfoProvider#getMethodDescription(Method,RestRequest) getMethodDescription(Method,RestRequest)}
+ </ul>
+ </ul>
+ <p>
+ The info provider in turn supplies the information returned by the following methods:
+ </p>
+ <ul class='doctree'>
+ <li class='jc'>{@link org.apache.juneau.rest.RestRequest}
+ <ul>
+ <li class='jm'>{@link org.apache.juneau.rest.RestRequest#getSwagger() getSwagger()}
+ <li class='jm'>{@link org.apache.juneau.rest.RestRequest#getSiteName() getSiteName()}
+ <li class='jm'>{@link org.apache.juneau.rest.RestRequest#getResourceTitle() getResourceTitle()}
+ <li class='jm'>{@link org.apache.juneau.rest.RestRequest#getResourceDescription() getResourceDescription()}
+ <li class='jm'>{@link org.apache.juneau.rest.RestRequest#getMethodSummary() getMethodSummary()}
+ <li class='jm'>{@link org.apache.juneau.rest.RestRequest#getMethodDescription() getMethodDescription()}
+ </ul>
+ </ul>
+ <p>
+ Info providers are registered through the following property:
</p>
<ul>
- <li class='ja'>{@link org.apache.juneau.rest.annotation.RestResource#infoProvider()}
- <li class='jm'>{@link org.apache.juneau.rest.RestContextBuilder#infoProvider(Class)}
- <li class='jm'>{@link org.apache.juneau.rest.RestContextBuilder#infoProvider(Class)}
<li class='jf'>{@link org.apache.juneau.rest.RestContext#REST_infoProvider}
</ul>
- <h5 class='section'>Example:</h5>
- <p class='bcode'>
+ <p>
+ While you can implement this interface from scratch, you may want to instead consider extending
+ from the <l>RestInfoProviderDefault</l> class described next.
+ </p>
+ </div>
+
+ <!-- ======================================================================================================== -->
+ <a id="juneau-rest- defined on the resource/method"></a>
+ <h4 class='topic' onclick='toggle(this)'>3.1.23.2 - RestInfoProviderDefault</h4>
+ <div class='topic'>
+ <p>
+ The {@link org.apache.juneau.rest.RestInfoProviderDefault} class is the default implementation of the
+ {@link org.apache.juneau.rest.RestInfoProvider} interface.
+ </p>
+ <p>
+ It finds and collects information gathered from the following locations:
+ </p>
+ <ul>
+ <li>Localized JSON Swagger files in the classpath.
+ <li>Reflection.
+ <li> annotations.
+ <li>Info provided in properties files.
+ </ul>
+ <p>
+ The class itself is designed to be extended if you wish to rely mostly on the default behavior, but tweak
+ certain aspects.
+ </p>
+ <p>
+ In addition to the methods defined on the <l>RestInfoProvider</l> interface, it also includes the following methods:
+ </p>
+ <ul class='doctree'>
+ <li class='jc'><code>{@link org.apache.juneau.rest.RestInfoProviderDefault} <jk>implements</jk> {@link org.apache.juneau.rest.RestInfoProvider}</code>
+ <ul>
+ <li class='jm'>{@link org.apache.juneau.rest.RestInfoProviderDefault#getVersion(RestRequest) getVersion(RestRequest)}
+ <li class='jm'>{@link org.apache.juneau.rest.RestInfoProviderDefault#getContact(RestRequest) getContact(RestRequest)}
+ <li class='jm'>{@link org.apache.juneau.rest.RestInfoProviderDefault#getConsumes(RestRequest) getConsumes(RestRequest)}
+ <li class='jm'>{@link org.apache.juneau.rest.RestInfoProviderDefault#getProduces(RestRequest) getProduces(RestRequest)}
+ <li class='jm'>{@link org.apache.juneau.rest.RestInfoProviderDefault#getLicense(RestRequest) getLicense(RestRequest)}
+ <li class='jm'>{@link org.apache.juneau.rest.RestInfoProviderDefault#getTags(RestRequest) getTags(RestRequest)}
+ <li class='jm'>{@link org.apache.juneau.rest.RestInfoProviderDefault#getTermsOfService(RestRequest) getTermsOfService(RestRequest)}
+ <li class='jm'>{@link org.apache.juneau.rest.RestInfoProviderDefault#getExternalDocs(RestRequest) getExternalDocs(RestRequest)}
+ <li class='jm'>{@link org.apache.juneau.rest.RestInfoProviderDefault#getMethodSummary(Method,RestRequest) getMethodSummary(Method,RestRequest)}
+ <li class='jm'>{@link org.apache.juneau.rest.RestInfoProviderDefault#getMethodDescription(Method,RestRequest) getMethodDescription(Method,RestRequest)}
+ <li class='jm'>{@link org.apache.juneau.rest.RestInfoProviderDefault#getMethodOperationId(Method,RestRequest) getMethodOperationId(Method,RestRequest)}
+ <li class='jm'>{@link org.apache.juneau.rest.RestInfoProviderDefault#getMethodConsumes(Method,RestRequest) getMethodConsumes(Method,RestRequest)}
+ <li class='jm'>{@link org.apache.juneau.rest.RestInfoProviderDefault#getMethodProduces(Method,RestRequest) getMethodProduces(Method,RestRequest)}
+ <li class='jm'>{@link org.apache.juneau.rest.RestInfoProviderDefault#getMethodParameters(Method,RestRequest) getMethodParameters(Method,RestRequest)}
+ <li class='jm'>{@link org.apache.juneau.rest.RestInfoProviderDefault#getMethodResponses(Method,RestRequest) getMethodResponses(Method,RestRequest)}
+ <li class='jm'>{@link org.apache.juneau.rest.RestInfoProviderDefault#getMethodTags(Method,RestRequest) getMethodTags(Method,RestRequest)}
+ <li class='jm'>{@link org.apache.juneau.rest.RestInfoProviderDefault#getSwaggerFromFile(RestRequest) getSwaggerFromFile(RestRequest)}
+ </ul>
+ </ul>
+ <p>
+ The default provider provides several options for defining Swagger documentation on your resource:
+ </p>
+ <ul class='spaced-list'>
+ <li>
+ Provide nothing.
+ <br>You'll still get an auto-generated Swagger doc with information gather solely through reflection, including methods, parameters, consumes/produces, etc...
+ <li>
+ Specify localized JSON Swagger files on your classpath.
+ <br><h6 class='figure'>Example:</h6>
+ <p class='bcode'>
+ MyResource_ja_JP.json
+ </p>
+ <li>
+ Use {@link org.apache.juneau.rest.annotation.ResourceSwagger @ResourceSwagger} and {@link org.apache.juneau.rest.annotation.MethodSwagger @MethodSwagger}
+ annotations on your resource classes and methods.
+ <br><h6 class='figure'>Example:</h6>
+ <p class='bcode'>
+ <ja>@RestMethod</ja>(
+ swagger=<ja>@MethodSwagger</ja>(tags=<js>"foo,bar,baz"</js>)
+ )
+ <jk>public</jk> Object myMethod() {...}
+ </p>
+ <li>
+ Use properties files identified by the {@link org.apache.juneau.rest.annotation.RestResource#messages @RestResource.messages()} annotation.
+ <br><h6 class='figure'>Example:</h6>
+ <p class='bcode'>
+ <ck>MyResource.myMethod.tags</ck> = <cv>foo,bar,baz</cv>
+ </p>
+ <li>
+ Use any combination of the above.
+ <li>
+ Extend the <l>RestInfoProviderDefault</l> and provide customized behavior.
+ <br><h6 class='figure'>Example:</h6>
+ <p class='bcode'>
<jc>// Our customized info provider.</jc>
<jc>// Extend from the default implementation and selectively override values.</jc>
<jk>public class</jk> MyRestInfoProvider <jk>extends</jk> RestInfoProviderDefault {
@@ -7913,34 +7762,19 @@
}
<ja>@Override</ja>
- <jk>public</jk> Swagger getSwaggerFromFile(RestRequest req) <jk>throws</jk> RestException {
- <jc>// Provide our own method of retrieving swagger from file system.</jc>
- }
-
- <ja>@Override</ja>
<jk>public</jk> Swagger getSwagger(RestRequest req) <jk>throws</jk> RestException {
Swagger s = <jk>super</jk>.getSwagger(req);
<jc>// Made inline modifications to generated swagger.</jc>
<jk>return</jk> s;
}
-
- <ja>@Override</ja>
- <jk>public</jk> String getSiteName(RestRequest req) {
- <jc>// Override the site name.</jc>
- }
}
<jc>// Registered via annotation</jc>
<ja>@RestResource</ja>(infoProvider=MyRestInfoProvider.<jk>class</jk>)
<jk>public class</jk> MyResource {...}
- </p>
-
- <h5 class='section'>See Also:</h5>
- <ul>
- <li class='jf'>{@link org.apache.juneau.rest.RestContext#REST_infoProvider}
+ </p>
</ul>
- </div>
-
+ </div>
</div>
<!-- ======================================================================================================== -->
@@ -8006,9 +7840,12 @@
</body>
</html></xt>
</p>
-
<p>
- The <l>HelloWorldResource</l> class was an example of this annotation in use:
+ The outline above is controlled by the {@link org.apache.juneau.html.HtmlDocTemplate} interface
+ which can be overridden via the {@link org.apache.juneau.rest.annotation.HtmlDoc#template @HtmlDoc.template()} annotation.
+ </p>
+ <p>
+ The <l>HelloWorldResource</l> class was an example of the <l>@HtmlDoc</l> annotation in use:
</p>
<p class='bcode'>
<jd>/**
@@ -8060,6 +7897,7 @@
<h6 class='section'>See Also:</h6>
<ul>
<li class='ja'>{@link org.apache.juneau.rest.annotation.HtmlDoc}
+ <li class='jc'>{@link org.apache.juneau.rest.HtmlDocBuilder}
</ul>
<!-- ======================================================================================================== -->
@@ -13370,17 +13208,17 @@
<li><js>"$RI{key1[,key2...]}"</js> - {@link org.apache.juneau.rest.vars.RestInfoVar}, first non-null value returned by {@link org.apache.juneau.rest.RestRequest#getInfoProvider()}.
<br>The possible values are:
<ul>
- <li><js>"contact"</js> - Value returned by {@link org.apache.juneau.rest.RestInfoProvider#getContact(RestRequest)}
+ <li><js>"contact"</js> - Value returned by {@link org.apache.juneau.dto.swagger.Info#getContact()}
<li><js>"description"</js> - Value returned by {@link org.apache.juneau.rest.RestInfoProvider#getDescription(RestRequest)}
- <li><js>"externalDocs"</js> - Value returned by {@link org.apache.juneau.rest.RestInfoProvider#getExternalDocs(RestRequest)}
- <li><js>"license"</js> - Value returned by {@link org.apache.juneau.rest.RestInfoProvider#getLicense(RestRequest)}
+ <li><js>"externalDocs"</js> - Value returned by {@link org.apache.juneau.dto.swagger.Swagger#getExternalDocs()}
+ <li><js>"license"</js> - Value returned by {@link org.apache.juneau.dto.swagger.Info#getLicense()}
<li><js>"methodDescription"</js> - Value returned by {@link org.apache.juneau.rest.RestInfoProvider#getMethodDescription(Method,RestRequest)}
<li><js>"methodSummary"</js> - Value returned by {@link org.apache.juneau.rest.RestInfoProvider#getMethodSummary(Method,RestRequest)}
<li><js>"siteName"</js> - Value returned by {@link org.apache.juneau.rest.RestInfoProvider#getSiteName(RestRequest)}
- <li><js>"tags"</js> - Value returned by {@link org.apache.juneau.rest.RestInfoProvider#getTags(RestRequest)}
- <li><js>"termsOfService"</js> - Value returned by {@link org.apache.juneau.rest.RestInfoProvider#getTermsOfService(RestRequest)}
+ <li><js>"tags"</js> - Value returned by {@link org.apache.juneau.dto.swagger.Swagger#getTags()}
+ <li><js>"termsOfService"</js> - Value returned by {@link org.apache.juneau.dto.swagger.Info#getTermsOfService()}
<li><js>"title"</js> - See {@link org.apache.juneau.rest.RestInfoProvider#getTitle(RestRequest)}
- <li><js>"version"</js> - See {@link org.apache.juneau.rest.RestInfoProvider#getVersion(RestRequest)}
+ <li><js>"version"</js> - See {@link org.apache.juneau.dto.swagger.Info#getVersion()}
</ul>
<li><js>"$RP{key1[,key2...]}"</js> - {@link org.apache.juneau.rest.vars.RequestPathVar}, first non-null value returned by {@link org.apache.juneau.rest.RestRequest#getPath(String)}.
<li><js>"$RQ{key1[,key2...]}"</js> - {@link org.apache.juneau.rest.vars.RequestQueryVar}, first non-null value returned by {@link org.apache.juneau.rest.RestRequest#getQuery(String)}
@@ -13539,6 +13377,12 @@
<code>RestRequestProperties</code> as unannotated parameters.
<li>
Revamped the {@link org.apache.juneau.rest.RestInfoProvider} class.
+ <li>
+ New builder classes:
+ <ul>
+ <li>{@link org.apache.juneau.rest.ReaderResourceBuilder}
+ <li>{@link org.apache.juneau.rest.StreamResourceBuilder}
+ </ul>
</ul>
<h6 class='topic'>juneau-rest-client</h6>
@@ -15073,7 +14917,7 @@
</p>
<li><code><del>RestResource.stylesheet()</del></code> can now take in a comma-delimited list of stylesheet paths.
<li>{@link org.apache.juneau.rest.StreamResource} can now contain multiple sources from a variety of source types (e.g. <code><jk>byte</jk>[]</code> arrays, <code>InputStreams</code>, <code>Files</code>, etc...)
- and is now immutable. It also includes a new {@link org.apache.juneau.rest.StreamResource.Builder} class.
+ and is now immutable. It also includes a new {@link org.apache.juneau.rest.StreamResourceBuilder} class.
<li>Simplified remoteable proxies using the <code><ja>@RestMethod</ja>(name=<js>"PROXY"</js>)</code> annotation on REST methods.
Used to expose interface proxies without the need for {@link org.apache.juneau.rest.remoteable.RemoteableServlet}.
<p class='bcode'>
@@ -15563,12 +15407,12 @@
<ul>
<li>{@link org.apache.juneau.rest.annotation.RestResource#title() @RestResource.title()} / {@link org.apache.juneau.rest.RestInfoProvider#getTitle(RestRequest)}
<li>{@link org.apache.juneau.rest.annotation.RestResource#description() @RestResource.description()} / {@link org.apache.juneau.rest.RestInfoProvider#getDescription(RestRequest)}
- <li><code><del>@RestResource.termsOfService()</del></code> / {@link org.apache.juneau.rest.RestInfoProvider#getTermsOfService(RestRequest)}
- <li><code><del>@RestResource.contact()</del></code> / {@link org.apache.juneau.rest.RestInfoProvider#getContact(RestRequest)}
- <li><code><del>@RestResource.license()</del></code> / {@link org.apache.juneau.rest.RestInfoProvider#getLicense(RestRequest)}
- <li><code><del>@RestResource.version()</del></code> / {@link org.apache.juneau.rest.RestInfoProvider#getVersion(RestRequest)}
- <li><code><del>@RestResource.tags()</del></code> / {@link org.apache.juneau.rest.RestInfoProvider#getTags(RestRequest)}
- <li><code><del>@RestResource.externalDocs()</del></code> / {@link org.apache.juneau.rest.RestInfoProvider#getExternalDocs(RestRequest)}
+ <li><code><del>@RestResource.termsOfService()</del></code> / <code><del>RestInfoProvider.getTermsOfService(RestRequest)</del></code>
+ <li><code><del>@RestResource.contact()</del></code> / <code><del>RestInfoProvider.getContact(RestRequest)</del></code>
+ <li><code><del>@RestResource.license()</del></code> / <code><del>RestInfoProvider.getLicense(RestRequest)</del></code>
+ <li><code><del>@RestResource.version()</del></code> / <code><del>RestInfoProvider.getVersion(RestRequest)</del></code>
+ <li><code><del>@RestResource.tags()</del></code> / <code><del>RestInfoProvider.getTags(RestRequest)</del></code>
+ <li><code><del>@RestResource.externalDocs()</del></code> / <code><del>RestInfoProvidergetExternalDocs(RestRequest)</del></code>
<li>{@link org.apache.juneau.rest.annotation.RestMethod#summary() @RestMethod.summary()} / <code><del>RestInfoProvider.getMethodSummary(String,RestRequest)</del></code>
<li>{@link org.apache.juneau.rest.annotation.RestMethod#description() @RestMethod.description()} /<code><del>RestInfoProvider.getMethodDescription(String,RestRequest)</del></code>
<li><code><del>@RestMethod.externalDocs()</del></code>
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java
index 3d0298a..4c4afb9 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java
@@ -50,7 +50,6 @@ import org.apache.juneau.rest.widget.*;
import org.apache.juneau.serializer.*;
import org.apache.juneau.soap.*;
import org.apache.juneau.svl.*;
-import org.apache.juneau.svl.vars.*;
import org.apache.juneau.uon.*;
import org.apache.juneau.urlencoding.*;
import org.apache.juneau.utils.*;
@@ -3185,48 +3184,11 @@ public final class RestContext extends BeanContext {
* <jk>public</jk> LoggerEntry getLogger(RestRequest req, <ja>@Path</ja> String name) <jk>throws</jk> Exception {
* </p>
*
- * <p>
- * Variables are broken into two categories that describe when they're available for use:
- * <ul>
- * <li><b>Initialization-time variables</b> - Can be used at any time.
- * <li><b>Request-time variables</b> - Can only be used during HTTP requests.
- * </ul>
- *
- * <p>
- * The following is the default list of supported variables.
- * <ul>
- * <li><b>Initialization-time variables</b>
- * <ul>
- * <li><code>$C{key[,defaultValue]}</code> - Config file entry. See {@link ConfigFileVar}.
- * <li><code>$CO{arg1[,arg2...]}</code> - Coalesce variable. See {@link CoalesceVar}.
- * <li><code>$CR{arg1[,arg2...]}</code> - Coalesce-and-recurse variable. See {@link CoalesceAndRecurseVar}.
- * <li><code>$E{envVar[,defaultValue]}</code> - Environment variable. See {@link EnvVariablesVar}.
- * <li><code>$IF{booleanArg,thenValue[,elseValue]}</code> - If/else variable. See {@link IfVar}.
- * <li><code>$F{path[,defaultValue]}</code> - File resource. See {@link FileVar}.
- * <li><code>$S{systemProperty[,defaultValue]}</code> - System property. See {@link SystemPropertiesVar}.
- * <li><code>$SW{stringArg(,pattern,thenValue)+[,elseValue]}</code> - Switch variable. See {@link SwitchVar}.
- * </ul>
- * <li><b>Request-time variables</b>
- * <ul>
- * <li><code>$I{name[,defaultValue]}</code> - Servlet init parameter. See {@link ServletInitParamVar}.
- * <li><code>$L{key[,args...]}</code> - Localized message. See {@link LocalizationVar}.
- * <li><code>$RA{key1[,key2...]}</code> - Request attribute variable. See {@link RequestAttributeVar}.
- * <li><code>$RF{key1[,key2...]}</code> - Request form-data variable. See {@link RequestFormDataVar}.
- * <li><code>$RH{key1[,key2...]}</code> - Request header variable. See {@link RequestHeaderVar}.
- * <li><code>$RP{key1[,key2...]}</code> - Request path variable. See {@link RequestPathVar}.
- * <li><code>$RQ{key1[,key2...]}</code> - Request query parameter variable. See {@link RequestQueryVar}.
- * <li><code>$R{key1[,key2...]}</code> - Request object variable. See {@link RequestVar}.
- * <li><code>$SA{contentType,key[,defaultValue]}</code> - Serialized request attribute. See {@link SerializedRequestAttrVar}.
- * <li><code>$U{uri}</code> - URI resolver. See {@link UrlVar}.
- * <li><code>$UE{uriPart}</code> - URL-Encoder. See {@link UrlEncodeVar}.
- * <li><code>$W{widgetName}</code> - HTML widget variable. See {@link WidgetVar}.
- * </ul>
- * </ul>
- *
* <h5 class='section'>See Also:</h5>
* <ul>
* <li class='jm'>{@link org.apache.juneau.rest.RestContextBuilder#vars(Class...)} - For adding custom vars.
* <li class='link'><a class="doclink" href="../../../../overview-summary.html#juneau-rest-server.SvlVariables">Overview > SVL Variables</a>
+ * <li class='link'><a class="doclink" href="../../../../overview-summary.html#DefaultRestSvlVariables">Overview > Default REST SVL Variables</a>
* </ul>
*
* @return The var resolver in use by this resource.
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestInfoProvider.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestInfoProvider.java
index cf11570..dbe848f 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestInfoProvider.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestInfoProvider.java
@@ -13,10 +13,8 @@
package org.apache.juneau.rest;
import java.lang.reflect.Method;
-import java.util.*;
import org.apache.juneau.dto.swagger.*;
-import org.apache.juneau.http.*;
import org.apache.juneau.rest.annotation.*;
/**
@@ -49,25 +47,8 @@ public interface RestInfoProvider {
public interface Null extends RestInfoProvider {}
/**
- * Returns the contents of the localized swagger file for the specified request.
- *
- * @param req The incoming HTTP request.
- * @return
- * The contents of the parsed swagger file, or <jk>null</jk> if a swagger file could not be found.
- * @throws Exception
- * Throw a {@link RestException} with a specific HTTP error status or any other exception
- * to cause a <jsf>SC_INTERNAL_SERVER_ERROR</jsf>.
- */
- public Swagger getSwaggerFromFile(RestRequest req) throws Exception;
-
- /**
* Returns the localized swagger for the REST resource.
*
- * <p>
- * If {@link #getSwaggerFromFile(RestRequest)} returns a non-<jk>null</jk> value, then
- * that swagger is returned by this method.
- * <br>Otherwise, a new swagger object is return with information gathered via the other methods defined on this class.
- *
* @param req The incoming HTTP request.
* @return
* A new {@link Swagger} instance.
@@ -79,126 +60,6 @@ public interface RestInfoProvider {
public Swagger getSwagger(RestRequest req) throws Exception;
/**
- * Returns the localized operation ID of the specified java method.
- *
- * @param method The Java method annotated with {@link RestMethod @RestMethod}.
- * @param req The current request.
- * @return The localized operation ID of the method, or <jk>null</jk> if none was found.
- * @throws Exception
- * Throw a {@link RestException} with a specific HTTP error status or any other exception
- * to cause a <jsf>SC_INTERNAL_SERVER_ERROR</jsf>.
- */
- public String getMethodOperationId(Method method, RestRequest req) throws Exception;
-
- /**
- * Returns the localized summary of the specified java method.
- *
- * @param method The Java method annotated with {@link RestMethod @RestMethod}.
- * @param req The current request.
- * @return The localized summary of the method, or <jk>null</jk> if none was found.
- * @throws Exception
- * Throw a {@link RestException} with a specific HTTP error status or any other exception
- * to cause a <jsf>SC_INTERNAL_SERVER_ERROR</jsf>.
- */
- public String getMethodSummary(Method method, RestRequest req) throws Exception;
-
- /**
- * Returns the localized description of the specified java method on this servlet.
- *
- * @param method The Java method annotated with {@link RestMethod @RestMethod}.
- * @param req The current request.
- * @return The localized description of the method, or <jk>null</jk> if none was was found.
- * @throws Exception
- * Throw a {@link RestException} with a specific HTTP error status or any other exception
- * to cause a <jsf>SC_INTERNAL_SERVER_ERROR</jsf>.
- */
- public String getMethodDescription(Method method, RestRequest req) throws Exception;
-
- /**
- * Returns the localized tags of the specified java method on this servlet.
- *
- * @param method The Java method annotated with {@link RestMethod @RestMethod}.
- * @param req The current request.
- * @return The localized tags of the method, or <jk>null</jk> if none were found.
- * @throws Exception
- * Throw a {@link RestException} with a specific HTTP error status or any other exception
- * to cause a <jsf>SC_INTERNAL_SERVER_ERROR</jsf>.
- */
- public List<String> getMethodTags(Method method, RestRequest req) throws Exception;
-
- /**
- * Returns the localized external documentation of the specified java method on this servlet.
- *
- * @param method The Java method annotated with {@link RestMethod @RestMethod}.
- * @param req The current request.
- * @return The localized external documentation of the method, or <jk>null</jk> if none was found.
- * @throws Exception
- * Throw a {@link RestException} with a specific HTTP error status or any other exception
- * to cause a <jsf>SC_INTERNAL_SERVER_ERROR</jsf>.
- */
- public ExternalDocumentation getMethodExternalDocs(Method method, RestRequest req) throws Exception;
-
- /**
- * Returns the localized parameter info for the specified java method.
- *
- * @param method The Java method annotated with {@link RestMethod @RestMethod}.
- * @param req The current request.
- * @return The localized parameter info of the method, or <jk>null</jk> if none were found.
- * @throws Exception
- * Throw a {@link RestException} with a specific HTTP error status or any other exception
- * to cause a <jsf>SC_INTERNAL_SERVER_ERROR</jsf>.
- */
- public List<ParameterInfo> getMethodParameters(Method method, RestRequest req) throws Exception;
-
- /**
- * Returns the localized Swagger response information about the specified Java method.
- *
- * @param method The Java method annotated with {@link RestMethod @RestMethod}.
- * @param req The current request.
- * @return The localized response information of the method, or <jk>null</jk> if none were found.
- * @throws Exception
- * Throw a {@link RestException} with a specific HTTP error status or any other exception
- * to cause a <jsf>SC_INTERNAL_SERVER_ERROR</jsf>.
- */
- public Map<Integer,ResponseInfo> getMethodResponses(Method method, RestRequest req) throws Exception;
-
- /**
- * Returns the supported <code>Accept</code> types the specified Java method.
- *
- * @param method The Java method annotated with {@link RestMethod @RestMethod}.
- * @param req The current request.
- * @return The supported <code>Accept</code> types of the method, or <jk>null</jk> if none were found.
- * @throws Exception
- * Throw a {@link RestException} with a specific HTTP error status or any other exception
- * to cause a <jsf>SC_INTERNAL_SERVER_ERROR</jsf>.
- */
- public List<MediaType> getMethodProduces(Method method, RestRequest req) throws Exception;
-
- /**
- * Returns the supported <code>Content-Type</code> types the specified Java method.
- *
- * @param method The Java method annotated with {@link RestMethod @RestMethod}.
- * @param req The current request.
- * @return The supported <code>Content-Type</code> types of the method, or <jk>null</jk> if none were found.
- * @throws Exception
- * Throw a {@link RestException} with a specific HTTP error status or any other exception
- * to cause a <jsf>SC_INTERNAL_SERVER_ERROR</jsf>.
- */
- public List<MediaType> getMethodConsumes(Method method, RestRequest req) throws Exception;
-
- /**
- * Returns whether the specified method is deprecated
- *
- * @param method The Java method annotated with {@link RestMethod @RestMethod}.
- * @param req The current request.
- * @return <jk>true</jk> if the method is deprecated.
- * @throws Exception
- * Throw a {@link RestException} with a specific HTTP error status or any other exception
- * to cause a <jsf>SC_INTERNAL_SERVER_ERROR</jsf>.
- */
- public boolean isDeprecated(Method method, RestRequest req) throws Exception;
-
- /**
* Returns the localized site name of the REST resource.
*
* @param req The current request.
@@ -232,98 +93,26 @@ public interface RestInfoProvider {
public String getDescription(RestRequest req) throws Exception;
/**
- * Returns the localized contact information of the REST resource.
- *
- * @param req The current request.
- * @return
- * The localized contact information of the REST resource, or <jk>null</jk> if none was found.
- * @throws Exception
- * Throw a {@link RestException} with a specific HTTP error status or any other exception
- * to cause a <jsf>SC_INTERNAL_SERVER_ERROR</jsf>.
- */
- public Contact getContact(RestRequest req) throws Exception;
-
- /**
- * Returns the localized license information of the REST resource.
- *
- * @param req The current request.
- * @return
- * The localized license information of the REST resource, or <jk>null</jk> if none was found.
- * @throws Exception
- * Throw a {@link RestException} with a specific HTTP error status or any other exception
- * to cause a <jsf>SC_INTERNAL_SERVER_ERROR</jsf>.
- */
- public License getLicense(RestRequest req) throws Exception;
-
- /**
- * Returns the terms-of-service iof the REST resource.
- *
- * @param req The current request.
- * @return
- * The localized terms-of-service of the REST resource, or <jk>null</jk> if none was found.
- * @throws Exception
- * Throw a {@link RestException} with a specific HTTP error status or any other exception
- * to cause a <jsf>SC_INTERNAL_SERVER_ERROR</jsf>.
- */
- public String getTermsOfService(RestRequest req) throws Exception;
-
- /**
- * Returns the localized version of the REST resource.
- *
- * @param req The current request.
- * @return
- * The localized version of the REST resource, or <jk>null</jk> if none was found.
- * @throws Exception
- * Throw a {@link RestException} with a specific HTTP error status or any other exception
- * to cause a <jsf>SC_INTERNAL_SERVER_ERROR</jsf>.
- */
- public String getVersion(RestRequest req) throws Exception;
-
- /**
- * Returns the supported <code>Content-Type</code> request headers for the REST resource.
- *
- * @param req The current request.
- * @return
- * The supported <code>Content-Type</code> request headers of the REST resource, or <jk>null</jk> if none were found.
- * @throws Exception
- * Throw a {@link RestException} with a specific HTTP error status or any other exception
- * to cause a <jsf>SC_INTERNAL_SERVER_ERROR</jsf>.
- */
- public List<MediaType> getConsumes(RestRequest req) throws Exception;
-
- /**
- * Returns the supported <code>Accept</code> request headers for the REST resource.
- *
- * @param req The current request.
- * @return
- * The supported <code>Accept</code> request headers of the REST resource, or <jk>null</jk> if none were found.
- * @throws Exception
- * Throw a {@link RestException} with a specific HTTP error status or any other exception
- * to cause a <jsf>SC_INTERNAL_SERVER_ERROR</jsf>.
- */
- public List<MediaType> getProduces(RestRequest req) throws Exception;
-
- /**
- * Returns the localized tags of the REST resource.
+ * Returns the localized summary of the specified java method.
*
+ * @param method The Java method annotated with {@link RestMethod @RestMethod}.
* @param req The current request.
- * @return
- * The localized tags of the REST resource, or <jk>null</jk> if none was found.
+ * @return The localized summary of the method, or <jk>null</jk> if none was found.
* @throws Exception
* Throw a {@link RestException} with a specific HTTP error status or any other exception
* to cause a <jsf>SC_INTERNAL_SERVER_ERROR</jsf>.
*/
- public List<Tag> getTags(RestRequest req) throws Exception;
+ public String getMethodSummary(Method method, RestRequest req) throws Exception;
/**
- * Returns the external documentation of the REST resource.
+ * Returns the localized description of the specified java method on this servlet.
*
+ * @param method The Java method annotated with {@link RestMethod @RestMethod}.
* @param req The current request.
- * @return
- * The localized external documentation of the REST resource, or <jk>null</jk> if none was found.
+ * @return The localized description of the method, or <jk>null</jk> if none was was found.
* @throws Exception
* Throw a {@link RestException} with a specific HTTP error status or any other exception
* to cause a <jsf>SC_INTERNAL_SERVER_ERROR</jsf>.
*/
- public ExternalDocumentation getExternalDocs(RestRequest req) throws Exception;
+ public String getMethodDescription(Method method, RestRequest req) throws Exception;
}
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestInfoProviderDefault.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestInfoProviderDefault.java
index 2f6c273..c745221 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestInfoProviderDefault.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestInfoProviderDefault.java
@@ -129,14 +129,13 @@ public class RestInfoProviderDefault implements RestInfoProvider {
* it as a parsed {@link Swagger} object.
*
* <p>
- * Returned objects are cached for later quick-lookup.
+ * Returned objects are cached per-locale for later quick-lookup.
*
* @param req The incoming HTTP request.
* @return The parsed swagger object, or <jk>null</jk> if none could be found.
* @throws Exception
* If swagger file was not valid JSON.
*/
- @Override /* RestInfoProvider */
public Swagger getSwaggerFromFile(RestRequest req) throws Exception {
Locale locale = req.getLocale();
Swagger s = swaggers.get(locale);
@@ -222,7 +221,6 @@ public class RestInfoProviderDefault implements RestInfoProvider {
* @return The localized operation ID of the method, or <jk>null</jk> if none was found.
* @throws Exception
*/
- @Override /* RestInfoProvider */
public String getMethodOperationId(Method method, RestRequest req) throws Exception {
return method.getName();
}
@@ -389,7 +387,6 @@ public class RestInfoProviderDefault implements RestInfoProvider {
* @return The localized tags of the method, or <jk>null</jk> if none were found.
* @throws Exception
*/
- @Override /* RestInfoProvider */
public List<String> getMethodTags(Method method, RestRequest req) throws Exception {
JsonParser p = JsonParser.DEFAULT;
VarResolverSession vr = req.getVarResolverSession();
@@ -455,7 +452,6 @@ public class RestInfoProviderDefault implements RestInfoProvider {
* @return The localized external documentation of the method, or <jk>null</jk> if none was found.
* @throws Exception
*/
- @Override /* RestInfoProvider */
public ExternalDocumentation getMethodExternalDocs(Method method, RestRequest req) throws Exception {
JsonParser p = JsonParser.DEFAULT;
VarResolverSession vr = req.getVarResolverSession();
@@ -527,7 +523,6 @@ public class RestInfoProviderDefault implements RestInfoProvider {
* @return The localized parameter info of the method, or <jk>null</jk> if none was found.
* @throws Exception
*/
- @Override /* RestInfoProvider */
public List<ParameterInfo> getMethodParameters(Method method, RestRequest req) throws Exception {
Operation o = getSwaggerOperationFromFile(method, req);
@@ -666,7 +661,6 @@ public class RestInfoProviderDefault implements RestInfoProvider {
* @throws Exception
*/
@SuppressWarnings("unchecked")
- @Override /* RestInfoProvider */
public Map<Integer,ResponseInfo> getMethodResponses(Method method, RestRequest req) throws Exception {
Operation o = getSwaggerOperationFromFile(method, req);
@@ -751,7 +745,6 @@ public class RestInfoProviderDefault implements RestInfoProvider {
* or the list of media types match those of the parent resource class.
* @throws Exception
*/
- @Override /* RestInfoProvider */
public List<MediaType> getMethodProduces(Method method, RestRequest req) throws Exception {
VarResolverSession vr = req.getVarResolverSession();
String[] s = method.getAnnotation(RestMethod.class).produces();
@@ -787,7 +780,6 @@ public class RestInfoProviderDefault implements RestInfoProvider {
* or the list of media types match those of the parent resource class.
* @throws Exception
*/
- @Override /* RestInfoProvider */
public List<MediaType> getMethodConsumes(Method method, RestRequest req) throws Exception {
VarResolverSession vr = req.getVarResolverSession();
String[] s = method.getAnnotation(RestMethod.class).consumes();
@@ -820,7 +812,6 @@ public class RestInfoProviderDefault implements RestInfoProvider {
* @return <jk>true</jk> if the method is deprecated.
* @throws Exception
*/
- @Override /* RestInfoProvider */
public boolean isDeprecated(Method method, RestRequest req) throws Exception {
return method.getAnnotation(RestMethod.class).swagger().deprecated();
}
@@ -1036,7 +1027,6 @@ public class RestInfoProviderDefault implements RestInfoProvider {
* The localized contact information of this REST resource, or <jk>null</jk> if none was found.
* @throws Exception
*/
- @Override /* RestInfoProvider */
public Contact getContact(RestRequest req) throws Exception {
VarResolverSession vr = req.getVarResolverSession();
JsonParser jp = JsonParser.DEFAULT;
@@ -1102,7 +1092,6 @@ public class RestInfoProviderDefault implements RestInfoProvider {
* The localized license information of this REST resource, or <jk>null</jk> if none was found found.
* @throws Exception
*/
- @Override /* RestInfoProvider */
public License getLicense(RestRequest req) throws Exception {
VarResolverSession vr = req.getVarResolverSession();
JsonParser jp = JsonParser.DEFAULT;
@@ -1168,7 +1157,6 @@ public class RestInfoProviderDefault implements RestInfoProvider {
* The localized terms-of-service of this REST resource, or <jk>null</jk> if none was found.
* @throws Exception
*/
- @Override /* RestInfoProvider */
public String getTermsOfService(RestRequest req) throws Exception {
VarResolverSession vr = req.getVarResolverSession();
if (termsOfService != null)
@@ -1229,7 +1217,6 @@ public class RestInfoProviderDefault implements RestInfoProvider {
* The localized version of this REST resource, or <jk>null</jk> if none was found.
* @throws Exception
*/
- @Override /* RestInfoProvider */
public String getVersion(RestRequest req) throws Exception {
VarResolverSession vr = req.getVarResolverSession();
if (version != null)
@@ -1286,7 +1273,6 @@ public class RestInfoProviderDefault implements RestInfoProvider {
* The supported <code>Content-Type</code> request headers of the REST resource, or <jk>null</jk> if none were found.
* @throws Exception
*/
- @Override /* RestInfoProvider */
public List<MediaType> getConsumes(RestRequest req) throws Exception {
List<MediaType> l = req.getContext().getConsumes();
return l.isEmpty() ? null : l;
@@ -1300,7 +1286,6 @@ public class RestInfoProviderDefault implements RestInfoProvider {
* The supported <code>Accept</code> request headers of the REST resource, or <jk>null</jk> if none were found.
* @throws Exception
*/
- @Override /* RestInfoProvider */
public List<MediaType> getProduces(RestRequest req) throws Exception {
List<MediaType> l = req.getContext().getProduces();
return l.isEmpty() ? null : l;
@@ -1357,7 +1342,6 @@ public class RestInfoProviderDefault implements RestInfoProvider {
* The localized tags of this REST resource, or <jk>null</jk> if none was found.
* @throws Exception
*/
- @Override /* RestInfoProvider */
public List<Tag> getTags(RestRequest req) throws Exception {
VarResolverSession vr = req.getVarResolverSession();
JsonParser jp = JsonParser.DEFAULT;
@@ -1424,7 +1408,6 @@ public class RestInfoProviderDefault implements RestInfoProvider {
* The localized external documentation of this REST resource, or <jk>null</jk> if none was found.
* @throws Exception
*/
- @Override /* RestInfoProvider */
public ExternalDocumentation getExternalDocs(RestRequest req) throws Exception {
VarResolverSession vr = req.getVarResolverSession();
JsonParser jp = JsonParser.DEFAULT;
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/HtmlDoc.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/HtmlDoc.java
index 8af55eb..4111b89 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/HtmlDoc.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/HtmlDoc.java
@@ -29,17 +29,22 @@ import org.apache.juneau.rest.widget.*;
* provided as a shorthand method of for specifying configuration properties.
*
* <p>
- * For example, the following two methods for defining the HTML document title are considered equivalent:
+ * For example, the following two methods for defining the HTML nav links are considered equivalent:
* <p class='bcode'>
+ * <jc>// Defined via properties.</jc>
* <ja>@RestResource</ja>(
* properties={
- * <ja>@Property</ja>(name=<jsf>HTMLDOC_title</jsf>, value=<js>"My Resource Page"</js>)
+ * <ja>@Property</ja>(name=HtmlDocSerializer.<jsf>HTMLDOC_navlinks</jsf>, value=<js>"{options:'?method=OPTIONS',doc:'doc'}"</js>)
* }
* )
*
+ * <jc>// Defined via annotation.</jc>
* <ja>@RestResource</ja>(
* htmldoc=<ja>@HtmlDoc</ja>(
- * title=<js>"My Resource Page"</js>
+ * navlinks={
+ * <js>"options: ?method=OPTIONS"</js>,
+ * <js>"doc: doc"</js>
+ * }
* )
* )
* </p>
@@ -102,18 +107,16 @@ public @interface HtmlDoc {
* )
* </p>
*
- * <h6 class='topic'>Other Notes</h6>
+ * <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * This field can contain variables (e.g. <js>"$L{my.localized.variable}"</js>).
- * <br>See {@link RestContext#getVarResolver()} for the list of supported variables.
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
+ * (e.g. <js>"$L{my.localized.variable}"</js>).
* <li>
* A value of <js>"NONE"</js> can be used to force no value.
* <li>
* Multiple values are combined with newlines into a single string.
* <li>
- * The programmatic equivalent to this annotation is the {@link HtmlDocBuilder#aside(Object[])} method.
- * <li>
* On methods, this value is inherited from the <ja>@HtmlDoc</ja> annotation on the servlet/resource class.
* <li>
* On servlet/resource classes, this value is inherited from the <ja>@HtmlDoc</ja> annotation on the
@@ -121,6 +124,12 @@ public @interface HtmlDoc {
* <li>
* The parent value can be included by adding the literal <js>"INHERIT"</js> as a value.
* </ul>
+ *
+ * <h5 class='section'>See Also:</h5>
+ * <ul>
+ * <li class='jf'>{@link HtmlDocSerializer#HTMLDOC_aside}
+ * <li class='jm'>{@link HtmlDocBuilder#aside(Object...)}
+ * </ul>
*/
String[] aside() default {};
@@ -144,18 +153,16 @@ public @interface HtmlDoc {
* )
* </p>
*
- * <h6 class='topic'>Other Notes</h6>
+ * <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * This field can contain variables (e.g. <js>"$L{my.localized.variable}"</js>).
- * <br>See {@link RestContext#getVarResolver()} for the list of supported variables.
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
+ * (e.g. <js>"$L{my.localized.variable}"</js>).
* <li>
* A value of <js>"NONE"</js> can be used to force no value.
* <li>
* Multiple values are combined with newlines into a single string.
* <li>
- * The programmatic equivalent to this annotation is the {@link HtmlDocBuilder#footer(Object[])} methods.
- * <li>
* On methods, this value is inherited from the <ja>@HtmlDoc</ja> annotation on the servlet/resource class.
* <li>
* On servlet/resource classes, this value is inherited from the <ja>@HtmlDoc</ja> annotation on the
@@ -163,6 +170,12 @@ public @interface HtmlDoc {
* <li>
* The parent value can be included by adding the literal <js>"INHERIT"</js> as a value.
* </ul>
+ *
+ * <h5 class='section'>See Also:</h5>
+ * <ul>
+ * <li class='jf'>{@link HtmlDocSerializer#HTMLDOC_footer}
+ * <li class='jm'>{@link HtmlDocBuilder#footer(Object...)}
+ * </ul>
*/
String[] footer() default {};
@@ -178,32 +191,36 @@ public @interface HtmlDoc {
* htmldoc=<ja>@HtmlDoc</ja>(
* head={
* <jc>// Add a shortcut link in the browser tab</jc>
- * <js>"<link rel='icon' href='$U{servlet:/htdocs/mypageicon.ico}'>"</js>,
+ * <js>"<link rel='icon' href='$U{servlet:/htdocs/mypageicon.ico}'>"</js>,
*
* <jc>// Reload the page every 5 seconds </jc>
- * <js>"<meta http-equiv='refresh' content='5'>"</js>
+ * <js>"<meta http-equiv='refresh' content='5'>"</js>
* }
* )
* )
* </p>
*
- * <h6 class='topic'>Other Notes</h6>
+ * <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * This field can contain variables (e.g. <js>"$L{my.localized.variable}"</js>).
- * <br>See {@link RestContext#getVarResolver()} for the list of supported variables.
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
+ * (e.g. <js>"$L{my.localized.variable}"</js>).
* <li>
* A value of <js>"NONE"</js> can be used to force no value.
* <li>
* The head content from the parent can be included by adding the literal <js>"INHERIT"</js> as a value.
* <li>
- * The programmatic equivalent to this annotation is the {@link HtmlDocBuilder#head(Object[])} method.
- * <li>
* On methods, this value is inherited from the <ja>@HtmlDoc</ja> annotation on the servlet/resource class.
* <li>
* On servlet/resource classes, this value is inherited from the <ja>@HtmlDoc</ja> annotation on the
* parent class.
* </ul>
+ *
+ * <h5 class='section'>See Also:</h5>
+ * <ul>
+ * <li class='jf'>{@link HtmlDocSerializer#HTMLDOC_head}
+ * <li class='jm'>{@link HtmlDocBuilder#head(Object...)}
+ * </ul>
*/
String[] head() default {};
@@ -228,18 +245,16 @@ public @interface HtmlDoc {
* )
* </p>
*
- * <h6 class='topic'>Other Notes</h6>
+ * <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
* A value of <js>"NONE"</js> can be used to force no header.
* <li>
- * This field can contain variables (e.g. <js>"$L{my.localized.variable}"</js>).
- * <br>See {@link RestContext#getVarResolver()} for the list of supported variables.
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
+ * (e.g. <js>"$L{my.localized.variable}"</js>).
* <li>
* Multiple values are combined with newlines into a single string.
* <li>
- * The programmatic equivalent to this annotation is the {@link HtmlDocBuilder#header(Object[])} method.
- * <li>
* On methods, this value is inherited from the <ja>@HtmlDoc</ja> annotation on the servlet/resource class.
* <li>
* On servlet/resource classes, this value is inherited from the <ja>@HtmlDoc</ja> annotation on the
@@ -247,6 +262,12 @@ public @interface HtmlDoc {
* <li>
* The parent value can be included by adding the literal <js>"INHERIT"</js> as a value.
* </ul>
+ *
+ * <h5 class='section'>See Also:</h5>
+ * <ul>
+ * <li class='jf'>{@link HtmlDocSerializer#HTMLDOC_header}
+ * <li class='jm'>{@link HtmlDocBuilder#header(Object...)}
+ * </ul>
*/
String[] header() default {};
@@ -273,20 +294,18 @@ public @interface HtmlDoc {
* )
* </p>
*
- * <h6 class='topic'>Other Notes</h6>
+ * <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
* When a value is specified, the {@link #navlinks()} value will be ignored.
* <li>
- * This field can contain variables (e.g. <js>"$L{my.localized.variable}"</js>).
- * <br>See {@link RestContext#getVarResolver()} for the list of supported variables.
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
+ * (e.g. <js>"$L{my.localized.variable}"</js>).
* <li>
* A value of <js>"NONE"</js> can be used to force no value.
* <li>
* Multiple values are combined with newlines into a single string.
* <li>
- * The programmatic equivalent to this annotation is the {@link HtmlDocBuilder#nav(Object[])} method.
- * <li>
* On methods, this value is inherited from the <ja>@HtmlDoc</ja> annotation on the servlet/resource class.
* <li>
* On servlet/resource classes, this value is inherited from the <ja>@HtmlDoc</ja> annotation on the
@@ -294,6 +313,12 @@ public @interface HtmlDoc {
* <li>
* The parent value can be included by adding the literal <js>"INHERIT"</js> as a value.
* </ul>
+ *
+ * <h5 class='section'>See Also:</h5>
+ * <ul>
+ * <li class='jf'>{@link HtmlDocSerializer#HTMLDOC_nav}
+ * <li class='jm'>{@link HtmlDocBuilder#nav(Object...)}
+ * </ul>
*/
String[] nav() default {};
@@ -323,18 +348,16 @@ public @interface HtmlDoc {
* )
* </p>
*
- * <h6 class='topic'>Other Notes</h6>
+ * <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * This field can contain variables (e.g. <js>"$L{my.localized.variable}"</js>).
- * <br>See {@link RestContext#getVarResolver()} for the list of supported variables.
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
+ * (e.g. <js>"$L{my.localized.variable}"</js>).
* <li>
* A value of <js>"NONE"</js> can be used to force no value.
* <li>
* This field can also use URIs of any support type in {@link UriResolver}.
* <li>
- * The programmatic equivalent to this annotation is the {@link HtmlDocBuilder#navlinks(Object[])} method.
- * <li>
* On methods, this value is inherited from the <ja>@HtmlDoc</ja> annotation on the servlet/resource class.
* <li>
* On servlet/resource classes, this value is inherited from the <ja>@HtmlDoc</ja> annotation on the
@@ -344,11 +367,30 @@ public @interface HtmlDoc {
* <br>Use the syntax <js>"key[index]: value"</js> or <js>"[index]: value"</js> to specify an index location
* to place a link inside the list of parent links.
* </ul>
+ *
+ * <h5 class='section'>See Also:</h5>
+ * <ul>
+ * <li class='jf'>{@link HtmlDocSerializer#HTMLDOC_navlinks}
+ * <li class='jm'>{@link HtmlDocBuilder#navlinks(Object...)}
+ * </ul>
*/
String[] navlinks() default {};
/**
* Specifies the text to display when serializing an empty array or collection.
+ *
+ * <h5 class='section'>Notes:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
+ * (e.g. <js>"$L{my.localized.variable}"</js>).
+ * </ul>
+ *
+ * <h5 class='section'>See Also:</h5>
+ * <ul>
+ * <li class='jf'>{@link HtmlDocSerializer#HTMLDOC_noResultsMessage}
+ * <li class='jm'>{@link HtmlDocBuilder#noResultsMessage(Object)}
+ * </ul>
*/
String noResultsMessage() default "no results";
@@ -357,6 +399,12 @@ public @interface HtmlDoc {
*
* <p>
* This only applies to the rendered data portion of the page.
+ *
+ * <h5 class='section'>See Also:</h5>
+ * <ul>
+ * <li class='jf'>{@link HtmlDocSerializer#HTMLDOC_nowrap}
+ * <li class='jm'>{@link HtmlDocBuilder#nowrap(boolean)}
+ * </ul>
*/
boolean nowrap() default false;
@@ -377,18 +425,16 @@ public @interface HtmlDoc {
* )
* </p>
*
- * <h6 class='topic'>Other Notes</h6>
+ * <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * This field can contain variables (e.g. <js>"$L{my.localized.variable}"</js>).
- * <br>See {@link RestContext#getVarResolver()} for the list of supported variables.
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
+ * (e.g. <js>"$L{my.localized.variable}"</js>).
* <li>
* A value of <js>"NONE"</js> can be used to force no value.
* <li>
* Multiple values are combined with newlines into a single string.
* <li>
- * The programmatic equivalent to this annotation is the {@link HtmlDocBuilder#script(Object[])} method.
- * <li>
* On methods, this value is inherited from the <ja>@HtmlDoc</ja> annotation on the servlet/resource class.
* <li>
* On servlet/resource classes, this value is inherited from the <ja>@HtmlDoc</ja> annotation on the
@@ -396,6 +442,12 @@ public @interface HtmlDoc {
* <li>
* The parent value can be included by adding the literal <js>"INHERIT"</js> as a value.
* </ul>
+ *
+ * <h5 class='section'>See Also:</h5>
+ * <ul>
+ * <li class='jf'>{@link HtmlDocSerializer#HTMLDOC_script}
+ * <li class='jm'>{@link HtmlDocBuilder#script(Object[])}
+ * </ul>
*/
String[] script() default {};
@@ -417,18 +469,16 @@ public @interface HtmlDoc {
* )
* </p>
*
- * <h6 class='topic'>Other Notes</h6>
+ * <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * This field can contain variables (e.g. <js>"$L{my.localized.variable}"</js>).
- * <br>See {@link RestContext#getVarResolver()} for the list of supported variables.
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
+ * (e.g. <js>"$L{my.localized.variable}"</js>).
* <li>
* A value of <js>"NONE"</js> can be used to force no value.
* <li>
* Multiple values are combined with newlines into a single string.
* <li>
- * The programmatic equivalent to this annotation is the {@link HtmlDocBuilder#style(Object[])} method.
- * <li>
* On methods, this value is inherited from the <ja>@HtmlDoc</ja> annotation on the servlet/resource class.
* <li>
* On servlet/resource classes, this value is inherited from the <ja>@HtmlDoc</ja> annotation on the
@@ -436,6 +486,12 @@ public @interface HtmlDoc {
* <li>
* The parent value can be included by adding the literal <js>"INHERIT"</js> as a value.
* </ul>
+ *
+ * <h5 class='section'>See Also:</h5>
+ * <ul>
+ * <li class='jf'>{@link HtmlDocSerializer#HTMLDOC_style}
+ * <li class='jm'>{@link HtmlDocBuilder#style(Object[])}
+ * </ul>
*/
String[] style() default {};
@@ -460,20 +516,23 @@ public @interface HtmlDoc {
* )
* </p>
*
- * <h6 class='topic'>Other Notes</h6>
+ * <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * This field can contain variables (e.g. <js>"$L{my.localized.variable}"</js>) and can use URL protocols
- * defined by {@link UriResolver}.
- * <br>See {@link RestContext#getVarResolver()} for the list of supported variables.
- * <li>
- * The programmatic equivalent to this annotation is the {@link HtmlDocBuilder#stylesheet(Object[])} method.
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
+ * (e.g. <js>"$L{my.localized.variable}"</js>).
* <li>
* On methods, this value is inherited from the <ja>@HtmlDoc</ja> annotation on the servlet/resource class.
* <li>
* On servlet/resource classes, this value is inherited from the <ja>@HtmlDoc</ja> annotation on the
* parent class.
* </ul>
+ *
+ * <h5 class='section'>See Also:</h5>
+ * <ul>
+ * <li class='jf'>{@link HtmlDocSerializer#HTMLDOC_stylesheet}
+ * <li class='jm'>{@link HtmlDocBuilder#stylesheet(Object[])}
+ * </ul>
*/
String[] stylesheet() default {};
@@ -484,16 +543,21 @@ public @interface HtmlDoc {
* By default, uses {@link HtmlDocTemplateBasic} to render the contents, although you can provide your own custom
* renderer or subclasses from the basic class to have full control over how the page is rendered.
*
- * <h6 class='topic'>Other Notes</h6>
+ * <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
- * The programmatic equivalent to this annotation is the {@link HtmlDocBuilder#template(Class)} method.
- * <li>
* On methods, this value is inherited from the <ja>@HtmlDoc</ja> annotation on the servlet/resource class.
* <li>
* On servlet/resource classes, this value is inherited from the <ja>@HtmlDoc</ja> annotation on the
* parent class.
* </ul>
+ *
+ * <h5 class='section'>See Also:</h5>
+ * <ul>
+ * <li class='jf'>{@link HtmlDocSerializer#HTMLDOC_template}
+ * <li class='jm'>{@link HtmlDocBuilder#template(Class)}
+ * <li class='jm'>{@link HtmlDocBuilder#template(HtmlDocTemplate)}
+ * </ul>
*/
Class<? extends HtmlDocTemplate> template() default HtmlDocTemplate.class;
@@ -537,19 +601,18 @@ public @interface HtmlDoc {
*
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
- * <li>Property: {@link RestContext#REST_widgets}
- * <li>Annotations:
- * <ul>
- * <li class='ja'>{@link HtmlDoc#widgets()}
- * </ul>
- * <li>Methods:
- * <ul>
- * <li class='jm'>{@link RestContextBuilder#widgets(Class...)}
- * <li class='jm'>{@link RestContextBuilder#widgets(Widget...)}
- * <li class='jm'>{@link RestContextBuilder#widgets(boolean,Widget...)}
- * </ul>
- * <li>Widgets are inherited from parent to child, but can be overridden by reusing the widget name.
- * <li>Values are appended to the existing list.
+ * <li>
+ * Widgets are inherited from parent to child, but can be overridden by reusing the widget name.
+ * <li>
+ * Values are appended to the existing list.
+ * </ul>
+ *
+ * <h5 class='section'>See Also:</h5>
+ * <ul>
+ * <li class='jf'>{@link RestContext#REST_widgets}
+ * <li class='jm'>{@link RestContextBuilder#widgets(Class...)}
+ * <li class='jm'>{@link RestContextBuilder#widgets(Widget...)}
+ * <li class='jm'>{@link RestContextBuilder#widgets(boolean,Widget...)}
* </ul>
*/
Class<? extends Widget>[] widgets() default {};
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/MethodSwagger.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/MethodSwagger.java
index ea9c5cd..f28faad 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/MethodSwagger.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/MethodSwagger.java
@@ -12,9 +12,7 @@
// ***************************************************************************************************************************
package org.apache.juneau.rest.annotation;
-import org.apache.juneau.ini.*;
-import org.apache.juneau.rest.vars.*;
-import org.apache.juneau.svl.vars.*;
+import org.apache.juneau.rest.*;
/**
* Extended annotation for {@link RestMethod#swagger() RestMethod.swagger()}.
@@ -33,11 +31,6 @@ public @interface MethodSwagger {
* <p>
* Used to populate the Swagger deprecated field.
*
- * <p>
- * The default value pulls the description from the <code>(className.?)[javaMethodName].deprecated</code> entry in
- * the servlet resource bundle.
- * (e.g. <js>"MyClass.myMethod.deprecated = true"</js> or <js>"myMethod.deprecated = foo,bar"</js>).
- *
* <h5 class='section'>Example:</h5>
* <p class='bcode'>
* <ja>@RestMethod</ja>(
@@ -47,31 +40,16 @@ public @interface MethodSwagger {
* )
* </p>
*
- * <p>
- * Value can contain any of the following variables:
- * {@link ConfigFileVar $C}
- * {@link CoalesceVar $CO}
- * {@link CoalesceAndRecurseVar $CR}
- * {@link EnvVariablesVar $E}
- * {@link FileVar $F}
- * {@link ServletInitParamVar $I},
- * {@link IfVar $IF}
- * {@link LocalizationVar $L}
- * {@link RequestAttributeVar $RA}
- * {@link RequestFormDataVar $RF}
- * {@link RequestHeaderVar $RH}
- * {@link RequestPathVar $RP}
- * {@link RequestQueryVar $RQ}
- * {@link RequestVar $R}
- * {@link SystemPropertiesVar $S}
- * {@link SerializedRequestAttrVar $SA}
- * {@link SwitchVar $SW}
- * {@link UrlVar $U}
- * {@link UrlEncodeVar $UE}
- * {@link WidgetVar $W}
+ * <h5 class='section'>Notes:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Corresponds to the swagger field <code>/paths/{path}/{method}/deprecated</code>.
+ * </ul>
*
- * <p>
- * Corresponds to the swagger field <code>/paths/{path}/{method}/deprecated</code>.
+ * <h5 class='section'>See Also:</h5>
+ * <ul>
+ * <li class='jm'>{@link RestInfoProviderDefault#isDeprecated(java.lang.reflect.Method, RestRequest) RestInfoProviderDefault.isDeprecated(Method,RestRequest)}
+ * </ul>
*/
boolean deprecated() default false;
@@ -90,12 +68,6 @@ public @interface MethodSwagger {
* }
* </p>
*
- * <p>
- * The default value pulls the description from the <code>(className.?)[javaMethodName].externalDocs</code> entry in
- * the servlet resource bundle.
- * (e.g. <js>"MyClass.myMethod.externalDocs = {url:'http://juneau.apache.org'}"</js> or
- * <js>"myMethod.externalDocs = {url:'http://juneau.apache.org'}"</js>).
- *
* <h5 class='section'>Example:</h5>
* <p class='bcode'>
* <ja>@RestMethod</ja>(
@@ -105,31 +77,19 @@ public @interface MethodSwagger {
* )
* </p>
*
- * <p>
- * Value can contain any of the following variables:
- * {@link ConfigFileVar $C}
- * {@link CoalesceVar $CO}
- * {@link CoalesceAndRecurseVar $CR}
- * {@link EnvVariablesVar $E}
- * {@link FileVar $F}
- * {@link ServletInitParamVar $I},
- * {@link IfVar $IF}
- * {@link LocalizationVar $L}
- * {@link RequestAttributeVar $RA}
- * {@link RequestFormDataVar $RF}
- * {@link RequestHeaderVar $RH}
- * {@link RequestPathVar $RP}
- * {@link RequestQueryVar $RQ}
- * {@link RequestVar $R}
- * {@link SystemPropertiesVar $S}
- * {@link SerializedRequestAttrVar $SA}
- * {@link SwitchVar $SW}
- * {@link UrlVar $U}
- * {@link UrlEncodeVar $UE}
- * {@link WidgetVar $W}
- *
- * <p>
- * Corresponds to the swagger field <code>/paths/{path}/{method}/externalDocs</code>.
+ * <h5 class='section'>Notes:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
+ * (e.g. <js>"$L{my.localized.variable}"</js>).
+ * <li>
+ * Corresponds to the swagger field <code>/paths/{path}/{method}/externalDocs</code>.
+ * </ul>
+ *
+ * <h5 class='section'>See Also:</h5>
+ * <ul>
+ * <li class='jm'>{@link RestInfoProviderDefault#getMethodExternalDocs(java.lang.reflect.Method, RestRequest) RestInfoProviderDefault.getMethodExternalDocs(Method,RestRequest)}
+ * </ul>
*/
String externalDocs() default "";
@@ -156,46 +116,19 @@ public @interface MethodSwagger {
* )
* </p>
*
- * <p>
- * This is functionally equivalent to specifying the following keys in the resource bundle for the class, except in
- * this case the strings are internationalized.
- * <p class='bcode'>
- * <jk>MyClass.myMethod.description</jk> = <js>This is my method.</js>
- * <jk>MyClass.myMethod.req.path.a.description</jk> = <js>The 'a' attribute</js>
- * <jk>MyClass.myMethod.req.query.b.description</jk> = <js>The 'b' parameter</js>
- * <jk>MyClass.myMethod.req.body.description</jk> = <js>The HTTP content</js>
- * <jk>MyClass.myMethod.req.header.d.description</jk> = <js>The 'D' header</js>
- * </p>
- *
- * <p>
- * As a general rule, use annotations when you don't care about internationalization (i.e. you only want to support
- * English), and use resource bundles if you need to support localization.
- *
- * <p>
- * Value can contain any of the following variables:
- * {@link ConfigFileVar $C}
- * {@link CoalesceVar $CO}
- * {@link CoalesceAndRecurseVar $CR}
- * {@link EnvVariablesVar $E}
- * {@link FileVar $F}
- * {@link ServletInitParamVar $I},
- * {@link IfVar $IF}
- * {@link LocalizationVar $L}
- * {@link RequestAttributeVar $RA}
- * {@link RequestFormDataVar $RF}
- * {@link RequestHeaderVar $RH}
- * {@link RequestPathVar $RP}
- * {@link RequestQueryVar $RQ}
- * {@link RequestVar $R}
- * {@link SystemPropertiesVar $S}
- * {@link SerializedRequestAttrVar $SA}
- * {@link SwitchVar $SW}
- * {@link UrlVar $U}
- * {@link UrlEncodeVar $UE}
- * {@link WidgetVar $W}
- *
- * <p>
- * Corresponds to the swagger field <code>/paths/{path}/{method}/parameters</code>.
+ * <h5 class='section'>Notes:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
+ * (e.g. <js>"$L{my.localized.variable}"</js>).
+ * <li>
+ * Corresponds to the swagger field <code>/paths/{path}/{method}/parameters</code>.
+ * </ul>
+ *
+ * <h5 class='section'>See Also:</h5>
+ * <ul>
+ * <li class='jm'>{@link RestInfoProviderDefault#getMethodParameters(java.lang.reflect.Method, RestRequest) RestInfoProviderDefault.getMethodParameters(Method,RestRequest)}
+ * </ul>
*/
Parameter[] parameters() default {};
@@ -225,41 +158,19 @@ public @interface MethodSwagger {
* )
* </p>
*
- * <p>
- * This is functionally equivalent to specifying the following keys in the resource bundle for the class, except in
- * this case the strings are internationalized.
- * <p class='bcode'>
- * <jk>MyClass.myMethod.res.200.description</jk> = <js>OK</js>
- * <jk>MyClass.myMethod.res.302.description</jk> = <js>Thing wasn't found here</js>
- * <jk>MyClass.myMethod.res.302.header.Location.description</jk> = <js>The place to find the thing</js>
- * </p>
- *
- * <p>
- * As a general rule, use annotations when you don't care about internationalization (i.e. you only want to support
- * English), and use resource bundles if you need to support localization.
- *
- * <p>
- * Value can contain any of the following variables:
- * {@link ConfigFileVar $C}
- * {@link CoalesceVar $CO}
- * {@link CoalesceAndRecurseVar $CR}
- * {@link EnvVariablesVar $E}
- * {@link FileVar $F}
- * {@link ServletInitParamVar $I},
- * {@link IfVar $IF}
- * {@link LocalizationVar $L}
- * {@link RequestAttributeVar $RA}
- * {@link RequestFormDataVar $RF}
- * {@link RequestHeaderVar $RH}
- * {@link RequestPathVar $RP}
- * {@link RequestQueryVar $RQ}
- * {@link RequestVar $R}
- * {@link SystemPropertiesVar $S}
- * {@link SerializedRequestAttrVar $SA}
- * {@link SwitchVar $SW}
- * {@link UrlVar $U}
- * {@link UrlEncodeVar $UE}
- * {@link WidgetVar $W}
+ * <h5 class='section'>Notes:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
+ * (e.g. <js>"$L{my.localized.variable}"</js>).
+ * <li>
+ * Corresponds to the swagger field <code>/paths/{path}/{method}/responses</code>.
+ * </ul>
+ *
+ * <h5 class='section'>See Also:</h5>
+ * <ul>
+ * <li class='jm'>{@link RestInfoProviderDefault#getMethodResponses(java.lang.reflect.Method, RestRequest) RestInfoProviderDefault.getMethodResponses(Method,RestRequest)}
+ * </ul>
*/
Response[] responses() default {};
@@ -271,12 +182,7 @@ public @interface MethodSwagger {
*
* <p>
* A comma-delimited list of tags for API documentation control.
- * Tags can be used for logical grouping of operations by resources or any other qualifier.
- *
- * <p>
- * The default value pulls the description from the <code>(className.?)[javaMethodName].tags</code> entry in the
- * servlet resource bundle.
- * (e.g. <js>"MyClass.myMethod.tags = foo,bar"</js> or <js>"myMethod.tags = foo,bar"</js>).
+ * <br>Tags can be used for logical grouping of operations by resources or any other qualifier.
*
* <h5 class='section'>Example:</h5>
* <p class='bcode'>
@@ -287,31 +193,19 @@ public @interface MethodSwagger {
* )
* </p>
*
- * <p>
- * Value can contain any of the following variables:
- * {@link ConfigFileVar $C}
- * {@link CoalesceVar $CO}
- * {@link CoalesceAndRecurseVar $CR}
- * {@link EnvVariablesVar $E}
- * {@link FileVar $F}
- * {@link ServletInitParamVar $I},
- * {@link IfVar $IF}
- * {@link LocalizationVar $L}
- * {@link RequestAttributeVar $RA}
- * {@link RequestFormDataVar $RF}
- * {@link RequestHeaderVar $RH}
- * {@link RequestPathVar $RP}
- * {@link RequestQueryVar $RQ}
- * {@link RequestVar $R}
- * {@link SystemPropertiesVar $S}
- * {@link SerializedRequestAttrVar $SA}
- * {@link SwitchVar $SW}
- * {@link UrlVar $U}
- * {@link UrlEncodeVar $UE}
- * {@link WidgetVar $W}
- *
- * <p>
- * Corresponds to the swagger field <code>/paths/{path}/{method}/tags</code>.
+ * <h5 class='section'>Notes:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
+ * (e.g. <js>"$L{my.localized.variable}"</js>).
+ * <li>
+ * Corresponds to the swagger field <code>/paths/{path}/{method}/tags</code>.
+ * </ul>
+ *
+ * <h5 class='section'>See Also:</h5>
+ * <ul>
+ * <li class='jm'>{@link RestInfoProviderDefault#getMethodTags(java.lang.reflect.Method, RestRequest) RestInfoProviderDefault.getMethodTags(Method,RestRequest)}
+ * </ul>
*/
String tags() default "";
}
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/ResourceSwagger.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/ResourceSwagger.java
index 0c67183..7a70b0f 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/ResourceSwagger.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/ResourceSwagger.java
@@ -13,7 +13,6 @@
package org.apache.juneau.rest.annotation;
import org.apache.juneau.ini.*;
-import org.apache.juneau.rest.*;
import org.apache.juneau.rest.vars.*;
import org.apache.juneau.svl.vars.*;
@@ -83,9 +82,6 @@ public @interface ResourceSwagger {
*
* <p>
* Corresponds to the swagger field <code>/info/contact</code>.
- *
- * <p>
- * The programmatic equivalent to this annotation is the {@link RestInfoProvider#getContact(RestRequest)} method.
*/
String contact() default "";
@@ -143,10 +139,6 @@ public @interface ResourceSwagger {
*
* <p>
* Corresponds to the swagger field <code>/tags</code>.
- *
- * <p>
- * The programmatic equivalent to this annotation is the {@link RestInfoProvider#getExternalDocs(RestRequest)}
- * method.
*/
String externalDocs() default "";
@@ -204,9 +196,6 @@ public @interface ResourceSwagger {
*
* <p>
* Corresponds to the swagger field <code>/info/license</code>.
- *
- * <p>
- * The programmatic equivalent to this annotation is the {@link RestInfoProvider#getLicense(RestRequest)} method.
*/
String license() default "";
@@ -270,9 +259,6 @@ public @interface ResourceSwagger {
*
* <p>
* Corresponds to the swagger field <code>/tags</code>.
- *
- * <p>
- * The programmatic equivalent to this annotation is the {@link RestInfoProvider#getTags(RestRequest)} method.
*/
String tags() default "";
@@ -311,10 +297,6 @@ public @interface ResourceSwagger {
*
* <p>
* Corresponds to the swagger field <code>/info/termsOfService</code>.
- *
- * <p>
- * The programmatic equivalent to this annotation is the {@link RestInfoProvider#getTermsOfService(RestRequest)}
- * method.
*/
String termsOfService() default "";
@@ -353,9 +335,6 @@ public @interface ResourceSwagger {
*
* <p>
* Corresponds to the swagger field <code>/info/version</code>.
- *
- * <p>
- * The programmatic equivalent to this annotation is the {@link RestInfoProvider#getVersion(RestRequest)} method.
*/
String version() default "";
}
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestMethod.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestMethod.java
index 871bceb..b398a05 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestMethod.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestMethod.java
@@ -19,13 +19,10 @@ import java.lang.annotation.*;
import org.apache.juneau.*;
import org.apache.juneau.encoders.Encoder;
-import org.apache.juneau.ini.*;
import org.apache.juneau.parser.*;
import org.apache.juneau.remoteable.*;
import org.apache.juneau.rest.*;
-import org.apache.juneau.rest.vars.*;
import org.apache.juneau.serializer.*;
-import org.apache.juneau.svl.vars.*;
/**
* Identifies a REST Java method on a {@link RestServlet} implementation class.
@@ -63,7 +60,7 @@ public @interface RestMethod {
* In the example below, our 'summary' view is a list of beans where we only want to show the ID property,
* and our detail view is a single bean where we want to expose different fields:
* <p class='bcode'>
- * <jc>// Our bean</jc>
+ * <jc>// Our bean</jc>
* <jk>public class</jk> MyBean {
*
* <jc>// Summary properties</jc>
@@ -74,28 +71,28 @@ public @interface RestMethod {
* <jk>public</jk> String <jf>a</jf>, <jf>b</jf>;
* }
*
- * <jc>// Only render "id" property.</jc>
+ * <jc>// Only render "id" property.</jc>
* <ja>@RestMethod</ja>(name=<jsf>GET</jsf>, path=<js>"/mybeans"</js>, bpi=<js>"MyBean: id"</js>)
- * <jk>public</jk> List<MyBean> getBeanSummary();
+ * <jk>public</jk> List<MyBean> getBeanSummary() {...}
*
- * <jc>// Only render "a" and "b" properties.</jc>
+ * <jc>// Only render "a" and "b" properties.</jc>
* <ja>@RestMethod</ja>(name=<jsf>GET</jsf>, path=<js>"/mybeans/{id}"</js>, bpi=<js>"MyBean: a,b"</js>)
- * <jk>public</jk> MyBean getBeanDetails(<ja>@Path</ja> String id);
+ * <jk>public</jk> MyBean getBeanDetails(<ja>@Path</ja> String id) {...}
* </p>
*
- * <p>
- * The format of each value is: <js>"Key: comma-delimited-tokens"</js>.
- * <br>Keys can be fully-qualified or short class names or <js>"*"</js> to represent all classes.
- * <br>Values are comma-delimited lists of bean property names.
- * <br>Properties apply to specified class and all subclasses.
- *
- * <p>
- * Semicolons can be used as an additional separator for multiple values:
- * <p class='bcode'>
+ * <h5 class='section'>Notes:</h5>
+ * <ul class='spaced-list'>
+ * <li>The format of each value is: <js>"Key: comma-delimited-tokens"</js>.
+ * <li>Keys can be fully-qualified or short class names or <js>"*"</js> to represent all classes.
+ * <li>Values are comma-delimited lists of bean property names.
+ * <li>Properties apply to specified class and all subclasses.
+ * <li>Semicolons can be used as an additional separator for multiple values:
+ * <p class='bcode'>
* <jc>// Equivalent</jc>
* bpi={<js>"Bean1: foo"</js>,<js>"Bean2: bar,baz"</js>}
* bpi=<js>"Bean1: foo; Bean2: bar,baz"</js>
- * </p>
+ * </p>
+ * </ul>
*
* <h5 class='section'>See Also:</h5>
* <ul>
@@ -114,7 +111,7 @@ public @interface RestMethod {
* <p>
* In the example below, our 'summary' view is a list of beans where we want to exclude some properties:
* <p class='bcode'>
- * <jc>// Our bean</jc>
+ * <jc>// Our bean</jc>
* <jk>public class</jk> MyBean {
*
* <jc>// Summary properties</jc>
@@ -125,28 +122,28 @@ public @interface RestMethod {
* <jk>public</jk> String <jf>a</jf>, <jf>b</jf>;
* }
*
- * <jc>// Don't show "a" and "b" properties.</jc>
+ * <jc>// Don't show "a" and "b" properties.</jc>
* <ja>@RestMethod</ja>(name=<jsf>GET</jsf>, path=<js>"/mybeans"</js>, bpx=<js>"MyBean: a,b"</js>)
- * <jk>public</jk> List<MyBean> getBeanSummary();
+ * <jk>public</jk> List<MyBean> getBeanSummary() {...}
*
- * <jc>// Render all properties.</jc>
+ * <jc>// Render all properties.</jc>
* <ja>@RestMethod</ja>(name=<jsf>GET</jsf>, path=<js>"/mybeans/{id}"</js>)
- * <jk>public</jk> MyBean getBeanDetails(<ja>@Path</ja> String id);
+ * <jk>public</jk> MyBean getBeanDetails(<ja>@Path</ja> String id) {...}
* </p>
*
- * <p>
- * The format of each value is: <js>"Key: comma-delimited-tokens"</js>.
- * <br>Keys can be fully-qualified or short class names or <js>"*"</js> to represent all classes.
- * <br>Values are comma-delimited lists of bean property names.
- * <br>Properties apply to specified class and all subclasses.
- *
- * <p>
- * Semicolons can be used as an additional separator for multiple values:
- * <p class='bcode'>
+ * <h5 class='section'>Notes:</h5>
+ * <ul class='spaced-list'>
+ * <li>The format of each value is: <js>"Key: comma-delimited-tokens"</js>.
+ * <li>Keys can be fully-qualified or short class names or <js>"*"</js> to represent all classes.
+ * <li>Values are comma-delimited lists of bean property names.
+ * <li>Properties apply to specified class and all subclasses.
+ * <li>Semicolons can be used as an additional separator for multiple values:
+ * <p class='bcode'>
* <jc>// Equivalent</jc>
* bpx={<js>"Bean1: foo"</js>,<js>"Bean2: bar,baz"</js>}
* bpx=<js>"Bean1: foo; Bean2: bar,baz"</js>
- * </p>
+ * </p>
+ * </ul>
*
* <h5 class='section'>See Also:</h5>
* <ul>
@@ -175,21 +172,15 @@ public @interface RestMethod {
* <jc>// Call this method if X-Client-Version is at least 2.0.
* // Note that this also matches 2.0.1.</jc>
* <ja>@RestMethod</ja>(name=<jsf>GET</jsf>, path=<js>"/foobar"</js>, clientVersion=<js>"2.0"</js>)
- * <jk>public</jk> Object method1() {
- * ...
- * }
+ * <jk>public</jk> Object method1() {...}
*
* <jc>// Call this method if X-Client-Version is at least 1.1, but less than 2.0.</jc>
* <ja>@RestMethod</ja>(name=<jsf>GET</jsf>, path=<js>"/foobar"</js>, clientVersion=<js>"[1.1,2.0)"</js>)
- * <jk>public</jk> Object method2() {
- * ...
- * }
+ * <jk>public</jk> Object method2() {...}
*
* <jc>// Call this method if X-Client-Version is less than 1.1.</jc>
* <ja>@RestMethod</ja>(name=<jsf>GET</jsf>, path=<js>"/foobar"</js>, clientVersion=<js>"[0,1.1)"</js>)
- * <jk>public</jk> Object method3() {
- * ...
- * }
+ * <jk>public</jk> Object method3() {...}
* </p>
*
* <p>
@@ -198,14 +189,12 @@ public @interface RestMethod {
* <p class='bcode'>
* <jc>// Call this method if X-Client-Version is at least 2.0.</jc>
* <ja>@RestMethod</ja>(name=<jsf>GET</jsf>, path=<js>"/foobar"</js>, clientVersion=<js>"2.0"</js>)
- * <jk>public</jk> NewPojo newMethod() {
- * ...
- * }
+ * <jk>public</jk> NewPojo newMethod() {...}
*
* <jc>// Call this method if X-Client-Version is at least 1.1, but less than 2.0.</jc>
* <ja>@RestMethod</ja>(name=<jsf>GET</jsf>, path=<js>"/foobar"</js>, clientVersion=<js>"[1.1,2.0)"</js>, transforms={NewToOldPojoSwap.<jk>class</jk>})
* <jk>public</jk> NewPojo oldMethod() {
- * <jk>return</jk> newMethod()
+ * <jk>return</jk> newMethod();
* }
*
* <p>
@@ -218,6 +207,11 @@ public @interface RestMethod {
* <li><js>"[0,1.0]"</js> = Less than or equal to 1.0. Note that 1.0.1 will match.
* <li><js>"1.0"</js> = At least 1.0. 1.0 and 2.0 will match.
* </ul>
+ *
+ * <h5 class='section'>See Also:</h5>
+ * <ul>
+ * <li class='jf'>{@link RestContext#REST_clientVersionHeader}
+ * </ul>
*/
String clientVersion() default "";
@@ -240,15 +234,12 @@ public @interface RestMethod {
* <p>
* The default character encoding for the request and response if not specified on the request.
*
- * <p>
- * Value can contain any of the following variables:
- * {@link ConfigFileVar $C}
- * {@link CoalesceVar $CO}
- * {@link CoalesceAndRecurseVar $CR}
- * {@link EnvVariablesVar $E}
- * {@link IfVar $IF}
- * {@link SystemPropertiesVar $S}
- * {@link SwitchVar $SW}
+ * <h5 class='section'>Notes:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time variables</a>
+ * (e.g. <js>"$S{mySystemProperty}"</js>).
+ * </ul>
*
* <h5 class='section'>See Also:</h5>
* <ul>
@@ -270,24 +261,17 @@ public @interface RestMethod {
* <h5 class='section'>Example:</h5>
* <p class='bcode'>
* <ja>@RestMethod</ja>(name=<jsf>POST</jsf>, path=<js>"/*"</js>, defaultFormData={<js>"foo=bar"</js>})
- * <jk>public</jk> String doGet(<ja>@FormData</ja>(<js>"foo"</js>) String foo) {
- * ...
- * }
+ * <jk>public</jk> String doGet(<ja>@FormData</ja>(<js>"foo"</js>) String foo) {...}
* </p>
*
- * <p>
- * You can use either <js>':'</js> or <js>'='</js> as the key/value delimiter.
- * Key and value is trimmed of whitespace.
- *
- * <p>
- * Values can contain any of the following variables:
- * {@link ConfigFileVar $C}
- * {@link CoalesceVar $CO}
- * {@link CoalesceAndRecurseVar $CR}
- * {@link EnvVariablesVar $E}
- * {@link IfVar $IF}
- * {@link SystemPropertiesVar $S}
- * {@link SwitchVar $SW}
+ * <h5 class='section'>Notes:</h5>
+ * <ul class='spaced-list'>
+ * <li>You can use either <js>':'</js> or <js>'='</js> as the key/value delimiter.
+ * <li>Key and value is trimmed of whitespace.
+ * <li>
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time variables</a>
+ * (e.g. <js>"$S{mySystemProperty}"</js>).
+ * </ul>
*/
String[] defaultFormData() default {};
@@ -303,24 +287,17 @@ public @interface RestMethod {
* <h5 class='section'>Example:</h5>
* <p class='bcode'>
* <ja>@RestMethod</ja>(name=<jsf>GET</jsf>, path=<js>"/*"</js>, defaultQuery={<js>"foo=bar"</js>})
- * <jk>public</jk> String doGet(<ja>@Query</ja>(<js>"foo"</js>) String foo) {
- * ...
- * }
+ * <jk>public</jk> String doGet(<ja>@Query</ja>(<js>"foo"</js>) String foo) {...}
* </p>
*
- * <p>
- * You can use either <js>':'</js> or <js>'='</js> as the key/value delimiter.
- * Key and value is trimmed of whitespace.
- *
- * <p>
- * Values can contain any of the following variables:
- * {@link ConfigFileVar $C}
- * {@link CoalesceVar $CO}
- * {@link CoalesceAndRecurseVar $CR}
- * {@link EnvVariablesVar $E}
- * {@link IfVar $IF}
- * {@link SystemPropertiesVar $S}
- * {@link SwitchVar $SW}
+ * <h5 class='section'>Notes:</h5>
+ * <ul class='spaced-list'>
+ * <li>You can use either <js>':'</js> or <js>'='</js> as the key/value delimiter.
+ * <li>Key and value is trimmed of whitespace.
+ * <li>
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time variables</a>
+ * (e.g. <js>"$S{mySystemProperty}"</js>).
+ * </ul>
*/
String[] defaultQuery() default {};
@@ -334,20 +311,15 @@ public @interface RestMethod {
* <p class='bcode'>
* <jc>// Assume "text/json" Accept value when Accept not specified</jc>
* <ja>@RestMethod</ja>(name=<jsf>GET</jsf>, path=<js>"/*"</js>, defaultRequestHeaders={<js>"Accept: text/json"</js>})
- * <jk>public</jk> String doGet() {
- * ...
- * }
+ * <jk>public</jk> String doGet() {...}
* </p>
*
- * <p>
- * Values can contain any of the following variables:
- * {@link ConfigFileVar $C}
- * {@link CoalesceVar $CO}
- * {@link CoalesceAndRecurseVar $CR}
- * {@link EnvVariablesVar $E}
- * {@link IfVar $IF}
- * {@link SystemPropertiesVar $S}
- * {@link SwitchVar $SW}
+ * <h5 class='section'>Notes:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time variables</a>
+ * (e.g. <js>"$S{mySystemProperty}"</js>).
+ * </ul>
*
* <h5 class='section'>See Also:</h5>
* <ul>
@@ -370,36 +342,19 @@ public @interface RestMethod {
* The description of the method in the Swagger page.
* </ul>
*
- * <p>
- * The default value pulls the description from the <code>(className.?)[javaMethodName].description</code> entry in
- * the servlet resource bundle. (e.g. <js>"MyClass.myMethod.description = foo"</js> or
- * <js>"myMethod.description = foo"</js>).
- *
- * <p>
- * Value can contain any of the following variables:
- * {@link ConfigFileVar $C}
- * {@link CoalesceVar $CO}
- * {@link CoalesceAndRecurseVar $CR}
- * {@link EnvVariablesVar $E}
- * {@link FileVar $F}
- * {@link ServletInitParamVar $I},
- * {@link IfVar $IF}
- * {@link LocalizationVar $L}
- * {@link RequestAttributeVar $RA}
- * {@link RequestFormDataVar $RF}
- * {@link RequestHeaderVar $RH}
- * {@link RequestPathVar $RP}
- * {@link RequestQueryVar $RQ}
- * {@link RequestVar $R}
- * {@link SystemPropertiesVar $S}
- * {@link SerializedRequestAttrVar $SA}
- * {@link SwitchVar $SW}
- * {@link UrlVar $U}
- * {@link UrlEncodeVar $UE}
- * {@link WidgetVar $W}
- *
- * <p>
- * Corresponds to the swagger field <code>/paths/{path}/{method}/description</code>.
+ * <h5 class='section'>Notes:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Corresponds to the swagger field <code>/paths/{path}/{method}/description</code>.
+ * <li>
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
+ * (e.g. <js>"$L{my.localized.variable}"</js>).
+ * </ul>
+ *
+ * <h5 class='section'>See Also:</h5>
+ * <ul>
+ * <li class='jm'>{@link RestInfoProvider#getDescription(RestRequest)}
+ * </ul>
*/
String description() default "";
@@ -413,8 +368,10 @@ public @interface RestMethod {
* <p>
* These can be used to enable various kinds of compression (e.g. <js>"gzip"</js>) on requests and responses.
*
- * <p>
- * Use <code>inherit={<js>"ENCODERS"</js>}</code> to inherit encoders from the resource class.
+ * <h5 class='section'>Notes:</h5>
+ * <ul class='spaced-list'>
+ * <li>Use <code>inherit={<js>"ENCODERS"</js>}</code> to inherit encoders from the resource class.
+ * </ul>
*
* <h5 class='section'>See Also:</h5>
* <ul>
@@ -449,6 +406,11 @@ public @interface RestMethod {
*
* <p>
* Information provided here overrides information provided in the servlet-level annotation.
+ *
+ * <h5 class='section'>See Also:</h5>
+ * <ul>
+ * <li class='jic'>{@link RestInfoProvider}
+ * </ul>
*/
HtmlDoc htmldoc() default @HtmlDoc;
@@ -458,12 +420,12 @@ public @interface RestMethod {
* <p>
* Possible values:
* <ul>
- * <li>"SERIALIZERS" - Inherit class-level serializers.
- * <li>"PARSERS" - Inherit class-level parsers.
- * <li>"TRANSFORMS" - Inherit class-level bean properties and pojo-swaps.
- * <li>"PROPERTIES" - Inherit class-level properties (other than transforms).
- * <li>"ENCODERS" - Inherit class-level encoders.
- * <li>"*" - Inherit everything.
+ * <li><js>"SERIALIZERS"</js> - Inherit class-level serializers.
+ * <li><js>"PARSERS"</js> - Inherit class-level parsers.
+ * <li><js>"TRANSFORMS"</js> - Inherit class-level bean properties and pojo-swaps.
+ * <li><js>"PROPERTIES"</js> - Inherit class-level properties (other than transforms).
+ * <li><js>"ENCODERS"</js> - Inherit class-level encoders.
+ * <li><js>"*"</js> - Inherit everything.
* </ul>
*
* <p>
@@ -488,8 +450,10 @@ public @interface RestMethod {
* Matchers are used to allow multiple Java methods to handle requests assigned to the same URL path pattern, but
* differing based on some request attribute, such as a specific header value.
*
- * <p>
- * See {@link RestMatcher} for more information.
+ * <h5 class='section'>See Also:</h5>
+ * <ul>
+ * <li class='jac'>{@link RestMatcher}
+ * </ul>
*/
Class<? extends RestMatcher>[] matchers() default {};
@@ -507,15 +471,12 @@ public @interface RestMethod {
* )
* </p>
*
- * <p>
- * Value can contain any of the following variables:
- * {@link ConfigFileVar $C}
- * {@link CoalesceVar $CO}
- * {@link CoalesceAndRecurseVar $CR}
- * {@link EnvVariablesVar $E}
- * {@link IfVar $IF}
- * {@link SystemPropertiesVar $S}
- * {@link SwitchVar $SW}
+ * <h5 class='section'>Notes:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time variables</a>
+ * (e.g. <js>"$S{mySystemProperty}"</js>).
+ * </ul>
*
* <h5 class='section'>See Also:</h5>
* <ul>
@@ -623,8 +584,10 @@ public @interface RestMethod {
* <ja>@RestMethod</ja>(name=<jsf>GET</jsf>, path=<js>"/myurl/{0}/{1}/{2}/*"</js>)
* </p>
*
- * <p>
- * Refer to {@link Path @Path} on how path variables get resolved.
+ * <h5 class='section'>See Also:</h5>
+ * <ul>
+ * <li class='ja'>{@link Path}
+ * </ul>
*/
String path() default "/*";
@@ -708,35 +671,14 @@ public @interface RestMethod {
* The summary of the method in the Swagger page.
* </ul>
*
- * <p>
- * The default value pulls the description from the <code>(className.?)[javaMethodName].summary</code> entry in the
- * servlet resource bundle. (e.g. <js>"MyClass.myMethod.summary = foo"</js> or <js>"myMethod.summary = foo"</js>).
- *
- * <p>
- * Value can contain any of the following variables:
- * {@link ConfigFileVar $C}
- * {@link CoalesceVar $CO}
- * {@link CoalesceAndRecurseVar $CR}
- * {@link EnvVariablesVar $E}
- * {@link FileVar $F}
- * {@link ServletInitParamVar $I},
- * {@link IfVar $IF}
- * {@link LocalizationVar $L}
- * {@link RequestAttributeVar $RA}
- * {@link RequestFormDataVar $RF}
- * {@link RequestHeaderVar $RH}
- * {@link RequestPathVar $RP}
- * {@link RequestQueryVar $RQ}
- * {@link RequestVar $R}
- * {@link SystemPropertiesVar $S}
- * {@link SerializedRequestAttrVar $SA}
- * {@link SwitchVar $SW}
- * {@link UrlVar $U}
- * {@link UrlEncodeVar $UE}
- * {@link WidgetVar $W}
- *
- * <p>
- * Corresponds to the swagger field <code>/paths/{path}/{method}/summary</code>.
+ * <h5 class='section'>Notes:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Corresponds to the swagger field <code>/paths/{path}/{method}/summary</code>.
+ * <li>
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
+ * (e.g. <js>"$L{my.localized.variable}"</js>).
+ * </ul>
*/
String summary() default "";
@@ -746,15 +688,12 @@ public @interface RestMethod {
* <p>
* Overrides the media types inferred from the serializers that identify what media types can be produced by the resource.
*
- * <p>
- * Values can contain any of the following variables:
- * {@link ConfigFileVar $C}
- * {@link CoalesceVar $CO}
- * {@link CoalesceAndRecurseVar $CR}
- * {@link EnvVariablesVar $E}
- * {@link IfVar $IF}
- * {@link SystemPropertiesVar $S}
- * {@link SwitchVar $SW}
+ * <h5 class='section'>Notes:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time variables</a>
+ * (e.g. <js>"$S{mySystemProperty}"</js>).
+ * </ul>
*
* <h5 class='section'>See Also:</h5>
* <ul>
@@ -769,15 +708,12 @@ public @interface RestMethod {
* <p>
* Overrides the media types inferred from the parsers that identify what media types can be consumed by the resource.
*
- * <p>
- * Values can contain any of the following variables:
- * {@link ConfigFileVar $C}
- * {@link CoalesceVar $CO}
- * {@link CoalesceAndRecurseVar $CR}
- * {@link EnvVariablesVar $E}
- * {@link IfVar $IF}
- * {@link SystemPropertiesVar $S}
- * {@link SwitchVar $SW}
+ * <h5 class='section'>Notes:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time variables</a>
+ * (e.g. <js>"$S{mySystemProperty}"</js>).
+ * </ul>
*
* <h5 class='section'>See Also:</h5>
* <ul>
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestResource.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestResource.java
index c0e8b8e..0059cf2 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestResource.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestResource.java
@@ -23,9 +23,7 @@ import org.apache.juneau.httppart.*;
import org.apache.juneau.ini.*;
import org.apache.juneau.parser.*;
import org.apache.juneau.rest.*;
-import org.apache.juneau.rest.vars.*;
import org.apache.juneau.serializer.*;
-import org.apache.juneau.svl.vars.*;
import org.apache.juneau.utils.*;
/**
@@ -59,15 +57,12 @@ public @interface RestResource {
* ?body=(name='John%20Smith',age=45)
* </p>
*
- * <p>
- * Value can contain any of the following variables:
- * {@link ConfigFileVar $C}
- * {@link CoalesceVar $CO}
- * {@link CoalesceAndRecurseVar $CR}
- * {@link EnvVariablesVar $E}
- * {@link IfVar $IF}
- * {@link SystemPropertiesVar $S}
- * {@link SwitchVar $SW}
+ * <h5 class='section'>Notes:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time variables</a>
+ * (e.g. <js>"$L{my.localized.variable}"</js>).
+ * </ul>
*
* <h5 class='section'>See Also:</h5>
* <ul>
@@ -88,15 +83,12 @@ public @interface RestResource {
* ?method=OPTIONS
* </p>
*
- * <p>
- * Value can contain any of the following variables:
- * {@link ConfigFileVar $C}
- * {@link CoalesceVar $CO}
- * {@link CoalesceAndRecurseVar $CR}
- * {@link EnvVariablesVar $E}
- * {@link IfVar $IF}
- * {@link SystemPropertiesVar $S}
- * {@link SwitchVar $SW}
+ * <h5 class='section'>Notes:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time variables</a>
+ * (e.g. <js>"$L{my.localized.variable}"</js>).
+ * </ul>
*
* <h5 class='section'>See Also:</h5>
* <ul>
@@ -117,15 +109,12 @@ public @interface RestResource {
* ?Accept=text/json&Content-Type=text/json
* </p>
*
- * <p>
- * Value can contain any of the following variables:
- * {@link ConfigFileVar $C}
- * {@link CoalesceVar $CO}
- * {@link CoalesceAndRecurseVar $CR}
- * {@link EnvVariablesVar $E}
- * {@link IfVar $IF}
- * {@link SystemPropertiesVar $S}
- * {@link SwitchVar $SW}
+ * <h5 class='section'>Notes:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time variables</a>
+ * (e.g. <js>"$L{my.localized.variable}"</js>).
+ * </ul>
*
* <h5 class='section'>See Also:</h5>
* <ul>
@@ -197,15 +186,12 @@ public @interface RestResource {
* <p>
* Specifies the name of the header used to denote the client version on HTTP requests.
*
- * <p>
- * Value can contain any of the following variables:
- * {@link ConfigFileVar $C}
- * {@link CoalesceVar $CO}
- * {@link CoalesceAndRecurseVar $CR}
- * {@link EnvVariablesVar $E}
- * {@link IfVar $IF}
- * {@link SystemPropertiesVar $S}
- * {@link SwitchVar $SW}
+ * <h5 class='section'>Notes:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time variables</a>
+ * (e.g. <js>"$L{my.localized.variable}"</js>).
+ * </ul>
*
* <h5 class='section'>See Also:</h5>
* <ul>
@@ -220,18 +206,17 @@ public @interface RestResource {
* <p>
* The configuration file .
*
- * <p>
- * Value can contain any of the following variables:
- * {@link ConfigFileVar $C}
- * {@link CoalesceVar $CO}
- * {@link CoalesceAndRecurseVar $CR}
- * {@link EnvVariablesVar $E}
- * {@link IfVar $IF}
- * {@link SystemPropertiesVar $S}
- * {@link SwitchVar $SW}
+ * <h5 class='section'>Notes:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time variables</a>
+ * (e.g. <js>"$L{my.localized.variable}"</js>).
+ * </ul>
*
- * <p>
- * The programmatic equivalent to this annotation is the {@link RestContextBuilder#configFile(ConfigFile)} method.
+ * <h5 class='section'>See Also:</h5>
+ * <ul>
+ * <li class='jm'>{@link RestContextBuilder#configFile(ConfigFile)}
+ * </ul>
*/
String config() default "";
@@ -241,15 +226,12 @@ public @interface RestResource {
* <p>
* Overrides the context path value for this resource and any child resources.
*
- * <p>
- * Value can contain any of the following variables:
- * {@link ConfigFileVar $C}
- * {@link CoalesceVar $CO}
- * {@link CoalesceAndRecurseVar $CR}
- * {@link EnvVariablesVar $E}
- * {@link IfVar $IF}
- * {@link SystemPropertiesVar $S}
- * {@link SwitchVar $SW}
+ * <h5 class='section'>Notes:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time variables</a>
+ * (e.g. <js>"$L{my.localized.variable}"</js>).
+ * </ul>
*
* <h5 class='section'>See Also:</h5>
* <ul>
@@ -277,15 +259,12 @@ public @interface RestResource {
* <p>
* The default character encoding for the request and response if not specified on the request.
*
- * <p>
- * Value can contain any of the following variables:
- * {@link ConfigFileVar $C}
- * {@link CoalesceVar $CO}
- * {@link CoalesceAndRecurseVar $CR}
- * {@link EnvVariablesVar $E}
- * {@link IfVar $IF}
- * {@link SystemPropertiesVar $S}
- * {@link SwitchVar $SW}
+ * <h5 class='section'>Notes:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time variables</a>
+ * (e.g. <js>"$L{my.localized.variable}"</js>).
+ * </ul>
*
* <h5 class='section'>See Also:</h5>
* <ul>
@@ -300,15 +279,12 @@ public @interface RestResource {
* <p>
* Specifies default values for request headers if they're not passed in through the request.
*
- * <p>
- * Values can contain any of the following variables:
- * {@link ConfigFileVar $C}
- * {@link CoalesceVar $CO}
- * {@link CoalesceAndRecurseVar $CR}
- * {@link EnvVariablesVar $E}
- * {@link IfVar $IF}
- * {@link SystemPropertiesVar $S}
- * {@link SwitchVar $SW}
+ * <h5 class='section'>Notes:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time variables</a>
+ * (e.g. <js>"$L{my.localized.variable}"</js>).
+ * </ul>
*
* <h5 class='section'>See Also:</h5>
* <ul>
@@ -323,15 +299,12 @@ public @interface RestResource {
* <p>
* Specifies default values for response headers if they're not set after the Java REST method is called.
*
- * <p>
- * Values can contain any of the following variables:
- * {@link ConfigFileVar $C}
- * {@link CoalesceVar $CO}
- * {@link CoalesceAndRecurseVar $CR}
- * {@link EnvVariablesVar $E}
- * {@link IfVar $IF}
- * {@link SystemPropertiesVar $S}
- * {@link SwitchVar $SW}
+ * <h5 class='section'>Notes:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time variables</a>
+ * (e.g. <js>"$L{my.localized.variable}"</js>).
+ * </ul>
*
* <h5 class='section'>See Also:</h5>
* <ul>
@@ -345,40 +318,21 @@ public @interface RestResource {
*
* <p>
* It is used to populate the Swagger description field.
- * This value can be retrieved programmatically through the {@link RestRequest#getResourceDescription()} method.
- *
- * <p>
- * The default value pulls the description from the <code>description</code> entry in the servlet resource bundle.
- * (e.g. <js>"description = foo"</js> or <js>"MyServlet.description = foo"</js>).
- *
- * <p>
- * Value can contain any of the following variables:
- * {@link ConfigFileVar $C}
- * {@link CoalesceVar $CO}
- * {@link CoalesceAndRecurseVar $CR}
- * {@link EnvVariablesVar $E}
- * {@link FileVar $F}
- * {@link ServletInitParamVar $I},
- * {@link IfVar $IF}
- * {@link LocalizationVar $L}
- * {@link RequestAttributeVar $RA}
- * {@link RequestFormDataVar $RF}
- * {@link RequestHeaderVar $RH}
- * {@link RequestPathVar $RP}
- * {@link RequestQueryVar $RQ}
- * {@link RequestVar $R}
- * {@link SystemPropertiesVar $S}
- * {@link SerializedRequestAttrVar $SA}
- * {@link SwitchVar $SW}
- * {@link UrlVar $U}
- * {@link UrlEncodeVar $UE}
- * {@link WidgetVar $W}
+ * <br>This value can be retrieved programmatically through the {@link RestRequest#getResourceDescription()} method.
*
- * <p>
- * Corresponds to the swagger field <code>/info/description</code>.
+ * <h5 class='section'>Notes:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
+ * (e.g. <js>"$L{my.localized.variable}"</js>).
+ * <li>
+ * Corresponds to the swagger field <code>/info/description</code>.
+ * </ul>
*
- * <p>
- * The programmatic equivalent to this annotation is the {@link RestInfoProvider#getDescription(RestRequest)} method.
+ * <h5 class='section'>See Also:</h5>
+ * <ul>
+ * <li class='jm'>{@link RestInfoProvider#getDescription(RestRequest)}
+ * </ul>
*/
String description() default "";
@@ -398,18 +352,14 @@ public @interface RestResource {
/**
* Shortcut for setting {@link #properties()} of simple boolean types.
*
- * <p>
- * Values can contain any of the following variables:
- * {@link ConfigFileVar $C}
- * {@link CoalesceVar $CO}
- * {@link CoalesceAndRecurseVar $CR}
- * {@link EnvVariablesVar $E}
- * {@link IfVar $IF}
- * {@link SystemPropertiesVar $S}
- * {@link SwitchVar $SW}
- *
- * <p>
- * Setting a flag is equivalent to setting the same property to <js>"true"</js>.
+ * <h5 class='section'>Notes:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time variables</a>
+ * (e.g. <js>"$L{my.localized.variable}"</js>).
+ * <li>
+ * Setting a flag is equivalent to setting the same property to <js>"true"</js>.
+ * </ul>
*/
String[] flags() default {};
@@ -503,15 +453,12 @@ public @interface RestResource {
* Useful for alleviating DoS attacks by throwing an exception when too much input is received instead of resulting
* in out-of-memory errors which could affect system stability.
*
- * <p>
- * Value can contain any of the following variables:
- * {@link ConfigFileVar $C}
- * {@link CoalesceVar $CO}
- * {@link CoalesceAndRecurseVar $CR}
- * {@link EnvVariablesVar $E}
- * {@link IfVar $IF}
- * {@link SystemPropertiesVar $S}
- * {@link SwitchVar $SW}
+ * <h5 class='section'>Notes:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time variables</a>
+ * (e.g. <js>"$L{my.localized.variable}"</js>).
+ * </ul>
*
* <h5 class='section'>See Also:</h5>
* <ul>
@@ -525,15 +472,12 @@ public @interface RestResource {
*
* Identifies the location of the resource bundle for this class.
*
- * <p>
- * Value can contain any of the following variables:
- * {@link ConfigFileVar $C}
- * {@link CoalesceVar $CO}
- * {@link CoalesceAndRecurseVar $CR}
- * {@link EnvVariablesVar $E}
- * {@link IfVar $IF}
- * {@link SystemPropertiesVar $S}
- * {@link SwitchVar $SW}
+ * <h5 class='section'>Notes:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time variables</a>
+ * (e.g. <js>"$L{my.localized.variable}"</js>).
+ * </ul>
*
* <h5 class='section'>See Also:</h5>
* <ul>
@@ -548,15 +492,12 @@ public @interface RestResource {
* <p>
* Defines MIME-type file type mappings.
*
- * <p>
- * Value can contain any of the following variables:
- * {@link ConfigFileVar $C}
- * {@link CoalesceVar $CO}
- * {@link CoalesceAndRecurseVar $CR}
- * {@link EnvVariablesVar $E}
- * {@link IfVar $IF}
- * {@link SystemPropertiesVar $S}
- * {@link SwitchVar $SW}
+ * <h5 class='section'>Notes:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time variables</a>
+ * (e.g. <js>"$L{my.localized.variable}"</js>).
+ * </ul>
*
* <h5 class='section'>See Also:</h5>
* <ul>
@@ -571,7 +512,7 @@ public @interface RestResource {
* <p>
* By default, the Juneau framework will automatically Java method parameters of various types (e.g.
* <code>RestRequest</code>, <code>Accept</code>, <code>Reader</code>).
- * This setting allows you to provide your own resolvers for your own class types that you want resolved.
+ * <br>This setting allows you to provide your own resolvers for your own class types that you want resolved.
*
* <h5 class='section'>See Also:</h5>
* <ul>
@@ -673,6 +614,7 @@ public @interface RestResource {
* <li>{@link RestContext#getSerializers()}
* <li>{@link RestContext#getParsers()}
* </ul>
+ *
* <p>
* Any of the properties defined on {@link RestContext} or any of the serializers and parsers can be specified.
*
@@ -684,19 +626,18 @@ public @interface RestResource {
* {@link RestResponse#prop(String, Object)} method or through an {@link RequestProperties}
* method parameter.
*
- * <p>
- * Values can contain any of the following variables:
- * {@link ConfigFileVar $C}
- * {@link CoalesceVar $CO}
- * {@link CoalesceAndRecurseVar $CR}
- * {@link EnvVariablesVar $E}
- * {@link IfVar $IF}
- * {@link SystemPropertiesVar $S}
- * {@link SwitchVar $SW}
+ * <h5 class='section'>Notes:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time variables</a>
+ * (e.g. <js>"$L{my.localized.variable}"</js>).
+ * </ul>
*
- * <p>
- * The programmatic equivalent to this annotation are the {@link RestContextBuilder#set(String, Object)}/
- * {@link RestContextBuilder#set(java.util.Map)} methods.
+ * <h5 class='section'>See Also:</h5>
+ * <ul>
+ * <li class='jm'>{@link RestContextBuilder#set(String,Object)}
+ * <li class='jm'>{@link RestContextBuilder#set(java.util.Map)}
+ * </ul>
*/
Property[] properties() default {};
@@ -706,15 +647,12 @@ public @interface RestResource {
* <p>
* Render stack traces in HTTP response bodies when errors occur.
*
- * <p>
- * Value can contain any of the following variables:
- * {@link ConfigFileVar $C}
- * {@link CoalesceVar $CO}
- * {@link CoalesceAndRecurseVar $CR}
- * {@link EnvVariablesVar $E}
- * {@link IfVar $IF}
- * {@link SystemPropertiesVar $S}
- * {@link SwitchVar $SW}
+ * <h5 class='section'>Notes:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time variables</a>
+ * (e.g. <js>"$L{my.localized.variable}"</js>).
+ * </ul>
*
* <h5 class='section'>See Also:</h5>
* <ul>
@@ -797,31 +735,17 @@ public @interface RestResource {
* )
* </p>
*
- * <p>
- * Value can contain any of the following variables:
- * {@link ConfigFileVar $C}
- * {@link CoalesceVar $CO}
- * {@link CoalesceAndRecurseVar $CR}
- * {@link EnvVariablesVar $E}
- * {@link FileVar $F}
- * {@link ServletInitParamVar $I},
- * {@link IfVar $IF}
- * {@link LocalizationVar $L}
- * {@link RequestAttributeVar $RA}
- * {@link RequestFormDataVar $RF}
- * {@link RequestHeaderVar $RH}
- * {@link RequestPathVar $RP}
- * {@link RequestQueryVar $RQ}
- * {@link RequestVar $R}
- * {@link SystemPropertiesVar $S}
- * {@link SerializedRequestAttrVar $SA}
- * {@link SwitchVar $SW}
- * {@link UrlVar $U}
- * {@link UrlEncodeVar $UE}
- * {@link WidgetVar $W}
+ * <h5 class='section'>Notes:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
+ * (e.g. <js>"$L{my.localized.variable}"</js>).
+ * </ul>
*
- * <p>
- * The programmatic equivalent to this annotation is the {@link RestInfoProvider#getSiteName(RestRequest)} method.
+ * <h5 class='section'>See Also:</h5>
+ * <ul>
+ * <li class='jm'>{@link RestInfoProvider#getSiteName(RestRequest)}
+ * </ul>
*/
String siteName() default "";
@@ -831,15 +755,12 @@ public @interface RestResource {
* <p>
* Used to customize the headers on responses returned for statically-served files.
*
- * <p>
- * Values can contain any of the following variables:
- * {@link ConfigFileVar $C}
- * {@link CoalesceVar $CO}
- * {@link CoalesceAndRecurseVar $CR}
- * {@link EnvVariablesVar $E}
- * {@link IfVar $IF}
- * {@link SystemPropertiesVar $S}
- * {@link SwitchVar $SW}
+ * <h5 class='section'>Notes:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time variables</a>
+ * (e.g. <js>"$L{my.localized.variable}"</js>).
+ * </ul>
*
* <h5 class='section'>See Also:</h5>
* <ul>
@@ -854,15 +775,12 @@ public @interface RestResource {
* <p>
* Used to define paths and locations of statically-served files such as images or HTML documents.
*
- * <p>
- * Values can contain any of the following variables:
- * {@link ConfigFileVar $C}
- * {@link CoalesceVar $CO}
- * {@link CoalesceAndRecurseVar $CR}
- * {@link EnvVariablesVar $E}
- * {@link IfVar $IF}
- * {@link SystemPropertiesVar $S}
- * {@link SwitchVar $SW}
+ * <h5 class='section'>Notes:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time variables</a>
+ * (e.g. <js>"$L{my.localized.variable}"</js>).
+ * </ul>
*
* <h5 class='section'>See Also:</h5>
* <ul>
@@ -877,15 +795,12 @@ public @interface RestResource {
* <p>
* Overrides the media types inferred from the serializers that identify what media types can be produced by the resource.
*
- * <p>
- * Values can contain any of the following variables:
- * {@link ConfigFileVar $C}
- * {@link CoalesceVar $CO}
- * {@link CoalesceAndRecurseVar $CR}
- * {@link EnvVariablesVar $E}
- * {@link IfVar $IF}
- * {@link SystemPropertiesVar $S}
- * {@link SwitchVar $SW}
+ * <h5 class='section'>Notes:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time variables</a>
+ * (e.g. <js>"$L{my.localized.variable}"</js>).
+ * </ul>
*
* <h5 class='section'>See Also:</h5>
* <ul>
@@ -900,15 +815,12 @@ public @interface RestResource {
* <p>
* Overrides the media types inferred from the parsers that identify what media types can be consumed by the resource.
*
- * <p>
- * Values can contain any of the following variables:
- * {@link ConfigFileVar $C}
- * {@link CoalesceVar $CO}
- * {@link CoalesceAndRecurseVar $CR}
- * {@link EnvVariablesVar $E}
- * {@link IfVar $IF}
- * {@link SystemPropertiesVar $S}
- * {@link SwitchVar $SW}
+ * <h5 class='section'>Notes:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time variables</a>
+ * (e.g. <js>"$L{my.localized.variable}"</js>).
+ * </ul>
*
* <h5 class='section'>See Also:</h5>
* <ul>
@@ -939,6 +851,11 @@ public @interface RestResource {
* )
* )
* </p>
+ *
+ * <h5 class='section'>See Also:</h5>
+ * <ul>
+ * <li class='jm'>{@link RestInfoProvider#getSwagger(RestRequest)}
+ * </ul>
*/
ResourceSwagger swagger() default @ResourceSwagger;
@@ -947,40 +864,22 @@ public @interface RestResource {
*
* <p>
* It is used to populate the Swagger title field.
- * This value can be retrieved programmatically through the {@link RestRequest#getResourceTitle()} method.
+ * <br>This value can be retrieved programmatically through the {@link RestRequest#getResourceTitle()} method.
*
- * <p>
- * The default value pulls the label from the <code>label</code> entry in the servlet resource bundle.
- * (e.g. <js>"title = foo"</js> or <js>"MyServlet.title = foo"</js>).
- *
- * <p>
- * Value can contain any of the following variables:
- * {@link ConfigFileVar $C}
- * {@link CoalesceVar $CO}
- * {@link CoalesceAndRecurseVar $CR}
- * {@link EnvVariablesVar $E}
- * {@link FileVar $F}
- * {@link ServletInitParamVar $I},
- * {@link IfVar $IF}
- * {@link LocalizationVar $L}
- * {@link RequestAttributeVar $RA}
- * {@link RequestFormDataVar $RF}
- * {@link RequestHeaderVar $RH}
- * {@link RequestPathVar $RP}
- * {@link RequestQueryVar $RQ}
- * {@link RequestVar $R}
- * {@link SystemPropertiesVar $S}
- * {@link SerializedRequestAttrVar $SA}
- * {@link SwitchVar $SW}
- * {@link UrlVar $U}
- * {@link UrlEncodeVar $UE}
- * {@link WidgetVar $W}
+ * <h5 class='section'>Notes:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time and request-time variables</a>
+ * (e.g. <js>"$L{my.localized.variable}"</js>).
+ * <li>
+ * Corresponds to the swagger field <code>/info/title</code>.
+ * </ul>
*
- * <p>
- * Corresponds to the swagger field <code>/info/title</code>.
*
- * <p>
- * The programmatic equivalent to this annotation is the {@link RestInfoProvider#getTitle(RestRequest)} method.
+ * <h5 class='section'>See Also:</h5>
+ * <ul>
+ * <li class='jm'>{@link RestInfoProvider#getTitle(RestRequest)}
+ * </ul>
*/
String title() default "";
@@ -991,15 +890,12 @@ public @interface RestResource {
* When enabled, resources retrieved via {@link RestRequest#getClasspathReaderResource(String, boolean)} (and related
* methods) will be cached in memory to speed subsequent lookups.
*
- * <p>
- * Value can contain any of the following variables:
- * {@link ConfigFileVar $C}
- * {@link CoalesceVar $CO}
- * {@link CoalesceAndRecurseVar $CR}
- * {@link EnvVariablesVar $E}
- * {@link IfVar $IF}
- * {@link SystemPropertiesVar $S}
- * {@link SwitchVar $SW}
+ * <h5 class='section'>Notes:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time variables</a>
+ * (e.g. <js>"$L{my.localized.variable}"</js>).
+ * </ul>
*
* <h5 class='section'>See Also:</h5>
* <ul>
@@ -1015,15 +911,12 @@ public @interface RestResource {
* When enabled, the number of times an exception has occurred will be determined based on stack trace hashsums,
* made available through the {@link RestException#getOccurrence()} method.
*
- * <p>
- * Value can contain any of the following variables:
- * {@link ConfigFileVar $C}
- * {@link CoalesceVar $CO}
- * {@link CoalesceAndRecurseVar $CR}
- * {@link EnvVariablesVar $E}
- * {@link IfVar $IF}
- * {@link SystemPropertiesVar $S}
- * {@link SwitchVar $SW}
+ * <h5 class='section'>Notes:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Supports <a class="doclink" href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time variables</a>
+ * (e.g. <js>"$L{my.localized.variable}"</js>).
+ * </ul>
*
* <h5 class='section'>See Also:</h5>
* <ul>
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/RestInfoVar.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/RestInfoVar.java
index 5d1aca7..08d5907 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/RestInfoVar.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/RestInfoVar.java
@@ -37,17 +37,17 @@ import org.apache.juneau.svl.*;
* <p>
* The possible values are:
* <ul>
- * <li><js>"contact"</js> - Value returned by {@link RestInfoProvider#getContact(RestRequest)}
+ * <li><js>"contact"</js> - Value returned by {@link Info#getContact()}
* <li><js>"description"</js> - Value returned by {@link RestInfoProvider#getDescription(RestRequest)}
- * <li><js>"externalDocs"</js> - Value returned by {@link RestInfoProvider#getExternalDocs(RestRequest)}
- * <li><js>"license"</js> - Value returned by {@link RestInfoProvider#getLicense(RestRequest)}
+ * <li><js>"externalDocs"</js> - Value returned by {@link Swagger#getExternalDocs()}
+ * <li><js>"license"</js> - Value returned by {@link Info#getLicense()}
* <li><js>"methodDescription"</js> - Value returned by {@link RestInfoProvider#getMethodDescription(Method,RestRequest)}
* <li><js>"methodSummary"</js> - Value returned by {@link RestInfoProvider#getMethodSummary(Method,RestRequest)}
* <li><js>"siteName"</js> - Value returned by {@link RestInfoProvider#getSiteName(RestRequest)}
- * <li><js>"tags"</js> - Value returned by {@link RestInfoProvider#getTags(RestRequest)}
- * <li><js>"termsOfService"</js> - Value returned by {@link RestInfoProvider#getTermsOfService(RestRequest)}
+ * <li><js>"tags"</js> - Value returned by {@link Swagger#getTags()}
+ * <li><js>"termsOfService"</js> - Value returned by {@link Info#getTermsOfService()}
* <li><js>"title"</js> - See {@link RestInfoProvider#getTitle(RestRequest)}
- * <li><js>"version"</js> - See {@link RestInfoProvider#getVersion(RestRequest)}
+ * <li><js>"version"</js> - See {@link Info#getVersion()}
* </ul>
*
* <p>
@@ -105,12 +105,13 @@ public class RestInfoVar extends MultipartResolvingVar {
public String resolve(VarResolverSession session, String key) {
try {
RestRequest req = session.getSessionObject(RestRequest.class, SESSION_req);
+ Swagger swagger = req.getSwagger();
RestInfoProvider rip = req.getInfoProvider();
WriterSerializer s = JsonSerializer.DEFAULT_LAX;
char c = StringUtils.charAt(key, 0);
if (c == 'c') {
if ("contact".equals(key)) {
- Contact x = rip.getContact(req);
+ Contact x = swagger.getInfo().getContact();
return x == null ? null : s.toString(x);
}
} else if (c == 'd') {
@@ -118,12 +119,12 @@ public class RestInfoVar extends MultipartResolvingVar {
return rip.getDescription(req);
} else if (c == 'e') {
if ("externalDocs".equals(key)) {
- ExternalDocumentation x = rip.getExternalDocs(req);
+ ExternalDocumentation x = swagger.getExternalDocs();
return x == null ? null : s.toString(x);
}
} else if (c == 'l') {
if ("license".equals(key)) {
- License x = rip.getLicense(req);
+ License x = swagger.getInfo().getLicense();
return x == null ? null : s.toString(x);
}
} else if (c == 'm') {
@@ -136,16 +137,16 @@ public class RestInfoVar extends MultipartResolvingVar {
return rip.getSiteName(req);
} else if (c == 't') {
if ("tags".equals(key)) {
- List<Tag> x = rip.getTags(req);
+ List<Tag> x = swagger.getTags();
return x == null ? null : s.toString(x);
} else if ("termsOfService".equals(key)) {
- return rip.getTermsOfService(req);
+ return swagger.getInfo().getTermsOfService();
} else if ("title".equals(key)) {
- return rip.getTitle(req);
+ return swagger.getInfo().getTitle();
}
} else if (c == 'v') {
if ("version".equals(key))
- return rip.getVersion(req);
+ return swagger.getInfo().getVersion();
}
return null;
} catch (RestException e) {
--
To stop receiving notification emails like this one, please contact
jamesbognar@apache.org.