Interface RewriteMap
-
- All Known Implementing Classes:
InternalRewriteMap.Escape
,InternalRewriteMap.LowerCase
,InternalRewriteMap.Unescape
,InternalRewriteMap.UpperCase
public interface RewriteMap
Interface for user defined lookup/replacement logic that can be defined in arewrite.config
file by aRewriteMap
directive. Such a map can then be used by aRewriteRule
defined in the same file.An example
rewrite.config
file could look like:RewriteMap uc example.UpperCaseMap RewriteRule ^/(.*)$ ${uc:$1}
One parameter can be optionally appended to theRewriteMap
directive. This could be used – for example – to specify a name of a file, that contains a lookup table used by the implementation of the map.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.lang.String
lookup(java.lang.String key)
Maps a key to a replacement value.
The method is free to returnnull
to indicate, that the default value from theRewriteRule
directive should be used.java.lang.String
setParameters(java.lang.String params)
Optional parameter that can be defined through theRewriteMap
directive in therewrite.config
file.default void
setParameters(java.lang.String... params)
Optional parameters that can be defined through theRewriteMap
directive in therewrite.config
file.
-
-
-
Method Detail
-
setParameters
java.lang.String setParameters(java.lang.String params)
Optional parameter that can be defined through theRewriteMap
directive in therewrite.config
file.- Parameters:
params
- the optional parameter- Returns:
- value is currently ignored
-
setParameters
default void setParameters(java.lang.String... params)
Optional parameters that can be defined through theRewriteMap
directive in therewrite.config
file.This method will be called, if there are more than one parameters defined.
- Parameters:
params
- the optional parameters
-
lookup
java.lang.String lookup(java.lang.String key)
Maps a key to a replacement value.
The method is free to returnnull
to indicate, that the default value from theRewriteRule
directive should be used.- Parameters:
key
- used by the actual implementation to generate a mapped value- Returns:
- mapped value or
null
-
-