|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.mobile.device.lite.LiteDeviceResolver
public class LiteDeviceResolver
A "lightweight" device resolver algorithm based on Wordpress's Mobile pack.
Detects the presence of a mobile device and works for a large percentage of mobile browsers.
Does not perform any device capability mapping, if you need that consider WurflDeviceResolver.
The code is based primarily on a list of approximately 90 well-known mobile browser UA string snippets,
with a couple of special cases for Opera Mini, the W3C default delivery context and certain other Windows browsers.
The code also looks to see if the browser advertises WAP capabilities as a hint.
| Constructor Summary | |
|---|---|
LiteDeviceResolver()
|
|
| Method Summary | |
|---|---|
protected java.util.List<java.lang.String> |
getUserAgentKeywords()
List of user agent keywords that identify mobile devices. |
protected java.util.List<java.lang.String> |
getUserAgentPrefixes()
List of user agent prefixes that identify mobile devices. |
protected void |
init()
Initialize this device resolver implementation. |
Device |
resolveDevice(javax.servlet.http.HttpServletRequest request)
Resolve the device that originated the web request. |
protected Device |
resolveFallback(javax.servlet.http.HttpServletRequest request)
Fallback called if no mobile device is matched by this resolver. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LiteDeviceResolver()
| Method Detail |
|---|
public Device resolveDevice(javax.servlet.http.HttpServletRequest request)
DeviceResolver
resolveDevice in interface DeviceResolverprotected java.util.List<java.lang.String> getUserAgentPrefixes()
protected java.util.List<java.lang.String> getUserAgentKeywords()
protected void init()
protected Device resolveFallback(javax.servlet.http.HttpServletRequest request)
Device with the mobile property set to false.
Subclasses may override to try additional mobile device matching before falling back to a "not mobile" device.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||