public class UserAgentInfo
extends java.lang.Object
UASparser.parse(String).
Note that all information comes from the database provided at user-agent-string.info. If you have problems with or questions about the data returned, please contact the maintainer of the database directly.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
UNKNOWN |
| Constructor and Description |
|---|
UserAgentInfo() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getBrowserVersionInfo()
Retrieve the UA version number; i.e., given the UA:
|
java.lang.String |
getDeviceIcon()
Retrieve the icon filename, if available; i.e., given the UA:
|
java.lang.String |
getDeviceInfoUrl()
Retrieve the URL path for the given UA on user-agent-string.info; i.e., given the UA:
|
java.lang.String |
getDeviceType()
Retrieve the type of the device, if available.
|
java.lang.String |
getOsCompany()
Retrieve the name of the OS vendor
|
java.lang.String |
getOsCompanyUrl()
Retrieve the URL to the OS vendor's homepage
|
java.lang.String |
getOsFamily()
Retrieve the OS family name
|
java.lang.String |
getOsIcon()
Retrieve the filename of the OS icon
|
java.lang.String |
getOsName()
Retrieve the OS name
|
java.lang.String |
getOsUrl()
Retrieve the URL to the OS vendor's product page
|
java.lang.String |
getType()
Retrieve the type of UA.
|
java.lang.String |
getUaCompany()
Retrieve the name of the company which developed the given UA; i.e., given the UA:
|
java.lang.String |
getUaCompanyUrl()
Retrieve the URL of the company which developed the given UA; i.e., given the UA:
|
java.lang.String |
getUaFamily()
Retrieve the product family; i.e., given the UA:
|
java.lang.String |
getUaIcon()
Retrieve the icon filename, if available; i.e., given the UA:
|
java.lang.String |
getUaInfoUrl()
Retrieve the URL path for the given UA on user-agent-string.info; i.e., given the UA:
|
java.lang.String |
getUaName()
Retrieve the UA name and version; i.e., given the UA:
|
java.lang.String |
getUaUrl()
Retrieve the URL of the UA's product page; i.e., given the UA:
|
boolean |
hasDeviceInfo() |
boolean |
hasOsInfo() |
boolean |
isRobot()
Returns true if this represents a Robot
|
void |
setBrowserEntry(cz.mallat.uasparser.BrowserEntry browserEntry) |
void |
setBrowserVersionInfo(java.lang.String browserVersionInfo) |
void |
setDeviceEntry(cz.mallat.uasparser.DeviceEntry deviceEntry) |
void |
setOsEntry(cz.mallat.uasparser.OsEntry osEntry) |
void |
setRobotEntry(cz.mallat.uasparser.RobotEntry robotEntry) |
void |
setType(java.lang.String type) |
java.lang.String |
toString() |
public static final java.lang.String UNKNOWN
public boolean isRobot()
public boolean hasOsInfo()
public boolean hasDeviceInfo()
public java.lang.String getType()
String typepublic void setType(java.lang.String type)
public java.lang.String getUaFamily()
"Mozilla/5.0 (Windows; U; Windows NT 6.1; pt-BR; rv:1.9.1.1) Gecko/20090715 Firefox/3.5.1"
it would return "Firefox"
String URLpublic java.lang.String getUaName()
"Mozilla/5.0 (Windows; U; Windows NT 6.1; pt-BR; rv:1.9.1.1) Gecko/20090715 Firefox/3.5.1"
it would return "Firefox 3.5.1"
String UA namepublic java.lang.String getUaUrl()
"Mozilla/5.0 (Windows; U; Windows NT 6.1; pt-BR; rv:1.9.1.1) Gecko/20090715 Firefox/3.5.1"
it would return "http://www.firefox.com/"
String URLpublic java.lang.String getUaInfoUrl()
"Mozilla/5.0 (Windows; U; Windows NT 6.1; pt-BR; rv:1.9.1.1) Gecko/20090715 Firefox/3.5.1"
it would return "/list-of-ua/browser-detail?browser=Firefox" which could then be accessed
at http://user-agent-string.info/list-of-ua/browser-detail?browser=Firefox
String URL pathpublic java.lang.String getUaCompany()
"Mozilla/5.0 (Windows; U; Windows NT 6.1; pt-BR; rv:1.9.1.1) Gecko/20090715 Firefox/3.5.1"
it would return "Mozilla Foundation"
String URLpublic java.lang.String getUaCompanyUrl()
"Mozilla/5.0 (Windows; U; Windows NT 6.1; pt-BR; rv:1.9.1.1) Gecko/20090715 Firefox/3.5.1"
it would return "http://www.mozilla.org/"
String URLpublic java.lang.String getUaIcon()
"Mozilla/5.0 (Windows; U; Windows NT 6.1; pt-BR; rv:1.9.1.1) Gecko/20090715 Firefox/3.5.1"
it would return "firefox.png"
String URLpublic java.lang.String getOsFamily()
public java.lang.String getOsName()
public java.lang.String getOsUrl()
public java.lang.String getOsCompany()
public java.lang.String getOsCompanyUrl()
public java.lang.String getOsIcon()
public java.lang.String getBrowserVersionInfo()
"Mozilla/5.0 (Windows; U; Windows NT 6.1; pt-BR; rv:1.9.1.1) Gecko/20090715 Firefox/3.5.1"
it would return "3.5.1"
String version numberpublic java.lang.String getDeviceType()
String typepublic java.lang.String getDeviceIcon()
"Mozilla/5.0 (Linux; U; Android 2.3.5; de-ch; HTC_DesireHD_A9191 Build/GRJ90) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1"
it would return "phone.png"
String URLpublic java.lang.String getDeviceInfoUrl()
"Mozilla/5.0 (Linux; U; Android 2.3.5; de-ch; HTC_DesireHD_A9191 Build/GRJ90) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1"
it would return "http://user-agent-string.info/list-of-ua/device-detail?device=Smartphone".
String URL pathpublic void setBrowserEntry(cz.mallat.uasparser.BrowserEntry browserEntry)
public void setBrowserVersionInfo(java.lang.String browserVersionInfo)
public void setOsEntry(cz.mallat.uasparser.OsEntry osEntry)
public void setRobotEntry(cz.mallat.uasparser.RobotEntry robotEntry)
public void setDeviceEntry(cz.mallat.uasparser.DeviceEntry deviceEntry)
public java.lang.String toString()
toString in class java.lang.Object