|
spring-mobile-device | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.mobile.device.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 WURFL. 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. Tablet resolution is also performed based on known tablet browser UA strings. Android tablets are detected based on Google's recommendations.
| Constructor Summary | |
|---|---|
LiteDeviceResolver()
|
|
LiteDeviceResolver(java.util.List<java.lang.String> normalUserAgentKeywords)
|
|
| Method Summary | |
|---|---|
protected java.util.List<java.lang.String> |
getMobileUserAgentKeywords()
List of user agent keywords that identify mobile devices. |
protected java.util.List<java.lang.String> |
getMobileUserAgentPrefixes()
List of user agent prefixes that identify mobile devices. |
protected java.util.List<java.lang.String> |
getNormalUserAgentKeywords()
List of user agent keywords that identify normal devices. |
protected java.util.List<java.lang.String> |
getTabletUserAgentKeywords()
List of user agent keywords that identify tablet 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()
public LiteDeviceResolver(java.util.List<java.lang.String> normalUserAgentKeywords)
| Method Detail |
|---|
public Device resolveDevice(javax.servlet.http.HttpServletRequest request)
DeviceResolver
resolveDevice in interface DeviceResolverprotected java.util.List<java.lang.String> getMobileUserAgentPrefixes()
protected java.util.List<java.lang.String> getMobileUserAgentKeywords()
protected java.util.List<java.lang.String> getTabletUserAgentKeywords()
protected java.util.List<java.lang.String> getNormalUserAgentKeywords()
protected void init()
protected Device resolveFallback(javax.servlet.http.HttpServletRequest request)
Device that is neither mobile or a tablet.
Subclasses may override to try additional mobile or tablet device matching before falling back to a "normal" device.
|
spring-mobile-device | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||