public class LiteDeviceResolver extends java.lang.Object implements DeviceResolver
Constructor and Description |
---|
LiteDeviceResolver() |
LiteDeviceResolver(java.util.List<java.lang.String> normalUserAgentKeywords) |
Modifier and Type | Method and Description |
---|---|
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.
|
public LiteDeviceResolver()
public LiteDeviceResolver(java.util.List<java.lang.String> normalUserAgentKeywords)
public Device resolveDevice(javax.servlet.http.HttpServletRequest request)
DeviceResolver
resolveDevice
in interface DeviceResolver
protected 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.