2004.04.29


com.jdc.http.user
Class Browser

java.lang.Object
  |
  +--com.jdc.lang.Object
        |
        +--com.jdc.lang.SerializableObject
              |
              +--com.jdc.http.user.Browser
All Implemented Interfaces:
Serializable

public class Browser
extends SerializableObject

Browser contains all available information regarding the user's web browser. This browser information is typically obtained by executing the JavaScript code in EnvironmentSensing.js (include script file).

Version:
1.0
Author:
Jay Damon
See Also:
Serialized Form

Field Summary
static String GECKO
           
 
Fields inherited from class com.jdc.lang.Object
string
 
Constructor Summary
Browser()
          Constructs a new Browser object.
Browser(String appName)
          Constructs a new Browser object with the specified name property.
Browser(String appName, String appVersion)
          Constructs a new Browser object with the specified name and version properties.
Browser(String appName, String appVersion, String userAgent)
          Constructs a new Browser object with the specified name, version, and user agent properties.
 
Method Summary
 boolean areCookiesEnabled()
          Returns the status of browser cookies.
 String getAppName()
          Returns the browser name property.
 String getAppVersion()
          Returns the browser version property.
 String getName()
          Returns the browser name.
 BrowserPage getPage()
          Returns the browser page.
 String getUserAgent()
          Returns the browser user agent property.
 float getVersion()
          Returns the browser version.
 boolean isBrowser(String browser)
          Returns true if the browser is the specified browser.
 boolean isGecko()
          Returns true if the browser is Gecko.
 boolean isInternetExplorer()
          Returns true if the browser is Microsoft Internet Explorer.
 boolean isMozilla()
          Returns true if the browser is Mozilla.
 boolean isNetscapeNavigator()
          Returns true if the browser is Netscape Navigator.
 boolean isOpera()
          Returns true if the browser is Opera.
 void setAppName(String appName)
          Sets the browser name property obtained from the JavaScript: appName = navigator.appName;
 void setAppVersion(String appVersion)
          Sets the browser version property obtained from the JavaScript: appVersion = navigator.appVersion;
 void setCookiesEnabled(String areCookiesEnabled)
          Sets the status for browser cookies.
 void setUserAgent(String userAgent)
          Sets the browser user agent property obtained from the JavaScript: userAgent = navigator.userAgent;
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GECKO

public static final String GECKO
See Also:
Constant Field Values
Constructor Detail

Browser

public Browser()
Constructs a new Browser object.


Browser

public Browser(String appName)
Constructs a new Browser object with the specified name property.


Browser

public Browser(String appName,
               String appVersion)
Constructs a new Browser object with the specified name and version properties.


Browser

public Browser(String appName,
               String appVersion,
               String userAgent)
Constructs a new Browser object with the specified name, version, and user agent properties.

Method Detail

areCookiesEnabled

public boolean areCookiesEnabled()
Returns the status of browser cookies.

Returns:
True if browser cookies are enabled. False if browser cookies are disabled.

getAppName

public String getAppName()
Returns the browser name property.

Returns:
String

getAppVersion

public String getAppVersion()
Returns the browser version property.

Returns:
String

getName

public String getName()
Returns the browser name.

Returns:
String

getPage

public BrowserPage getPage()
Returns the browser page.

Returns:
BrowserPage

getUserAgent

public String getUserAgent()
Returns the browser user agent property.

Returns:
String

getVersion

public float getVersion()
Returns the browser version.

Returns:
String

isBrowser

public boolean isBrowser(String browser)
Returns true if the browser is the specified browser.

Returns:
boolean

isGecko

public boolean isGecko()
Returns true if the browser is Gecko.

Returns:
boolean

isInternetExplorer

public boolean isInternetExplorer()
Returns true if the browser is Microsoft Internet Explorer.

Returns:
boolean

isMozilla

public boolean isMozilla()
Returns true if the browser is Mozilla.

Returns:
boolean

isNetscapeNavigator

public boolean isNetscapeNavigator()
Returns true if the browser is Netscape Navigator.

Returns:
boolean

isOpera

public boolean isOpera()
Returns true if the browser is Opera.

Returns:
boolean

setAppName

public void setAppName(String appName)
Sets the browser name property obtained from the JavaScript: appName = navigator.appName;

Parameters:
appName - The browser name property.

setAppVersion

public void setAppVersion(String appVersion)
Sets the browser version property obtained from the JavaScript: appVersion = navigator.appVersion;

Parameters:
appVersion - The browser version property.

setCookiesEnabled

public void setCookiesEnabled(String areCookiesEnabled)
Sets the status for browser cookies.


setUserAgent

public void setUserAgent(String userAgent)
Sets the browser user agent property obtained from the JavaScript: userAgent = navigator.userAgent;

Parameters:
userAgent - The browser user agent property.

2004.04.29



Copyright © 2004 J. Damon & Co.; All Rights Reserved WorldWide.