Class UaParserUtil


  • public class UaParserUtil
    extends java.lang.Object
    Utility class for using the UA parser library. LumisXP is using this to replace the use of WURFL library in some cases, but the stable IDeviceManager was not modified in anyway in this aspect. So this class is currently a internal LumisXP class that centralizes the use of the UA parser library.
    Since:
    17.0.0
    Version:
    $Revision: 26587 $ $Date: 2024-08-26 21:09:17 -0300 (Mon, 26 Aug 2024) $
    • Constructor Summary

      Constructors 
      Constructor Description
      UaParserUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getDeviceType​(ua_parser.Device device)
      Returns the device type categorization for a given device.
      static ua_parser.Client parseClient​(java.lang.String userAgent)
      Returns the parsed client from the given user agent.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • UaParserUtil

        public UaParserUtil()
    • Method Detail

      • parseClient

        public static ua_parser.Client parseClient​(java.lang.String userAgent)
        Returns the parsed client from the given user agent.
        Parameters:
        userAgent - the user agent.
        Returns:
        the parsed client.
        Since:
        17.0.0
      • getDeviceType

        public static java.lang.String getDeviceType​(ua_parser.Device device)
        Returns the device type categorization for a given device.
        Parameters:
        device - the device.
        Returns:
        "tablet", "smartphone" or "desktop".
        Since:
        17.0.0