org.apache.turbine.util

## Class BrowserDetector

- java.lang.Object
- - org.apache.turbine.util.BrowserDetector

-     public class BrowserDetector
      extends Object

  This class parses the user agent string and provides getters for its parts. It uses UADetector (http://uadetector.sourceforge.net/)
  Author:
    Frank Y. Kim, Leon Atkisnon, Chris Mospaw, Benjamin Elijah Griffin, Thomas Vandahl

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BrowserDetector(RunData data)` Constructor used to initialize this class.
    `BrowserDetector(String userAgentString)` Constructor used to initialize this class.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getBrowserName()` The browser name specified in the user agent string.
    `String` | `getBrowserPlatform()` The browser platform specified in the user agent string.
    `float` | `getBrowserVersion()` The browser version specified in the user agent string.
    `net.sf.uadetector.ReadableUserAgent` | `getUserAgent()` The user agent for this class.
    `String` | `getUserAgentString()` The user agent string for this class.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### BrowserDetector

          public BrowserDetector(String userAgentString)

      Constructor used to initialize this class.
      Parameters:
        `userAgentString` - A String with the user agent field.

    - #### BrowserDetector

          public BrowserDetector(RunData data)

      Constructor used to initialize this class.
      Parameters:
        `data` - The Turbine RunData object.

  - ### Method Detail

    - #### getBrowserName

          public String getBrowserName()

      The browser name specified in the user agent string.
      Returns:
        A String with the browser name.

    - #### getBrowserPlatform

          public String getBrowserPlatform()

      The browser platform specified in the user agent string.
      Returns:
        A String with the browser platform.

    - #### getBrowserVersion

          public float getBrowserVersion()

      The browser version specified in the user agent string.
      Returns:
        A String with the browser version.

    - #### getUserAgentString

          public String getUserAgentString()

      The user agent string for this class.
      Returns:
        A String with the user agent.

    - #### getUserAgent

          public net.sf.uadetector.ReadableUserAgent getUserAgent()

      The user agent for this class.
      Returns:
        A user agent.

Copyright © 2000–2018 The Apache Software Foundation. All rights reserved.