You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2020/10/06 09:31:24 UTC

[tomcat] 02/03: Added Javadoc comments for Java 15

This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 92289a8daedd9d3152a731c7baf8253c1abf4684
Author: Igal Sapir <is...@apache.org>
AuthorDate: Sat Oct 3 13:53:51 2020 -0700

    Added Javadoc comments for Java 15
---
 java/javax/servlet/FilterRegistration.java  | 19 +++++++++++-----
 java/javax/servlet/GenericFilter.java       |  7 ++++++
 java/javax/servlet/Registration.java        |  5 +++++
 java/javax/servlet/ServletRegistration.java | 34 ++++++++++++++++++++++++-----
 4 files changed, 55 insertions(+), 10 deletions(-)

diff --git a/java/javax/servlet/FilterRegistration.java b/java/javax/servlet/FilterRegistration.java
index b9b10ed..3817aff 100644
--- a/java/javax/servlet/FilterRegistration.java
+++ b/java/javax/servlet/FilterRegistration.java
@@ -20,8 +20,9 @@ import java.util.Collection;
 import java.util.EnumSet;
 
 /**
+ * Interface through which a Filter may be further configured.
+ *
  * @since Servlet 3.0
- * TODO SERVLET3 - Add comments
  */
 public interface FilterRegistration extends Registration {
 
@@ -43,9 +44,12 @@ public interface FilterRegistration extends Registration {
     public void addMappingForServletNames(
             EnumSet<DispatcherType> dispatcherTypes,
             boolean isMatchAfter, String... servletNames);
+
     /**
+     * Gets the currently available servlet name mappings of the Filter
+     * represented by this FilterRegistration.
      *
-     * @return TODO
+     * @return a Collection of the Servlet name mappings
      */
     public Collection<String> getServletNameMappings();
 
@@ -69,13 +73,18 @@ public interface FilterRegistration extends Registration {
             boolean isMatchAfter, String... urlPatterns);
 
     /**
+     * Gets the currently available URL pattern mappings of the Filter
+     * represented by this FilterRegistration.
      *
-     * @return TODO
+     * @return a Collection of the URL pattern mappings
      */
     public Collection<String> getUrlPatternMappings();
 
-    public static interface Dynamic
-    extends FilterRegistration, Registration.Dynamic {
+    /**
+     * Interface through which a Filter registered via one of the addFilter
+     * methods on ServletContext may be further configured.
+     */
+    public static interface Dynamic extends FilterRegistration, Registration.Dynamic {
         // No additional methods
     }
 }
diff --git a/java/javax/servlet/GenericFilter.java b/java/javax/servlet/GenericFilter.java
index 3f78fe4..32ea77a 100644
--- a/java/javax/servlet/GenericFilter.java
+++ b/java/javax/servlet/GenericFilter.java
@@ -19,6 +19,13 @@ package javax.servlet;
 import java.io.Serializable;
 import java.util.Enumeration;
 
+/**
+ * Provides a base class the implements the Filter and FilterConfig interfaces
+ * to reduce boilerplate when writing new filters.
+ *
+ * @see javax.servlet.Filter
+ * @see javax.servlet.FilterConfig
+ */
 public abstract class GenericFilter implements Filter, FilterConfig, Serializable {
 
     private static final long serialVersionUID = 1L;
diff --git a/java/javax/servlet/Registration.java b/java/javax/servlet/Registration.java
index 3eebca5..49ecd9c 100644
--- a/java/javax/servlet/Registration.java
+++ b/java/javax/servlet/Registration.java
@@ -78,6 +78,11 @@ public interface Registration {
      */
     public Map<String, String> getInitParameters();
 
+    /**
+     * Interface through which a Servlet or Filter registered via one of the
+     * addServlet or addFilter methods, respectively, on ServletContext may be
+     * further configured.
+     */
     public interface Dynamic extends Registration {
 
         /**
diff --git a/java/javax/servlet/ServletRegistration.java b/java/javax/servlet/ServletRegistration.java
index 44be9d2..d31611b 100644
--- a/java/javax/servlet/ServletRegistration.java
+++ b/java/javax/servlet/ServletRegistration.java
@@ -20,27 +20,51 @@ import java.util.Collection;
 import java.util.Set;
 
 /**
- * TODO SERVLET3 - Add comments
+ * Interface through which a Servlet may be further configured.
+ *
  * @since Servlet 3.0
  */
 public interface ServletRegistration extends Registration {
 
     /**
-     * TODO
+     * Adds a servlet mapping with the given URL patterns for the Servlet
+     * represented by this ServletRegistration. If any of the specified URL
+     * patterns are already mapped to a different Servlet, no updates will
+     * be performed.
+     *
+     * If this method is called multiple times, each successive call adds to
+     * the effects of the former. The returned set is not backed by the
+     * ServletRegistration object, so changes in the returned set are not
+     * reflected in the ServletRegistration object, and vice-versa.
+     *
      * @param urlPatterns The URL patterns that this Servlet should be mapped to
-     * @return TODO
+     * @return the (possibly empty) Set of URL patterns that are already mapped
+     * to a different Servlet
      * @throws IllegalArgumentException if urlPattern is null or empty
      * @throws IllegalStateException if the associated ServletContext has
      *                                  already been initialised
      */
     public Set<String> addMapping(String... urlPatterns);
 
+    /**
+     * Gets the currently available mappings of the Servlet represented by this
+     * ServletRegistration.
+     *
+     * If permitted, any changes to the returned Collection must not affect this
+     * ServletRegistration.
+     *
+     * @return a (possibly empty) Collection of the currently available mappings
+     * of the Servlet represented by this ServletRegistration
+     */
     public Collection<String> getMappings();
 
     public String getRunAsRole();
 
-    public static interface Dynamic
-    extends ServletRegistration, Registration.Dynamic {
+    /**
+     * Interface through which a Servlet registered via one of the addServlet
+     * methods on ServletContext may be further configured.
+     */
+    public static interface Dynamic extends ServletRegistration, Registration.Dynamic {
         public void setLoadOnStartup(int loadOnStartup);
         public Set<String> setServletSecurity(ServletSecurityElement constraint);
         public void setMultipartConfig(MultipartConfigElement multipartConfig);


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org