Enum BrowserVersionTrait
- java.lang.Object
-
- java.lang.Enum<BrowserVersionTrait>
-
- org.openqa.selenium.htmlunit.options.BrowserVersionTrait
-
- All Implemented Interfaces:
Serializable
,Comparable<BrowserVersionTrait>
,BrowserVersionTraitNames
,OptionEnum
public enum BrowserVersionTrait extends Enum<BrowserVersionTrait> implements BrowserVersionTraitNames, OptionEnum
- Author:
- Scott Babcock, Ronald Brill
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ACCEPT_ENCODING_HEADER
Returns the value used by the browser for theAccept-Encoding
header.ACCEPT_LANGUAGE_HEADER
Returns the value used by the browser for theAccept-Language
header.APPLICATION_CODE_NAME
Returns the application code name, for example "Mozilla".APPLICATION_MINOR_VERSION
Returns the application minor version, for example "0".APPLICATION_NAME
Returns the application name, for example "Microsoft Internet Explorer".APPLICATION_VERSION
Returns the application version, for example "4.0 (compatible; MSIE 6.0b; Windows 98)".BROWSER_LANGUAGE
Returns the browser language, for example "en-US".CSS_ACCEPT_HEADER
Returns the value used by the browser for theAccept
header if requesting a CSS declaration.HTML_ACCEPT_HEADER
Returns the value used by the browser for theAccept
header if requesting a page.IMG_ACCEPT_HEADER
Returns the value used by the browser for theAccept
header if requesting an image.IS_ONLINE
Returnstrue
if the browser is currently online.NICKNAME
Returns the nickname for the browser represented by this BrowserVersion.NUMERIC_CODE
Returns the numeric code for the browser represented by this BrowserVersion.PLATFORM
Returns the platform on which the application is running, for example "Win32".SCRIPT_ACCEPT_HEADER
Returns the value used by the browser for theAccept
header if requesting a script.SEC_CLIENT_HINT_USER_AGENT_HEADER
Returns the value used by the browser for theSec-CH-UA
header.SEC_CLIENT_HINT_USER_AGENT_PLATFORM_HEADER
Returns the value used by the browser for theSec-CH-UA-Platform
header.SYSTEM_TIMEZONE
Returns the systemTimeZone
.USER_AGENT
Returns the user agent string, for example "Mozilla/4.0 (compatible; MSIE 6.0b; Windows 98)".VENDOR
Returns the browser vendor, for example "Google Inc.".XML_HTTP_REQUEST_ACCEPT_HEADER
Returns the value used by the browser for theAccept
header if performing an XMLHttpRequest.
-
Field Summary
-
Fields inherited from interface org.openqa.selenium.htmlunit.options.BrowserVersionTraitNames
optAcceptEncodingHeader, optAcceptLanguageHeader, optApplicationCodeName, optApplicationMinorVersion, optApplicationName, optApplicationVersion, optBrowserLanguage, optCssAcceptHeader, optHtmlAcceptHeader, optImgAcceptHeader, optIsOnline, optNickname, optNumericCode, optPlatform, optScriptAcceptHeader, optSecClientHintUserAgentHeader, optSecClientHintUserAgentPlatformHeader, optSystemTimezone, optUserAgent, optVendor, optXmlHttpRequestAcceptHeader, SECTION
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
apply(Object value, BrowserVersion.BrowserVersionBuilder builder)
Apply the specified value for this trait into the provided browser version builder.void
applyPropertyTo(Map<String,Object> optionsMap)
Apply the value of the system property associated with this trait to the specified options map.Object
decode(Object value)
Decode the specified value according to the type of this trait.Object
encode(Object value)
Encode the specified value according to the type of this trait.static BrowserVersionTrait
fromCapabilityKey(String key)
static BrowserVersionTrait
fromPropertyName(String name)
String
getCapabilityKey()
Object
getDefaultValue()
Class<?>
getOptionType()
String
getPropertyName()
boolean
isDefaultValue(Object value)
Determine if the specified value matches the default for this trait.Object
obtain(BrowserVersion version)
Obtain the value for this trait from the specified browser version object.static BrowserVersionTrait
valueOf(String name)
Returns the enum constant of this type with the specified name.static BrowserVersionTrait[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NUMERIC_CODE
public static final BrowserVersionTrait NUMERIC_CODE
Returns the numeric code for the browser represented by this BrowserVersion.property: webdriver.htmlunit.numericCode
type:int
default:0
-
NICKNAME
public static final BrowserVersionTrait NICKNAME
Returns the nickname for the browser represented by this BrowserVersion.property: webdriver.htmlunit.nickname
type:String
default:null
-
APPLICATION_VERSION
public static final BrowserVersionTrait APPLICATION_VERSION
Returns the application version, for example "4.0 (compatible; MSIE 6.0b; Windows 98)".property: webdriver.htmlunit.applicationVersion
type:String
default:null
see: MSDN documentation
-
USER_AGENT
public static final BrowserVersionTrait USER_AGENT
Returns the user agent string, for example "Mozilla/4.0 (compatible; MSIE 6.0b; Windows 98)".property: webdriver.htmlunit.userAgent
type:String
default:null
-
APPLICATION_NAME
public static final BrowserVersionTrait APPLICATION_NAME
Returns the application name, for example "Microsoft Internet Explorer".property: webdriver.htmlunit.applicationName
type:String
default:null
- See Also:
- MSDN documentation
-
APPLICATION_CODE_NAME
public static final BrowserVersionTrait APPLICATION_CODE_NAME
Returns the application code name, for example "Mozilla".property: webdriver.htmlunit.applicationCodeName
type:String
default: "Mozilla"
see: MSDN documentation
-
APPLICATION_MINOR_VERSION
public static final BrowserVersionTrait APPLICATION_MINOR_VERSION
Returns the application minor version, for example "0".property: webdriver.htmlunit.applicationMinorVersion
type:String
default: "0"
see: MSDN documentation
-
VENDOR
public static final BrowserVersionTrait VENDOR
Returns the browser vendor, for example "Google Inc.".property: webdriver.htmlunit.vendor
type:String
default: ""
-
BROWSER_LANGUAGE
public static final BrowserVersionTrait BROWSER_LANGUAGE
Returns the browser language, for example "en-US".property: webdriver.htmlunit.browserLanguage
type:String
default: "en_US"
-
IS_ONLINE
public static final BrowserVersionTrait IS_ONLINE
Returnstrue
if the browser is currently online.property: webdriver.htmlunit.isOnline
type:boolean
default:true
see: MSDN documentation
-
PLATFORM
public static final BrowserVersionTrait PLATFORM
Returns the platform on which the application is running, for example "Win32".property: webdriver.htmlunit.platform
type:String
default: "Win32"
see: MSDN documentation
-
SYSTEM_TIMEZONE
public static final BrowserVersionTrait SYSTEM_TIMEZONE
-
ACCEPT_ENCODING_HEADER
public static final BrowserVersionTrait ACCEPT_ENCODING_HEADER
Returns the value used by the browser for theAccept-Encoding
header.property: webdriver.htmlunit.acceptEncodingHeader
type:String
default:null
-
ACCEPT_LANGUAGE_HEADER
public static final BrowserVersionTrait ACCEPT_LANGUAGE_HEADER
Returns the value used by the browser for theAccept-Language
header.property: webdriver.htmlunit.acceptLanguageHeader
type:String
default:null
-
HTML_ACCEPT_HEADER
public static final BrowserVersionTrait HTML_ACCEPT_HEADER
Returns the value used by the browser for theAccept
header if requesting a page.property: webdriver.htmlunit.htmlAcceptHeader
type:String
default:null
-
IMG_ACCEPT_HEADER
public static final BrowserVersionTrait IMG_ACCEPT_HEADER
Returns the value used by the browser for theAccept
header if requesting an image.property: webdriver.htmlunit.imgAcceptHeader
type:String
default:null
-
CSS_ACCEPT_HEADER
public static final BrowserVersionTrait CSS_ACCEPT_HEADER
Returns the value used by the browser for theAccept
header if requesting a CSS declaration.property: webdriver.htmlunit.cssAcceptHeader
type:String
default:null
-
SCRIPT_ACCEPT_HEADER
public static final BrowserVersionTrait SCRIPT_ACCEPT_HEADER
Returns the value used by the browser for theAccept
header if requesting a script.property: webdriver.htmlunit.scriptAcceptHeader
type:String
default:null
-
XML_HTTP_REQUEST_ACCEPT_HEADER
public static final BrowserVersionTrait XML_HTTP_REQUEST_ACCEPT_HEADER
Returns the value used by the browser for theAccept
header if performing an XMLHttpRequest.property: webdriver.htmlunit.xmlHttpRequestAcceptHeader
type:String
default:null
-
SEC_CLIENT_HINT_USER_AGENT_HEADER
public static final BrowserVersionTrait SEC_CLIENT_HINT_USER_AGENT_HEADER
Returns the value used by the browser for theSec-CH-UA
header.property: webdriver.htmlunit.secClientHintUserAgentHeader
type:String
default:null
-
SEC_CLIENT_HINT_USER_AGENT_PLATFORM_HEADER
public static final BrowserVersionTrait SEC_CLIENT_HINT_USER_AGENT_PLATFORM_HEADER
Returns the value used by the browser for theSec-CH-UA-Platform
header.property: webdriver.htmlunit.secClientHintUserAgentPlatformHeader
type:String
default:null
-
-
Method Detail
-
values
public static BrowserVersionTrait[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (BrowserVersionTrait c : BrowserVersionTrait.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static BrowserVersionTrait valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getCapabilityKey
public String getCapabilityKey()
- Specified by:
getCapabilityKey
in interfaceOptionEnum
-
getPropertyName
public String getPropertyName()
- Specified by:
getPropertyName
in interfaceOptionEnum
-
getOptionType
public Class<?> getOptionType()
- Specified by:
getOptionType
in interfaceOptionEnum
-
getDefaultValue
public Object getDefaultValue()
- Specified by:
getDefaultValue
in interfaceOptionEnum
-
isDefaultValue
public boolean isDefaultValue(Object value)
Determine if the specified value matches the default for this trait.- Specified by:
isDefaultValue
in interfaceOptionEnum
- Parameters:
value
- value to be evaluated- Returns:
true
if specified value matches the default value; otherwisefalse
-
applyPropertyTo
public void applyPropertyTo(Map<String,Object> optionsMap)
Apply the value of the system property associated with this trait to the specified options map.- Specified by:
applyPropertyTo
in interfaceOptionEnum
- Parameters:
optionsMap
- browser version options map
-
encode
public Object encode(Object value)
Encode the specified value according to the type of this trait.- Specified by:
encode
in interfaceOptionEnum
- Parameters:
value
- value to be encoded- Returns:
- trait-specific encoding for specified value
-
decode
public Object decode(Object value)
Decode the specified value according to the type of this trait.- Specified by:
decode
in interfaceOptionEnum
- Parameters:
value
- value to be decoded- Returns:
- trait-specific decoding for specified value
-
apply
public void apply(Object value, BrowserVersion.BrowserVersionBuilder builder)
Apply the specified value for this trait into the provided browser version builder.- Parameters:
value
- value to be insertedbuilder
-BrowserVersion.BrowserVersionBuilder
object
-
obtain
public Object obtain(BrowserVersion version)
Obtain the value for this trait from the specified browser version object.- Parameters:
version
-BrowserVersion
object- Returns:
- value for this trait
-
fromCapabilityKey
public static BrowserVersionTrait fromCapabilityKey(String key)
-
fromPropertyName
public static BrowserVersionTrait fromPropertyName(String name)
-
-