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 2021/02/10 17:01:50 UTC
[juneau] branch master updated: 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 fd45a3d Javadocs.
fd45a3d is described below
commit fd45a3d8bac93245db8e93fad6e304355d784cfc
Author: JamesBognar <ja...@salesforce.com>
AuthorDate: Wed Feb 10 12:00:37 2021 -0500
Javadocs.
---
.../org/apache/juneau/rest/BasicRestOperations.java | 18 ++++++++----------
.../main/java/org/apache/juneau/rest/RestMatcher.java | 6 +++---
.../org/apache/juneau/rest/RestOperationContext.java | 10 +++++-----
3 files changed, 16 insertions(+), 18 deletions(-)
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/BasicRestOperations.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/BasicRestOperations.java
index aa82026..fb452b4 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/BasicRestOperations.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/BasicRestOperations.java
@@ -29,14 +29,12 @@ import org.apache.juneau.rest.annotation.*;
* Basic REST operation methods.
*/
@HtmlDocConfig(
-
// Basic page navigation links.
navlinks={
"up: request:/..",
"api: servlet:/api",
"stats: servlet:/stats"
}
-
)
@JsonSchemaConfig(
// Add descriptions to the following types when not specified:
@@ -48,14 +46,6 @@ import org.apache.juneau.rest.annotation.*;
// Use $ref references for bean definitions to reduce duplication in Swagger.
useBeanDefs="true"
)
-@BeanConfig(
- // POJO swaps to apply to all serializers/parsers on this method.
- swaps={
- // Use the SwaggerUI swap when rendering Swagger beans.
- // This is a per-media-type swap that only applies to text/html requests.
- SwaggerUI.class
- }
-)
public interface BasicRestOperations {
/**
@@ -81,6 +71,14 @@ public interface BasicRestOperations {
// Never show aside contents of page inherited from class.
aside="NONE"
)
+ @BeanConfig(
+ // POJO swaps to apply to all serializers/parsers on this method.
+ swaps={
+ // Use the SwaggerUI swap when rendering Swagger beans.
+ // This is a per-media-type swap that only applies to text/html requests.
+ SwaggerUI.class
+ }
+ )
public Swagger getSwagger(RestRequest req);
/**
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestMatcher.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestMatcher.java
index 2301dc5..196fa4f 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestMatcher.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestMatcher.java
@@ -36,7 +36,7 @@ import org.apache.juneau.rest.annotation.*;
*
* <h5 class='section'>Example:</h5>
* <p class='bcode w800'>
- * <jk>public class</jk> MyResource <jk>extends</jk> RestServlet {
+ * <jk>public class</jk> MyResource <jk>extends</jk> BasicRestServlet {
*
* <ja>@RestOp</ja>(method=<jsf>GET</jsf>, path=<js>"/foo"</js>, matchers=IsDNT.<jk>class</jk>)
* <jk>public</jk> Object doGetWithDNT() {
@@ -51,8 +51,8 @@ import org.apache.juneau.rest.annotation.*;
*
* <jk>public class</jk> IsDNT <jk>extends</jk> RestMatcher {
* <ja>@Override</ja>
- * <jk>public boolean</jk> matches(RestRequest req) {
- * <jk>return</jk> req.getHeader(<jk>int</jk>.<jk>class</jk>, <js>"DNT"</js>, 0) == 1;
+ * <jk>public boolean</jk> matches(HttpServletRequest <jv>req</jv>) {
+ * <jk>return</jk> <js>"1"</js>.equals(<jv>req</jv>.getHeader(<js>"DNT"</js>));
* }
* }
* </p>
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestOperationContext.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestOperationContext.java
index 1ccb4bc..4dbee76 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestOperationContext.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestOperationContext.java
@@ -1944,6 +1944,11 @@ public class RestOperationContext extends BeanContext implements Comparable<Rest
}
}
+
+ //-----------------------------------------------------------------------------------------------------------------
+ // Other methods.
+ //-----------------------------------------------------------------------------------------------------------------
+
/*
* compareTo() method is used to keep SimpleMethods ordered in the RestCallRouter list.
* It maintains the order in which matches are made during requests.
@@ -2008,11 +2013,6 @@ public class RestOperationContext extends BeanContext implements Comparable<Rest
public int hashCode() {
return method.hashCode();
}
-
- //-----------------------------------------------------------------------------------------------------------------
- // Other methods.
- //-----------------------------------------------------------------------------------------------------------------
-
@Override /* Context */
public OMap toMap() {
return super.toMap()