org.opencms.jsp.util
Class CmsJspDeviceSelector

java.lang.Object
  extended by org.opencms.jsp.util.CmsJspDeviceSelector
All Implemented Interfaces:
I_CmsJspDeviceSelector

public class CmsJspDeviceSelector
extends java.lang.Object
implements I_CmsJspDeviceSelector

This class provides the detection for different devices, so that the <cms:device type="...">-Tag can detect which device sends the HTTP request.

Since:
8.0.0

Field Summary
static java.lang.String C_DESKTOP
          Constant for desktop detection.
static java.lang.String C_MOBILE
          Constant for mobile detection.
static java.util.List<java.lang.String> TYPES
          The list of types supported by this device selector implementation.
 
Fields inherited from interface org.opencms.jsp.util.I_CmsJspDeviceSelector
REQUEST_ATTRIBUTE_DEVICE
 
Constructor Summary
CmsJspDeviceSelector()
           
 
Method Summary
 java.lang.String getDeviceType(javax.servlet.http.HttpServletRequest req)
          Returns the name of the device type.
 java.util.List<java.lang.String> getDeviceTypes()
          Returns an array of device types that can be detected.
 UAgentInfo getUserAgentInfo()
          Returns the User Agent info.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

C_DESKTOP

public static final java.lang.String C_DESKTOP
Constant for desktop detection.

See Also:
Constant Field Values

C_MOBILE

public static final java.lang.String C_MOBILE
Constant for mobile detection.

See Also:
Constant Field Values

TYPES

public static final java.util.List<java.lang.String> TYPES
The list of types supported by this device selector implementation.

Constructor Detail

CmsJspDeviceSelector

public CmsJspDeviceSelector()
Method Detail

getDeviceType

public java.lang.String getDeviceType(javax.servlet.http.HttpServletRequest req)
Description copied from interface: I_CmsJspDeviceSelector
Returns the name of the device type.

This will be one option in I_CmsJspDeviceSelector.getDeviceTypes().

Specified by:
getDeviceType in interface I_CmsJspDeviceSelector
Parameters:
req - the HTTP servlet request to process
Returns:
the name of the device type
See Also:
I_CmsJspDeviceSelector.getDeviceType(javax.servlet.http.HttpServletRequest)

getDeviceTypes

public java.util.List<java.lang.String> getDeviceTypes()
Description copied from interface: I_CmsJspDeviceSelector
Returns an array of device types that can be detected.

Specified by:
getDeviceTypes in interface I_CmsJspDeviceSelector
Returns:
an array of device types that can be detected
See Also:
I_CmsJspDeviceSelector.getDeviceTypes()

getUserAgentInfo

public UAgentInfo getUserAgentInfo()
Returns the User Agent info.

Returns:
the information about the user agent