|
|||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.gargoylesoftware.htmlunit.BrowserVersion
public class BrowserVersion
Objects of this class represent one specific version of a given browser. Predefined constants are provided for common browser versions. If you wish to create a BrowserVersion for a browser that doesn't have a constant defined but aren't sure what values to pass into the constructor then point your browser at http://htmlunit.sourceforge.net/cgi-bin/browserVersion and the code will be generated for you.
Field Summary | |
---|---|
static java.lang.String |
APP_CODE_NAME
Application code name for both Microsoft Internet Explorer and Netscape series |
static java.lang.String |
CPU_CLASS_X86
The X86 CPU class. |
static BrowserVersion |
FIREFOX_2
Firefox 2 |
static java.lang.String |
INTERNET_EXPLORER
Application name for the Microsoft Internet Explorer series of browsers |
static BrowserVersion |
INTERNET_EXPLORER_6_0
Internet Explorer 6 |
static BrowserVersion |
INTERNET_EXPLORER_7_0
Internet Explorer 7 |
static java.lang.String |
LANGUAGE_ENGLISH_US
United States English language identifier. |
static java.lang.String |
NETSCAPE
Application name the Netscape navigator series of browsers |
static java.lang.String |
PLATFORM_WIN32
The WIN32 platform. |
Constructor Summary | |
---|---|
BrowserVersion(java.lang.String applicationName,
java.lang.String applicationVersion,
java.lang.String userAgent,
java.lang.String javaScriptVersion,
float browserVersionNumeric)
Instantiate one. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o)
|
java.lang.String |
getApplicationCodeName()
Return the application code name, for example "Mozilla". |
java.lang.String |
getApplicationMinorVersion()
Return the application minor version, for example "0". |
java.lang.String |
getApplicationName()
Return the application name, for example "Microsoft Internet Explorer". |
java.lang.String |
getApplicationVersion()
Return the application version, for example "4.0 (compatible; MSIE 6.0b; Windows 98)". |
java.lang.String |
getBrowserLanguage()
Return the browser application language, for example "en-us". |
float |
getBrowserVersionNumeric()
|
java.lang.String |
getCpuClass()
Return the type of CPU in the machine, for example "x86". |
static BrowserVersion |
getDefault()
Returns the default browser version that is used whenever a specific version isn't specified. |
java.lang.String |
getJavaScriptVersion()
Return the version of javascript used by the browser, for example "1.2". |
float |
getJavaScriptVersionNumeric()
|
java.lang.String |
getPlatform()
Return the platform on which the application is running, for example "Win32". |
java.lang.String |
getSystemLanguage()
Return the system language, for example "en-us". |
java.lang.String |
getUserAgent()
Return the user agent string, for example "Mozilla/4.0 (compatible; MSIE 6.0b; Windows 98)". |
java.lang.String |
getUserLanguage()
Return the user language, for example "en-us". |
int |
hashCode()
|
boolean |
isIE()
Returns true if this BrowserVersion instance represents some version of Microsoft Internet Explorer. |
boolean |
isNetscape()
Returns true if this BrowserVersion instance represents some version of a Netscape browser, including Mozilla and Firefox. |
boolean |
isOnLine()
Return true if the browser is currently online. |
void |
setApplicationCodeName(java.lang.String applicationCodeName)
|
void |
setApplicationMinorVersion(java.lang.String applicationMinorVersion)
|
void |
setApplicationName(java.lang.String applicationName)
|
void |
setApplicationVersion(java.lang.String applicationVersion)
|
void |
setBrowserLanguage(java.lang.String browserLanguage)
|
void |
setBrowserVersion(float browserVersion)
|
void |
setCpuClass(java.lang.String cpuClass)
|
static void |
setDefault(BrowserVersion newBrowserVersion)
Sets the default browser version that is used whenever a specific version isn't specified. |
void |
setJavaScriptVersion(java.lang.String javaScriptVersion)
|
void |
setOnLine(boolean onLine)
|
void |
setPlatform(java.lang.String platform)
|
void |
setSystemLanguage(java.lang.String systemLanguage)
|
void |
setUserAgent(java.lang.String userAgent)
|
void |
setUserLanguage(java.lang.String userLanguage)
|
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String APP_CODE_NAME
public static final java.lang.String CPU_CLASS_X86
public static final BrowserVersion FIREFOX_2
public static final java.lang.String INTERNET_EXPLORER
public static final BrowserVersion INTERNET_EXPLORER_6_0
public static final BrowserVersion INTERNET_EXPLORER_7_0
public static final java.lang.String LANGUAGE_ENGLISH_US
public static final java.lang.String NETSCAPE
public static final java.lang.String PLATFORM_WIN32
Constructor Detail |
---|
public BrowserVersion(java.lang.String applicationName, java.lang.String applicationVersion, java.lang.String userAgent, java.lang.String javaScriptVersion, float browserVersionNumeric)
applicationName
- The name of the applicationapplicationVersion
- The version string of the applicationuserAgent
- The user agent string that will be sent to the serverjavaScriptVersion
- The version of JavaScriptbrowserVersionNumeric
- The floating number version of the browserMethod Detail |
---|
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public java.lang.String getApplicationCodeName()
APP_CODE_NAME
if not explicitly configured.
public java.lang.String getApplicationMinorVersion()
public java.lang.String getApplicationName()
public java.lang.String getApplicationVersion()
public java.lang.String getBrowserLanguage()
LANGUAGE_ENGLISH_US
if not explicitly configured.
public float getBrowserVersionNumeric()
public java.lang.String getCpuClass()
CPU_CLASS_X86
if not explicitly configured.
public static BrowserVersion getDefault()
INTERNET_EXPLORER_6_0
.
public java.lang.String getJavaScriptVersion()
public float getJavaScriptVersionNumeric()
public java.lang.String getPlatform()
PLATFORM_WIN32
if not explicitly configured.
public java.lang.String getSystemLanguage()
LANGUAGE_ENGLISH_US
if not explicitly configured.
public java.lang.String getUserAgent()
public java.lang.String getUserLanguage()
LANGUAGE_ENGLISH_US
if not explicitly configured.
public int hashCode()
hashCode
in class java.lang.Object
public final boolean isIE()
public final boolean isNetscape()
public boolean isOnLine()
true
if not explicitly configured.
public void setApplicationCodeName(java.lang.String applicationCodeName)
applicationCodeName
- The applicationCodeName to set.public void setApplicationMinorVersion(java.lang.String applicationMinorVersion)
applicationMinorVersion
- The applicationMinorVersion to set.public void setApplicationName(java.lang.String applicationName)
applicationName
- The applicationName to set.public void setApplicationVersion(java.lang.String applicationVersion)
applicationVersion
- The applicationVersion to set.public void setBrowserLanguage(java.lang.String browserLanguage)
browserLanguage
- The browserLanguage to set.public void setBrowserVersion(float browserVersion)
browserVersion
- The browserVersion to set.public void setCpuClass(java.lang.String cpuClass)
cpuClass
- The cpuClass to set.public static void setDefault(BrowserVersion newBrowserVersion)
newBrowserVersion
- The new default browser version.public void setJavaScriptVersion(java.lang.String javaScriptVersion)
javaScriptVersion
- The javaScriptVersion to set.public void setOnLine(boolean onLine)
onLine
- The onLine to set.public void setPlatform(java.lang.String platform)
platform
- The platform to set.public void setSystemLanguage(java.lang.String systemLanguage)
systemLanguage
- The systemLanguage to set.public void setUserAgent(java.lang.String userAgent)
userAgent
- The userAgent to set.public void setUserLanguage(java.lang.String userLanguage)
userLanguage
- The userLanguage to set.
|
|||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |