Package 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 YAUAA (https://yauaa.basjes.nl/) The initialization step for a full UserAgentAnalyzer (i.e. all fields) usually takes something in the range of 2-5 seconds.
-
-
Constructor Summary
Constructors Constructor Description BrowserDetector(String userAgentString)
Constructor used to initialize this class.BrowserDetector(RunData data)
Constructor used to initialize this class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.nl.basjes.parse.useragent.UserAgent
getUserAgent()
The user agent for this class.String
getUserAgentString()
The user agent string for this class.
-
-
-
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 nl.basjes.parse.useragent.UserAgent getUserAgent()
The user agent for this class.- Returns:
- A user agent.
-
-