public class ContentDynamicRegExParamBuilder extends AbstractContentRegExParamBuilder
This ParamBuilder will extract parameters from some content by using regular expressions.
It can be configured with a static list of patterns, however the patterns themselves can contain
expressions as described by ExpressionUtil
. These expressions will be evaluated
before using the regular expression to match against the content.
For example, suppose an earlier ParamBuilder defines a parameter named validChars with value 'abcdef', then you can define a regular expression as '(?<myParam>[!!validChars!!]+)'. Before the pattern is used, the expression will be evaluated, so the pattern becomes '(?<myParam>[abcdef]+)'.
For more information about regular expression format and how content is retrieved, please see the
superclass AbstractContentRegExParamBuilder
.
contentParam
Constructor and Description |
---|
ContentDynamicRegExParamBuilder() |
Modifier and Type | Method and Description |
---|---|
Collection<String> |
getPatterns()
Get the collection of patterns as they were configured, including the expressions.
|
protected Collection<Pattern> |
getPatterns(Map<String,String> params,
javax.servlet.http.HttpServletRequest request)
Implementation for the
AbstractContentRegExParamBuilder.getPatterns(Map, HttpServletRequest)
method; this will evaluate any expressions inside the configured collection of patterns, then
returns the collection of evaluated patterns. |
boolean |
isEnableRecursiveExpressions()
Returns whether recursive expression evaluation is enabled.
|
void |
setEnableRecursiveExpressions(boolean enableRecursiveExpressions)
Enable or disable recursive expression evaluation.
|
void |
setPatterns(Collection<String> patterns)
Set the collection of patterns; these patterns may contain expressions as described by
ExpressionUtil . |
String |
toString()
Provide a useful string representation of this ParamBuilder,
showing the content parameter name and the configured patterns
(including expressions).
|
addRegExValues, buildParams, getContentParam, getGroupNames, setContentParam
afterPropertiesSet, compareTo, extraAfterPropertiesSet, getOrder, setOrder
getBeanName, setBeanName
protected Collection<Pattern> getPatterns(Map<String,String> params, javax.servlet.http.HttpServletRequest request)
AbstractContentRegExParamBuilder.getPatterns(Map, HttpServletRequest)
method; this will evaluate any expressions inside the configured collection of patterns, then
returns the collection of evaluated patterns.getPatterns
in class AbstractContentRegExParamBuilder
public Collection<String> getPatterns()
public void setPatterns(Collection<String> patterns)
ExpressionUtil
.patterns
- public boolean isEnableRecursiveExpressions()
public void setEnableRecursiveExpressions(boolean enableRecursiveExpressions)
enableRecursiveExpressions
- Copyright © 2013. All rights reserved.