You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by fs...@apache.org on 2019/10/26 10:24:18 UTC

[tomcat] branch master updated: Add javadoc for RewriteMap

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

fschumacher 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 3f9d9de  Add javadoc for RewriteMap
3f9d9de is described below

commit 3f9d9de8568d22e5614491af0ef731dbde38107c
Author: Felix Schumacher <fs...@apache.org>
AuthorDate: Sat Oct 26 12:24:03 2019 +0200

    Add javadoc for RewriteMap
---
 .../apache/catalina/valves/rewrite/RewriteMap.java | 33 ++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/java/org/apache/catalina/valves/rewrite/RewriteMap.java b/java/org/apache/catalina/valves/rewrite/RewriteMap.java
index 428588c..551584b 100644
--- a/java/org/apache/catalina/valves/rewrite/RewriteMap.java
+++ b/java/org/apache/catalina/valves/rewrite/RewriteMap.java
@@ -16,9 +16,42 @@
  */
 package org.apache.catalina.valves.rewrite;
 
+/**
+ * Interface for user defined lookup/replacement logic that can be defined in
+ * a {@code rewrite.config} file by a {@code RewriteMap} directive. Such a map
+ * can then be used by a {@code RewriteRule} defined in the same file.
+ * <p>
+ * An example {@code rewrite.config} file could look like:
+ * <code>
+ * <pre>
+ * RewriteMap uc example.UpperCaseMap
+ *
+ * RewriteRule ^/(.*)$ ${uc:$1}
+ * </pre>
+ * </code>
+ *
+ * One parameter can be optionally appended to the {@code RewriteMap} directive.
+ * This could be used &ndash; for example &ndash; to specify a name of a file, that
+ * contains a lookup table used by the implementation of the map.
+ */
 public interface RewriteMap {
 
+    /**
+     * Optional parameter that can be defined through the {@code RewriteMap}
+     * directive in the {@code rewrite.config} file.
+     *
+     * @param params the optional parameter
+     * @return value is currently ignored
+     */
     public String setParameters(String params);
 
+    /**
+     * Maps a key to a replacement value.<br>
+     * The method is free to return {@code null} to indicate, that the default
+     * value from the {@code RewriteRule} directive should be used.
+     *
+     * @param key used by the actual implementation to generate a mapped value
+     * @return mapped value or {@code null}
+     */
     public String lookup(String key);
 }


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