|
||||||||||
| 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 String |
APP_CODE_NAME
Application code name for both Microsoft Internet Explorer and Netscape series. |
static String |
CPU_CLASS_X86
The X86 CPU class. |
static BrowserVersion |
FIREFOX_2
Firefox 2. |
static BrowserVersion |
FIREFOX_3
Firefox 3. |
static String |
INTERNET_EXPLORER
Application name for the Microsoft Internet Explorer series of browsers. |
static BrowserVersion |
INTERNET_EXPLORER_6
Internet Explorer 6. |
static BrowserVersion |
INTERNET_EXPLORER_6_0
Deprecated. As of 2.4, please use INTERNET_EXPLORER_6 instead. |
static BrowserVersion |
INTERNET_EXPLORER_7
Internet Explorer 7. |
static BrowserVersion |
INTERNET_EXPLORER_7_0
Deprecated. As of 2.4, please use INTERNET_EXPLORER_7 instead. |
static String |
LANGUAGE_ENGLISH_US
United States English language identifier. |
static String |
NETSCAPE
Application name the Netscape navigator series of browsers. |
static String |
PLATFORM_WIN32
The WIN32 platform. |
| Constructor Summary | |
|---|---|
BrowserVersion(String applicationName,
String applicationVersion,
String userAgent,
float browserVersionNumeric)
Instantiates one. |
|
BrowserVersion(String applicationName,
String applicationVersion,
String userAgent,
float browserVersionNumeric,
BrowserVersionFeatures[] features)
Instantiates one. |
|
BrowserVersion(String applicationName,
String applicationVersion,
String userAgent,
String javaScriptVersion,
float browserVersionNumeric)
Deprecated. as of 2.5, use BrowserVersion(String, String, String, float) |
|
BrowserVersion(String applicationName,
String applicationVersion,
String userAgent,
String javaScriptVersion,
float browserVersionNumeric,
BrowserVersionFeatures[] features)
Deprecated. as of 2.5, use BrowserVersion(String, String, String, float, BrowserVersionFeatures[]) |
|
| Method Summary | |
|---|---|
boolean |
equals(Object o)
|
String |
getApplicationCodeName()
Returns the application code name, for example "Mozilla". |
String |
getApplicationMinorVersion()
Returns the application minor version, for example "0". |
String |
getApplicationName()
Returns the application name, for example "Microsoft Internet Explorer". |
String |
getApplicationVersion()
Returns the application version, for example "4.0 (compatible; MSIE 6.0b; Windows 98)". |
String |
getBrowserLanguage()
Returns the browser application language, for example "en-us". |
float |
getBrowserVersionNumeric()
|
String |
getCpuClass()
Returns 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. |
String |
getJavaScriptVersion()
Deprecated. As of 2.5, with no replacement |
float |
getJavaScriptVersionNumeric()
Deprecated. As of 2.5, with no replacement |
String |
getNickname()
Returns the short name of the browser like "FF3", "IE7", ... |
String |
getNickName()
Deprecated. since 2.4, use getNickname() instead |
String |
getPlatform()
Returns the platform on which the application is running, for example "Win32". |
Set<PluginConfiguration> |
getPlugins()
Returns the available plugins. |
String |
getSystemLanguage()
Returns the system language, for example "en-us". |
String |
getUserAgent()
Returns the user agent string, for example "Mozilla/4.0 (compatible; MSIE 6.0b; Windows 98)". |
String |
getUserLanguage()
Returns the user language, for example "en-us". |
boolean |
hasFeature(BrowserVersionFeatures property)
Indicates if this instance has the given feature. |
int |
hashCode()
|
boolean |
isFirefox()
Returns true if this BrowserVersion instance represents some version of Firefox like FIREFOX_2 or FIREFOX_3. |
boolean |
isIE()
Returns true if this BrowserVersion instance represents some version of Microsoft Internet Explorer. |
boolean |
isNetscape()
Deprecated. since HtmlUnit-2.4. Replaced by isFirefox(). |
boolean |
isOnLine()
Returns true if the browser is currently online. |
void |
setApplicationCodeName(String applicationCodeName)
|
void |
setApplicationMinorVersion(String applicationMinorVersion)
|
void |
setApplicationName(String applicationName)
|
void |
setApplicationVersion(String applicationVersion)
|
void |
setBrowserLanguage(String browserLanguage)
|
void |
setBrowserVersion(float browserVersion)
|
void |
setCpuClass(String cpuClass)
|
static void |
setDefault(BrowserVersion newBrowserVersion)
Sets the default browser version that is used whenever a specific version isn't specified. |
void |
setJavaScriptVersion(String javaScriptVersion)
Deprecated. As of 2.5, with no replacement |
void |
setOnLine(boolean onLine)
|
void |
setPlatform(String platform)
|
void |
setSystemLanguage(String systemLanguage)
|
void |
setUserAgent(String userAgent)
|
void |
setUserLanguage(String userLanguage)
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String APP_CODE_NAME
public static final String INTERNET_EXPLORER
public static final String NETSCAPE
public static final String LANGUAGE_ENGLISH_US
public static final String CPU_CLASS_X86
public static final String PLATFORM_WIN32
public static final BrowserVersion FIREFOX_2
public static final BrowserVersion FIREFOX_3
public static final BrowserVersion INTERNET_EXPLORER_6
@Deprecated public static final BrowserVersion INTERNET_EXPLORER_6_0
INTERNET_EXPLORER_6 instead.
public static final BrowserVersion INTERNET_EXPLORER_7
@Deprecated public static final BrowserVersion INTERNET_EXPLORER_7_0
INTERNET_EXPLORER_7 instead.
| Constructor Detail |
|---|
@Deprecated
public BrowserVersion(String applicationName,
String applicationVersion,
String userAgent,
String javaScriptVersion,
float browserVersionNumeric)
BrowserVersion(String, String, String, float)
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 browser
public BrowserVersion(String applicationName,
String applicationVersion,
String userAgent,
float browserVersionNumeric)
applicationName - the name of the applicationapplicationVersion - the version string of the applicationuserAgent - the user agent string that will be sent to the serverbrowserVersionNumeric - the floating number version of the browser
@Deprecated
public BrowserVersion(String applicationName,
String applicationVersion,
String userAgent,
String javaScriptVersion,
float browserVersionNumeric,
BrowserVersionFeatures[] features)
BrowserVersion(String, String, String, float, BrowserVersionFeatures[])
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 browserfeatures - the browser features
public BrowserVersion(String applicationName,
String applicationVersion,
String userAgent,
float browserVersionNumeric,
BrowserVersionFeatures[] features)
applicationName - the name of the applicationapplicationVersion - the version string of the applicationuserAgent - the user agent string that will be sent to the serverbrowserVersionNumeric - the floating number version of the browserfeatures - the browser features| Method Detail |
|---|
public static BrowserVersion getDefault()
INTERNET_EXPLORER_7.
public static void setDefault(BrowserVersion newBrowserVersion)
newBrowserVersion - the new default browser versionpublic final boolean isIE()
public final boolean isFirefox()
FIREFOX_2 or FIREFOX_3.
@Deprecated public final boolean isNetscape()
isFirefox().
public String getApplicationCodeName()
APP_CODE_NAME if not explicitly configured.
public String getApplicationMinorVersion()
public String getApplicationName()
public String getApplicationVersion()
public String getBrowserLanguage()
LANGUAGE_ENGLISH_US if not explicitly configured.
public String getCpuClass()
CPU_CLASS_X86 if not explicitly configured.
public boolean isOnLine()
true if not explicitly configured.
public String getPlatform()
PLATFORM_WIN32 if not explicitly configured.
public String getSystemLanguage()
LANGUAGE_ENGLISH_US if not explicitly configured.
public String getUserAgent()
public String getUserLanguage()
LANGUAGE_ENGLISH_US if not explicitly configured.
@Deprecated public String getJavaScriptVersion()
public void setApplicationCodeName(String applicationCodeName)
applicationCodeName - the applicationCodeName to setpublic void setApplicationMinorVersion(String applicationMinorVersion)
applicationMinorVersion - the applicationMinorVersion to setpublic void setApplicationName(String applicationName)
applicationName - the applicationName to setpublic void setApplicationVersion(String applicationVersion)
applicationVersion - the applicationVersion to setpublic void setBrowserLanguage(String browserLanguage)
browserLanguage - the browserLanguage to setpublic void setCpuClass(String cpuClass)
cpuClass - the cpuClass to set@Deprecated public void setJavaScriptVersion(String javaScriptVersion)
javaScriptVersion - the javaScriptVersion to setpublic void setOnLine(boolean onLine)
onLine - the onLine to setpublic void setPlatform(String platform)
platform - the platform to setpublic void setSystemLanguage(String systemLanguage)
systemLanguage - the systemLanguage to setpublic void setUserAgent(String userAgent)
userAgent - the userAgent to setpublic void setUserLanguage(String userLanguage)
userLanguage - the userLanguage to setpublic void setBrowserVersion(float browserVersion)
browserVersion - the browserVersion to setpublic float getBrowserVersionNumeric()
@Deprecated public float getJavaScriptVersionNumeric()
public boolean equals(Object o)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic Set<PluginConfiguration> getPlugins()
public boolean hasFeature(BrowserVersionFeatures property)
property - the property name
false if this browser doesn't have this feature@Deprecated public String getNickName()
getNickname() instead
public String getNickname()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||