public class SlingshotUserAgentComponentElementEvaluator
extends org.springframework.extensions.surf.extensibility.impl.DefaultSubComponentEvaluator
Evaluator used to decide if a shall be bound in to a and .
Returns true if the current User Agent matches the regexp from the parameter.
Note! The regexp is expressed without using the surrounding // characters.
Note! the default value of the parameter is ".*" which will make it match all User Agents.
Example:
<evaluator type="useragent.component.evaluator"/>
Will return true, no matter what User Agent is being used.
Example 2:
<evaluator type="useragent.component.evaluator">
<params>
<useragent>MSIE\s([^;]*)</useragent>
</params>
</evaluator>
Will return true if the current User Agent matches Internet Explorer
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
USERAGENT_FILTER |
protected SlingshotEvaluatorUtil |
util |
Constructor and Description |
---|
SlingshotUserAgentComponentElementEvaluator() |
Modifier and Type | Method and Description |
---|---|
boolean |
evaluate(org.springframework.extensions.surf.RequestContext context,
java.util.Map params)
Decides if the requesting User Agent matches a given expression.
|
void |
setSlingshotEvaluatorUtil(SlingshotEvaluatorUtil slingshotExtensibilityUtil) |
public static final java.lang.String USERAGENT_FILTER
protected SlingshotEvaluatorUtil util
public SlingshotUserAgentComponentElementEvaluator()
public void setSlingshotEvaluatorUtil(SlingshotEvaluatorUtil slingshotExtensibilityUtil)
public boolean evaluate(org.springframework.extensions.surf.RequestContext context, java.util.Map params)
evaluate
in interface org.springframework.extensions.surf.extensibility.SubComponentEvaluator
evaluate
in class org.springframework.extensions.surf.extensibility.impl.DefaultSubComponentEvaluator
context
- params
- Copyright © 2005 - 2013 Alfresco Software, Inc. All Rights Reserved.