Class UserAgent
java.lang.Object
org.ocpsoft.rewrite.config.DefaultConditionBuilder
org.ocpsoft.rewrite.servlet.config.HttpCondition
org.ocpsoft.rewrite.servlet.config.UserAgent
- All Implemented Interfaces:
Condition,ConditionBuilder
A
Condition that inspects the value of HttpServletRequest.getHeader(String) "User-Agent"- Author:
- Lincoln Baxter, III
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreate aConditionasserting that the user-agent is a non-mobile device.isMobile()Create aConditionasserting that the user-agent is a mobile device.isTablet()Create aConditionasserting that the user-agent is a tablet device.static UserAgentCreate aConditionasserting that the user-agent matches the given pattern.Methods inherited from class org.ocpsoft.rewrite.servlet.config.HttpCondition
evaluate, evaluateHttpMethods inherited from class org.ocpsoft.rewrite.config.DefaultConditionBuilder
and, andNot, or, orNot
-
Constructor Details
-
UserAgent
public UserAgent()
-
-
Method Details
-
matches
Create aConditionasserting that the user-agent matches the given pattern.User agent expressions may be parameterized:
UserAgent.matches("BlackBerry PlayBook 3.4")
UserAgent.matches("BlackBerry PlayBook {version}")
UserAgent.matches("{agent}")
...- Parameters:
name-ParameterizedPatternmatching the request parameter name.- See Also:
-
isMobile
Create aConditionasserting that the user-agent is a mobile device. -
isTablet
Create aConditionasserting that the user-agent is a tablet device. -
isDesktop
Create aConditionasserting that the user-agent is a non-mobile device.
-