This is an automated email from the ASF dual-hosted git repository.
isapir pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/master by this push:
new a0fb5f4 Added Javadoc comments for Java 15
a0fb5f4 is described below
commit a0fb5f4b42c593fa566878dddfa213e5f3c9c499
Author: Igal Sapir <[email protected]>
AuthorDate: Sat Oct 3 13:53:51 2020 -0700
Added Javadoc comments for Java 15
---
java/jakarta/servlet/FilterRegistration.java | 19 +++++++++++----
java/jakarta/servlet/GenericFilter.java | 7 ++++++
java/jakarta/servlet/Registration.java | 5 ++++
java/jakarta/servlet/ServletRegistration.java | 34 +++++++++++++++++++++++----
4 files changed, 55 insertions(+), 10 deletions(-)
diff --git a/java/jakarta/servlet/FilterRegistration.java
b/java/jakarta/servlet/FilterRegistration.java
index 0516459..d2c8354 100644
--- a/java/jakarta/servlet/FilterRegistration.java
+++ b/java/jakarta/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/jakarta/servlet/GenericFilter.java
b/java/jakarta/servlet/GenericFilter.java
index 7d999a5..f2585d0 100644
--- a/java/jakarta/servlet/GenericFilter.java
+++ b/java/jakarta/servlet/GenericFilter.java
@@ -19,6 +19,13 @@ package jakarta.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 jakarta.servlet.Filter
+ * @see jakarta.servlet.FilterConfig
+ */
public abstract class GenericFilter implements Filter, FilterConfig,
Serializable {
private static final long serialVersionUID = 1L;
diff --git a/java/jakarta/servlet/Registration.java
b/java/jakarta/servlet/Registration.java
index c6c0de8..45f3934 100644
--- a/java/jakarta/servlet/Registration.java
+++ b/java/jakarta/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/jakarta/servlet/ServletRegistration.java
b/java/jakarta/servlet/ServletRegistration.java
index 5169f68..f78bde0 100644
--- a/java/jakarta/servlet/ServletRegistration.java
+++ b/java/jakarta/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: [email protected]
For additional commands, e-mail: [email protected]