public abstract class UserAgent extends HttpCondition
Condition that inspects the value of HttpServletRequest.getHeader(String) "User-Agent"| Constructor and Description |
|---|
UserAgent() |
| Modifier and Type | Method and Description |
|---|---|
static org.ocpsoft.rewrite.servlet.config.UserAgent.ClassificationUserAgent |
isDesktop()
Create a
Condition asserting that the user-agent is a non-mobile device. |
static org.ocpsoft.rewrite.servlet.config.UserAgent.ClassificationUserAgent |
isMobile()
Create a
Condition asserting that the user-agent is a mobile device. |
static org.ocpsoft.rewrite.servlet.config.UserAgent.ClassificationUserAgent |
isTablet()
Create a
Condition asserting that the user-agent is a tablet device. |
static UserAgent |
matches(String pattern)
Create a
Condition asserting that the user-agent matches the given pattern. |
evaluate, evaluateHttpand, andNot, or, orNotpublic static UserAgent matches(String pattern)
Condition asserting 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}")
...
name - ParameterizedPattern matching the request parameter name.{@link HttpServletRequest#getParameterMap()}public static org.ocpsoft.rewrite.servlet.config.UserAgent.ClassificationUserAgent isMobile()
Condition asserting that the user-agent is a mobile device.public static org.ocpsoft.rewrite.servlet.config.UserAgent.ClassificationUserAgent isTablet()
Condition asserting that the user-agent is a tablet device.public static org.ocpsoft.rewrite.servlet.config.UserAgent.ClassificationUserAgent isDesktop()
Condition asserting that the user-agent is a non-mobile device.Copyright © 2023 OCPsoft. All rights reserved.